-
Notifications
You must be signed in to change notification settings - Fork 287
fix: Stop agent when all features are complete #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Stop agent when all features are complete #46
Conversation
Fixes issue where the agent continues indefinitely with regression tests after all features are implemented, wasting tokens on unnecessary sessions. Changes: - Add is_project_complete() function to progress.py that checks if all features are passing and none are in-progress - Add completion check in agent.py main loop that breaks out when project is complete, displaying a clear success message - Update coding_prompt.template.md with instructions for graceful shutdown when feature_get_next returns the completion signal This prevents the endless regression loop that was consuming ~10,000 tokens per unnecessary session after project completion. Closes leonvanzyl#13 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR implements automatic project completion detection to prevent the agent from running indefinitely after all features are passing. A new completion check function is added to evaluate project state, integrated into the agent loop with an early exit condition, and supplemented with prompt guidance explaining the completion workflow. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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📓 Path-based instructions (4).claude/templates/**/*.template.md📄 CodeRabbit inference engine (CLAUDE.md)
Files:
*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
agent.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (1)📚 Learning: 2026-01-10T08:23:04.012ZApplied to files:
🧬 Code graph analysis (1)agent.py (1)
🔇 Additional comments (4)
Comment |
Analysis: This PR is now obsoleteAfter a detailed code review comparing this PR against current master, this functionality has already been implemented via different commits. What's already on master:
Relevant commits on master:
Conclusion:The bug this PR aimed to fix (endless regression tests after completion) has been resolved through commits merged via PR #50 and #77. While this PR proposes a cleaner Recommendation: Close as obsolete. Thank you for the contribution - the issue was important and has been addressed! |
Summary
Fixes #13 - Agent continues indefinitely with regression tests after all features complete
is_project_complete()function to detect when all features are passingProblem
When all features are complete (
passing = totalandpending = 0), the agent:feature_get_nextand receives "All features are passing!"feature_get_for_regressionSolution
After each session with
status == "continue", the loop now checksis_project_complete():Test plan
is_project_complete()returns correct values for various states🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.