Repository navigation
fix: add completion detection to prevent infinite loop when all features done - #77
Merged
leonvanzyl merged 1 commit intoJan 19, 2026
Conversation
…res done The agent was running in an infinite loop when all kanban features were completed. This happened because: 1. The main loop in agent.py had no completion detection 2. The coding prompt instructs Claude to run regression tests BEFORE checking for new features 3. feature_get_next() returns "All features passing!" but nothing acted on it This fix adds three completion checks: 1. Pre-loop check: Exits immediately if project is already 100% complete when the agent starts (avoids running unnecessary sessions) 2. Post-session check: After each session, checks if all features are now passing and exits gracefully with a success message 3. Single-feature mode: Exits after one session since the parallel orchestrator manages spawning new agents for other features Tested with a project that had 240/240 features passing - agent now exits immediately with "ALL FEATURES ALREADY COMPLETE!" message. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe agent now detects when all features are complete by checking test pass counts using 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
Comment |
Collaborator
|
Thank you. |
leonvanzyl
added a commit
that referenced
this pull request
Jan 19, 2026
The PR #77 introduced a bug where `is_first_run` was used in the completion detection check, but this variable is only defined when `agent_type is None`. When the orchestrator runs agents with explicit `--agent-type` or `--feature-id`, the variable is undefined causing a NameError crash. Changed to use `is_initializer` which is always defined and has the correct semantic meaning for this check. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3 tasks
rudiheydra
added a commit
to rudiheydra/AutoBuildr
that referenced
this pull request
Jan 27, 2026
Adds comprehensive transaction safety to the HarnessKernel for concurrent database operations with proper locking, retry logic, and error handling. New Features: - TransactionError, ConcurrentModificationError, DatabaseLockError exceptions - commit_with_retry() with exponential backoff for transient errors - rollback_and_record_error() for graceful error handling - get_run_with_lock() for row-level locking (SQLite compatible) - safe_add_and_commit_event() for durable event recording Changes: - Updated HarnessKernel to use transaction-safe commits throughout - Added finally block cleanup in execute() method - Handle IntegrityError from concurrent inserts - Rollback on exception with proper error recording - Session cleanup in finally blocks Testing: - 26 new unit tests covering all 6 feature steps - Verification script with 8 comprehensive checks - All existing harness_kernel tests (56) continue to pass Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CoreAspectStu
pushed a commit
to CoreAspectStu/autocoder-custom
that referenced
this pull request
Feb 9, 2026
…n-detection fix: add completion detection to prevent infinite loop when all features done
CoreAspectStu
pushed a commit
to CoreAspectStu/autocoder-custom
that referenced
this pull request
Feb 9, 2026
The PR AutoForgeAI#77 introduced a bug where `is_first_run` was used in the completion detection check, but this variable is only defined when `agent_type is None`. When the orchestrator runs agents with explicit `--agent-type` or `--feature-id`, the variable is undefined causing a NameError crash. Changed to use `is_initializer` which is always defined and has the correct semantic meaning for this check. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
When all features were marked as passing, the agent would run forever because:
agent.pyhad no completion detectionfeature_get_for_regressionfeature_get_next()returns "All features passing!" but nothing acted on itThis caused Claude to infinitely run regression tests on random passing features.
Solution
Added three completion checks to
agent.py:Test Plan
Changes
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.