Repository navigation
fix: exit agent loop when all features pass - #50
Conversation
Previously, the autonomous agent would continue running indefinitely even after all features passed verification. The agent would enter a verification loop, repeatedly checking 'All features are passing!' without ever exiting. This fix detects the completion message from feature_get_next() and gracefully exits the main loop with a victory banner, preventing unnecessary API calls and resource consumption. Fixes infinite loop when project reaches 100% completion.
📝 WalkthroughWalkthroughThe change updates an import path for ClaudeSDKClient and adds project completion detection logic to the autonomous agent loop. When responses contain "all features are passing" or "no more work to do" (case-insensitive), the agent prints a completion summary and terminates. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 (1)
🧰 Additional context used📓 Path-based instructions (3)*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
agent.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (2)📚 Learning: 2026-01-10T08:23:04.012ZApplied to files:
📚 Learning: 2026-01-10T08:23:04.012ZApplied to files:
🧬 Code graph analysis (1)agent.py (1)
🔇 Additional comments (2)
Comment |
|
Great. Thanks this is a real problem. I will test |
…tures - Verified Kanban board renders 144 features without lag - Tested scrolling performance (0.1ms programmatic scroll) - All feature cards display correctly with proper data - Screenshots captured for verification Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Verified ? key opens keyboard shortcuts modal - Verified 8 shortcuts listed (?, A, D, G, K, N, ,, Esc) - Verified Escape key closes modal - Added verification screenshots Feature was already implemented, this commit documents verification. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Security Review Findings
|
|
I have merged the changes, but will add back the correct claude agent SDK, |
Changes: - Revert incorrect import from claude_code_sdk to claude_agent_sdk in agent.py (PR #50 introduced an undocumented change to a deprecated package) - Clear activeAgents and recentActivity in useWebSocket when agent stops to prevent stale UI state The claude_code_sdk package is deprecated (last updated Sep 2025) while claude_agent_sdk is the active, maintained package. The import change in PR #50 was undocumented and would have caused ImportError since only claude-agent-sdk is specified in requirements.txt. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ForgeAI#50) Defines a DSPy signature for compiling tasks into AgentSpecs with chain-of-thought reasoning. Implementation: - Created api/dspy_signatures.py with SpecGenerationSignature class - Input fields: task_description, task_type, project_context - Output fields: objective, context_json, tool_policy_json, max_turns, timeout_seconds, validators_json, reasoning - Added comprehensive docstring with field descriptions - Created utility functions: get_spec_generator(), validate_spec_output() - Added VALID_TASK_TYPES and DEFAULT_BUDGETS constants - Exported from api package Testing: - 57 unit tests covering all verification steps - Verification script (tests/verify_feature_50.py) passes all checks Dependencies: - Added dspy>=3.0.0 to requirements.txt Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…-exit fix: exit agent loop when all features pass
Changes: - Revert incorrect import from claude_code_sdk to claude_agent_sdk in agent.py (PR AutoForgeAI#50 introduced an undocumented change to a deprecated package) - Clear activeAgents and recentActivity in useWebSocket when agent stops to prevent stale UI state The claude_code_sdk package is deprecated (last updated Sep 2025) while claude_agent_sdk is the active, maintained package. The import change in PR AutoForgeAI#50 was undocumented and would have caused ImportError since only claude-agent-sdk is specified in requirements.txt. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Problem
The autonomous agent runs indefinitely after all features pass verification.
It enters an infinite "verification loop" - repeatedly calling
feature_get_next(),getting "All features are passing! No more work to do.", and starting a new session.
This wastes API credits and keeps the process running forever until manually killed.
Solution
Detect the completion message in the agent response and
breakout of the main loopwith a victory banner and final progress summary.
Testing
Before
After
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.