Repository navigation
Conversation
Previously, the agent loop would continue indefinitely even after all features were passing, wasting tokens and resources. Changes: - Add is_project_complete() helper function to progress.py that checks if all features are passing and none are in progress - Add completion check in agent.py's main loop to break out when the project is complete, with a clear completion message - Update coding_prompt.template.md to instruct the agent what to do when feature_get_next returns "All features are passing" This ensures the agent stops gracefully when the project is complete rather than continuing to run unnecessary sessions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR introduces a project completion detection mechanism. It adds a new Changes
Sequence DiagramsequenceDiagram
participant Agent as Agent Loop
participant Session as Session Handler
participant Complete as is_project_complete()
participant Tests as Test System
Agent->>Session: Execute agent session
Session-->>Agent: Return status "continue"
Agent->>Complete: Check is_project_complete(project_dir)
Complete->>Tests: count_passing_tests(project_dir)
Tests-->>Complete: (passing, in_progress, total)
Complete-->>Agent: True if all pass & none in-progress
alt Project Complete
Agent->>Agent: Print completion messages
Agent->>Agent: Break agent loop
else Project Incomplete
Agent->>Agent: Continue to next iteration
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code graph analysis (1)agent.py (1)
🔇 Additional comments (4)
Comment |
|
@leonvanzyl can we get this merged? |
The acceptance_results field was typed as list[dict[str, Any]] but the database stores dict[str, Any] (Record/object format where keys are validator types). This caused a Pydantic ValidationError when listing agent runs via GET /api/agent-runs. - Changed AgentRunResponse.acceptance_results type to dict[str, Any] - Matches the actual data format stored in the database - Aligns with frontend TypeScript types (Record<string, ...>) Fixes regression in Feature AutoForgeAI#17: GET /api/agent-runs List Runs Endpoint Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
is_project_complete()helper function to detect when all features are passingProblem
Previously, the agent loop would continue indefinitely even after all features were passing, resulting in:
Solution
Three-part fix:
progress.py: Added
is_project_complete()function that returnsTruewhen:agent.py: Added completion check in the main loop (after
status == "continue") that:is_project_complete()before auto-continuingcoding_prompt.template.md: Added explicit instructions explaining what the agent should do when
feature_get_nextreturns{"error": "All features are passing! No more work to do."}- run final regression tests, commit, update progress notes, and end the session.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.