Conversation
Completes the implementation of test/review workflows with automatic resolution and integrates them into the orchestrator. **Phase 3: Test Workflow with Resolution** - Created test_workflow.py with automatic test failure resolution - Implements retry loop with max 4 attempts (configurable via MAX_TEST_RETRY_ATTEMPTS) - Parses JSON test results and resolves failures one by one - Uses existing test.md and resolve_failed_test.md commands - Added run_tests() and resolve_test_failure() to workflow_operations.py **Phase 4: Review Workflow with Resolution** - Created review_workflow.py with automatic blocker issue resolution - Implements retry loop with max 3 attempts (configurable via MAX_REVIEW_RETRY_ATTEMPTS) - Categorizes issues by severity (blocker/tech_debt/skippable) - Only blocks on blocker issues - tech_debt and skippable allowed to pass - Created review_runner.md and resolve_failed_review.md commands - Added run_review() and resolve_review_issue() to workflow_operations.py - Supports screenshot capture for UI review (configurable via ENABLE_SCREENSHOT_CAPTURE) **Phase 5: Compositional Integration** - Updated workflow_orchestrator.py to integrate test and review phases - Test phase runs between commit and PR creation (if ENABLE_TEST_PHASE=true) - Review phase runs after tests (if ENABLE_REVIEW_PHASE=true) - Both phases are optional and controlled by config flags - Step history tracks test and review execution results - Proper error handling and logging for all phases **Supporting Changes** - Updated agent_names.py to add REVIEWER constant - Added configuration flags to config.py for test/review phases - All new code follows structured logging patterns - Maintains compatibility with existing workflow steps **Files Changed**: 19 files, 3035+ lines - New: test_workflow.py, review_workflow.py, review commands - Modified: orchestrator, workflow_operations, agent_names, config - Phases 1-2 files (worktree, state, port allocation) also staged The implementation is complete and ready for testing. All phases now support parallel execution via worktree isolation with deterministic port allocation.
Simplifies the workflow orchestrator from hardcoded 11-step atomic operations to user-selectable 6-command workflow with context passing. Core changes: - WorkflowStep enum: 11 steps → 6 commands (create-branch, planning, execute, commit, create-pr, prp-review) - workflow_orchestrator.py: 367 lines → 200 lines with command stitching loop - Remove workflow_type field, add selected_commands parameter - Simplify agent names from 11 → 6 constants - Remove test/review phase config flags (now optional commands) Deletions: - Remove test_workflow.py, review_workflow.py, workflow_phase_tracker.py - Remove 32 old command files from .claude/commands - Remove PRPs/specs and PRD files from version control - Update .gitignore to exclude specs, features, and validation markdown files Breaking changes: - AgentWorkOrder no longer has workflow_type field - CreateAgentWorkOrderRequest now uses selected_commands instead of workflow_type - WorkflowStep enum values incompatible with old step history 56 files changed, 625 insertions(+), 15,007 deletions(-)
- add trailing slashes to agent-work-orders endpoints to prevent FastAPI mount() redirects - add defensive null check for repository_url in detail view - fix backend routes to use relative paths with app.mount() - resolves ERR_NAME_NOT_RESOLVED when accessing agent work orders
- add trailing slashes to prevent FastAPI mount() 307 redirects - add defensive null check for repository_url in detail view - fixes ERR_NAME_NOT_RESOLVED when browser follows redirect to archon-server
This reverts commit c2a568e.
- Change from fixed backend/frontend ports to 10-port ranges per work order - Support 20 concurrent work orders (200 ports: 9000-9199) - Add port availability checking with flexible allocation - Make git_worktree default sandbox type - Standardize API routes with /api/ prefix - Add comprehensive port allocation tests - Update environment file generation with PORT_0-PORT_9 variables - Maintain backward compatibility with BACKEND_PORT/FRONTEND_PORT aliases
- Sort imports consistently - Remove unused imports (pytest, MagicMock, patch, etc.) - Update to datetime.UTC alias from timezone.utc - Fix formatting and organization issues
- Move sse-starlette from base dependencies to agent-work-orders group - Keep structlog in agent-work-orders group (already there) - Update lockfile accordingly
- Add WorkOrderLogsPanel with SSE streaming support - Add RealTimeStats component for live metrics - Add useWorkOrderLogs hook for SSE log streaming - Add useLogStats hook for real-time statistics - Update WorkOrderDetailView to display logs panel - Add comprehensive tests for new components - Configure Vite test environment
Add ENABLE_AGENT_WORK_ORDERS configuration flag to allow disabling the agent work orders microservice. Service discovery now gracefully handles unavailable services, and health checks return appropriate status when feature is disabled. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Add archon_configured_repositories table migration with production-ready sandbox type constraints - Implement SupabaseWorkOrderRepository for CRUD operations with comprehensive error handling - Add defensive validation in _row_to_model with detailed logging for invalid enum values - Implement granular exception handling (409 duplicates, 422 validation, 502 GitHub API errors) - Document async/await pattern for interface consistency across repository implementations - Add Supabase health check to verify table existence - Expand test coverage from 10 to 17 tests with error handling and edge case validation - Add supabase dependency to agent-work-orders group - Enable ENABLE_AGENT_WORK_ORDERS flag in docker-compose for production deployment
… and finish of the style guide mockup.
…e to view the details since the execution history was completed, since the full logs don't persist.
…s count bug that is showing commits of the whole main branch vs. the work order changes.
|
Warning Rate limit exceeded@sean-eskerium has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 55 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (107)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…828) * refactor(api): Zod schemas + @hono/zod-openapi as single source of truth (step 1) - Install @hono/zod-openapi; swap Hono → OpenAPIHono with defaultHook - Add Zod schemas for workflow/command API routes (common, workflow, conversation scaffolding) - Migrate 6 workflow/command routes to .openapi(); serve /api/openapi.json - Create packages/web/src/lib/workflow-types.ts with frontend-local type mirrors - Remove @archon/workflows from web package.json; swap all imports in 10 web files - Update CLAUDE.md with Zod schema conventions Closes #823 * fix: address review findings for PR #828 - Add workflowLoadErrorSchema and errors field to workflowListResponseSchema so GET /api/workflows schema matches the actual handler response - Fix 500 handler in GET /api/workflows to use apiError() instead of returning { workflows: [], warning: } which contradicted errorSchema - Improve defaultHook to return per-field Zod error messages using result.error.issues instead of opaque result.error.message - Clarify workflowListItemSchema comment as Step 2 scaffolding - Add GET /api/workflows to CLAUDE.md API Endpoints section * fix: address review findings from multi-agent PR review - Remove unused workflowListItemSchema (YAGNI, no callers) - Remove conversation.schemas.ts scaffolding (defer to #831) - Fix openapi() wrapper comment: output is NOT validated at runtime - Rename openapi() → registerOpenApiRoute() for clarity - Unify definition body schema to z.record(z.unknown()) (was inconsistent) - Constrain WorkflowLoadError.errorType to z.enum - Extract defaultHook to shared openapi-defaults.ts - Extract jsonError() helper for repeated error response shapes - Move route configs to module scope (pure config, no closure deps) - Deduplicate workflowDefinitionSchema comment - CLAUDE.md: add /api/openapi.json, update @archon/server to OpenAPIHono, add @archon/web import caveat, clarify wrapper convention
…1) (#836) * refactor(api): migrate remaining routes to @hono/zod-openapi (step 1.1) - Create conversation.schemas.ts with 9 Zod schemas for conversation/message routes - Create codebase.schemas.ts with 5 Zod schemas for codebase routes - Add 14 workflowRun schemas to workflow.schemas.ts - Migrate 19 plain routes to registerOpenApiRoute(createRoute(...), handler) - Update 4 test files for Zod validation behavior (validationErrorHook, assertion updates) All JSON API routes now use the typed openapi() wrapper. OpenAPI spec at /api/openapi.json covers all JSON endpoints. SSE routes intentionally excluded. Closes #831 * fix: address MEDIUM review findings from PR #836 - Replace manual c.req.json() re-parses in sendMessageRoute and runWorkflowRoute with c.req.valid('json') (Zod already validates before handler runs; manual parse was redundant and swallowed errors) - Add z.string().min(1) to sendMessageBodySchema to enforce non-empty message invariant at the schema level instead of ad-hoc in handler - Move isValidCommandName guard outside try block in runWorkflowRoute so invalid names return 400 (not 500 via run_workflow_failed) - Fix makeApp() return type from Hono to OpenAPIHono in three test files - Update addCodebaseBodySchema JSDoc to match permissive schema (constraint is enforced by handler, not schema) - Add GET /api/workflows/runs/by-worker/:platformId tests (found/not-found) * fix: complete Zod migration for all route handlers - Replace manual c.req.json() in createConversation, updateConversation, addCodebase, validateWorkflow, and saveWorkflow handlers with getValidatedBody() helper that centralizes the .valid('json') cast - Add getValidatedBody(c, schema) helper to eliminate repeated unsafe casts — keeps the pattern searchable and type-safe - Migrate sendMessageRoute and runWorkflowRoute to use getValidatedBody() - Add .strict() to createConversationBodySchema to reject unknown fields (e.g. conversationId) at the Zod layer instead of in handler code - Add .refine() to addCodebaseBodySchema enforcing url/path mutual exclusion at schema level — removes redundant handler validation - Add .min(1) to updateConversationBodySchema.title for consistency with sendMessageBodySchema.message - Normalize all error responses to use apiError() helper instead of raw c.json({ error: ... }) for consistent error format - Remove stale route registration order comment - Fix missing validationErrorHook in conversationId rejection test
…oleam00#828) * refactor(api): Zod schemas + @hono/zod-openapi as single source of truth (step 1) - Install @hono/zod-openapi; swap Hono → OpenAPIHono with defaultHook - Add Zod schemas for workflow/command API routes (common, workflow, conversation scaffolding) - Migrate 6 workflow/command routes to .openapi(); serve /api/openapi.json - Create packages/web/src/lib/workflow-types.ts with frontend-local type mirrors - Remove @archon/workflows from web package.json; swap all imports in 10 web files - Update CLAUDE.md with Zod schema conventions Closes coleam00#823 * fix: address review findings for PR coleam00#828 - Add workflowLoadErrorSchema and errors field to workflowListResponseSchema so GET /api/workflows schema matches the actual handler response - Fix 500 handler in GET /api/workflows to use apiError() instead of returning { workflows: [], warning: } which contradicted errorSchema - Improve defaultHook to return per-field Zod error messages using result.error.issues instead of opaque result.error.message - Clarify workflowListItemSchema comment as Step 2 scaffolding - Add GET /api/workflows to CLAUDE.md API Endpoints section * fix: address review findings from multi-agent PR review - Remove unused workflowListItemSchema (YAGNI, no callers) - Remove conversation.schemas.ts scaffolding (defer to coleam00#831) - Fix openapi() wrapper comment: output is NOT validated at runtime - Rename openapi() → registerOpenApiRoute() for clarity - Unify definition body schema to z.record(z.unknown()) (was inconsistent) - Constrain WorkflowLoadError.errorType to z.enum - Extract defaultHook to shared openapi-defaults.ts - Extract jsonError() helper for repeated error response shapes - Move route configs to module scope (pure config, no closure deps) - Deduplicate workflowDefinitionSchema comment - CLAUDE.md: add /api/openapi.json, update @archon/server to OpenAPIHono, add @archon/web import caveat, clarify wrapper convention
…1) (coleam00#836) * refactor(api): migrate remaining routes to @hono/zod-openapi (step 1.1) - Create conversation.schemas.ts with 9 Zod schemas for conversation/message routes - Create codebase.schemas.ts with 5 Zod schemas for codebase routes - Add 14 workflowRun schemas to workflow.schemas.ts - Migrate 19 plain routes to registerOpenApiRoute(createRoute(...), handler) - Update 4 test files for Zod validation behavior (validationErrorHook, assertion updates) All JSON API routes now use the typed openapi() wrapper. OpenAPI spec at /api/openapi.json covers all JSON endpoints. SSE routes intentionally excluded. Closes coleam00#831 * fix: address MEDIUM review findings from PR coleam00#836 - Replace manual c.req.json() re-parses in sendMessageRoute and runWorkflowRoute with c.req.valid('json') (Zod already validates before handler runs; manual parse was redundant and swallowed errors) - Add z.string().min(1) to sendMessageBodySchema to enforce non-empty message invariant at the schema level instead of ad-hoc in handler - Move isValidCommandName guard outside try block in runWorkflowRoute so invalid names return 400 (not 500 via run_workflow_failed) - Fix makeApp() return type from Hono to OpenAPIHono in three test files - Update addCodebaseBodySchema JSDoc to match permissive schema (constraint is enforced by handler, not schema) - Add GET /api/workflows/runs/by-worker/:platformId tests (found/not-found) * fix: complete Zod migration for all route handlers - Replace manual c.req.json() in createConversation, updateConversation, addCodebase, validateWorkflow, and saveWorkflow handlers with getValidatedBody() helper that centralizes the .valid('json') cast - Add getValidatedBody(c, schema) helper to eliminate repeated unsafe casts — keeps the pattern searchable and type-safe - Migrate sendMessageRoute and runWorkflowRoute to use getValidatedBody() - Add .strict() to createConversationBodySchema to reject unknown fields (e.g. conversationId) at the Zod layer instead of in handler code - Add .refine() to addCodebaseBodySchema enforcing url/path mutual exclusion at schema level — removes redundant handler validation - Add .min(1) to updateConversationBodySchema.title for consistency with sendMessageBodySchema.message - Normalize all error responses to use apiError() helper instead of raw c.json({ error: ... }) for consistent error format - Remove stale route registration order comment - Fix missing validationErrorHook in conversationId rejection test
…oleam00#828) * refactor(api): Zod schemas + @hono/zod-openapi as single source of truth (step 1) - Install @hono/zod-openapi; swap Hono → OpenAPIHono with defaultHook - Add Zod schemas for workflow/command API routes (common, workflow, conversation scaffolding) - Migrate 6 workflow/command routes to .openapi(); serve /api/openapi.json - Create packages/web/src/lib/workflow-types.ts with frontend-local type mirrors - Remove @archon/workflows from web package.json; swap all imports in 10 web files - Update CLAUDE.md with Zod schema conventions Closes coleam00#823 * fix: address review findings for PR coleam00#828 - Add workflowLoadErrorSchema and errors field to workflowListResponseSchema so GET /api/workflows schema matches the actual handler response - Fix 500 handler in GET /api/workflows to use apiError() instead of returning { workflows: [], warning: } which contradicted errorSchema - Improve defaultHook to return per-field Zod error messages using result.error.issues instead of opaque result.error.message - Clarify workflowListItemSchema comment as Step 2 scaffolding - Add GET /api/workflows to CLAUDE.md API Endpoints section * fix: address review findings from multi-agent PR review - Remove unused workflowListItemSchema (YAGNI, no callers) - Remove conversation.schemas.ts scaffolding (defer to coleam00#831) - Fix openapi() wrapper comment: output is NOT validated at runtime - Rename openapi() → registerOpenApiRoute() for clarity - Unify definition body schema to z.record(z.unknown()) (was inconsistent) - Constrain WorkflowLoadError.errorType to z.enum - Extract defaultHook to shared openapi-defaults.ts - Extract jsonError() helper for repeated error response shapes - Move route configs to module scope (pure config, no closure deps) - Deduplicate workflowDefinitionSchema comment - CLAUDE.md: add /api/openapi.json, update @archon/server to OpenAPIHono, add @archon/web import caveat, clarify wrapper convention
…1) (coleam00#836) * refactor(api): migrate remaining routes to @hono/zod-openapi (step 1.1) - Create conversation.schemas.ts with 9 Zod schemas for conversation/message routes - Create codebase.schemas.ts with 5 Zod schemas for codebase routes - Add 14 workflowRun schemas to workflow.schemas.ts - Migrate 19 plain routes to registerOpenApiRoute(createRoute(...), handler) - Update 4 test files for Zod validation behavior (validationErrorHook, assertion updates) All JSON API routes now use the typed openapi() wrapper. OpenAPI spec at /api/openapi.json covers all JSON endpoints. SSE routes intentionally excluded. Closes coleam00#831 * fix: address MEDIUM review findings from PR coleam00#836 - Replace manual c.req.json() re-parses in sendMessageRoute and runWorkflowRoute with c.req.valid('json') (Zod already validates before handler runs; manual parse was redundant and swallowed errors) - Add z.string().min(1) to sendMessageBodySchema to enforce non-empty message invariant at the schema level instead of ad-hoc in handler - Move isValidCommandName guard outside try block in runWorkflowRoute so invalid names return 400 (not 500 via run_workflow_failed) - Fix makeApp() return type from Hono to OpenAPIHono in three test files - Update addCodebaseBodySchema JSDoc to match permissive schema (constraint is enforced by handler, not schema) - Add GET /api/workflows/runs/by-worker/:platformId tests (found/not-found) * fix: complete Zod migration for all route handlers - Replace manual c.req.json() in createConversation, updateConversation, addCodebase, validateWorkflow, and saveWorkflow handlers with getValidatedBody() helper that centralizes the .valid('json') cast - Add getValidatedBody(c, schema) helper to eliminate repeated unsafe casts — keeps the pattern searchable and type-safe - Migrate sendMessageRoute and runWorkflowRoute to use getValidatedBody() - Add .strict() to createConversationBodySchema to reject unknown fields (e.g. conversationId) at the Zod layer instead of in handler code - Add .refine() to addCodebaseBodySchema enforcing url/path mutual exclusion at schema level — removes redundant handler validation - Add .min(1) to updateConversationBodySchema.title for consistency with sendMessageBodySchema.message - Normalize all error responses to use apiError() helper instead of raw c.json({ error: ... }) for consistent error format - Remove stale route registration order comment - Fix missing validationErrorHook in conversationId rejection test
Pull Request
Summary
Refactors the Agent Work Orders workflow orchestrator from a hardcoded 11-step atomic operation sequence to a user-selectable 6-command compositional architecture. This enables users to run full workflows or partial command sequences (e.g., planning-only, or resume from implementation).
Key Improvements:
Changes Made
Core Refactoring
create-branch,planning,execute,commit,create-pr,prp-review)workflow_typefield, addedselected_commandsparameter with validationselected_commandsarray instead ofworkflow_typeCleanup & Maintenance
.claude/commandsTests
test_workflow_orchestrator.py(375 lines)test_models.pyfor new model structuretest_workflow_operations.pyfor new command functionsCommand Files
create-branch.md,create-pr.mdcommit.md,prime.md.claude/andpython/.claude/Type of Change
Affected Services
Testing
Test Evidence
Checklist
Breaking Changes
API Changes
workflow_typefield fromCreateAgentWorkOrderRequestselected_commandsfield (list[str], defaults to full workflow)selected_commandsor accept the defaultModel Changes
workflow_typefield fromAgentWorkOrdermodelWorkflowStepenum values (incompatible with old step history)Configuration Changes
ENABLE_TEST_PHASE,ENABLE_REVIEW_PHASE,MAX_TEST_RETRY_ATTEMPTS,MAX_REVIEW_RETRY_ATTEMPTSMigration Steps
For existing deployments:
selected_commandsinstead ofworkflow_typeWorkflowStepvaluesAdditional Notes
Validation Results
See
VALIDATION_RESULTS.md(not committed, per .gitignore) for complete validation report including:Statistics
Code Quality
selected_commandsparameterFuture Enhancements
This architecture enables:
Summary by CodeRabbit
Release Notes
New Features
Enhancements
Documentation