Skip to content

fix: stop spawning testing agents after project completion - #99

Merged
leonvanzyl merged 1 commit into
AutoForgeAI:masterfrom
cabana8471-arch:fix/auto-stop-on-completion
Jan 26, 2026
Merged

leonvanzyl merged 1 commit into
AutoForgeAI:masterfrom
cabana8471-arch:fix/auto-stop-on-completion

Conversation

@cabana8471-arch

@cabana8471-arch cabana8471-arch commented Jan 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Added completion check to prevent testing agents from spawning after all features pass
  • Stops unnecessary token consumption after project reaches 100%

Problem

When all features pass, the orchestrator continued spawning testing agents for 10+ minutes, wasting tokens on regression tests that weren't needed.

Root Cause

_maintain_testing_agents() at line 380 had no check for project completion. It only checked:

  • if self.yolo_mode or self.testing_agent_ratio == 0: return
  • if passing_count == 0: return

When all features pass, passing_count > 0, so it kept spawning testing agents even after get_all_complete() returns True.

Fix

Added completion check after line 401:

# Don't spawn testing agents if all features are already complete
if self.get_all_complete():
    return

Testing

  1. Create project with 3 features
  2. Run agent until 100% complete
  3. Verify: Agent stops within 30 seconds of completion
  4. Check logs: No "Spawning testing agent" after "All features complete"

Fixes #66

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Optimized testing agent spawning to skip unnecessary initialization when all features are complete, improving resource efficiency.

✏️ Tip: You can customize this high-level summary in your review settings.

…AI#66)

When all features pass, the orchestrator continued spawning testing
agents for 10+ minutes, wasting tokens on unnecessary regression
tests. Added a check for get_all_complete() to prevent this.

Fixes: AutoForgeAI#66

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jan 25, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The PR adds a guard condition in the _maintain_testing_agents method to prevent spawning additional testing agents when all project features are complete, causing the agent to stop initiating further verification tasks upon project completion.

Changes

Cohort / File(s) Summary
Testing Agent Maintenance Guard
parallel_orchestrator.py
Added get_all_complete() check to short-circuit the testing agent spawning loop when all features are complete, preventing unnecessary post-completion regression tests and verification cycles

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

  • Agent Continues Running After 100% Project Completion (Token Burn) #66: Agent Continues Running After 100% Project Completion (Token Burn) — This PR directly resolves the reported issue by implementing the guard to stop spawning testing agents once all features are verified as complete, eliminating unnecessary token consumption during post-completion cycles.

Poem

🐰 The testing loop danced on and on,
Even when all the tasks were done,
But now with a guard, crisp and clean,
The agent stops at completion's scene!
No more burning tokens in vain,
Rest well, dear agent—you've earned your reign! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a guard to stop spawning testing agents after project completion.
Linked Issues check ✅ Passed The PR adds a completion check to prevent spawning testing agents after project completion, directly addressing the core issue #66 requirement to stop consuming tokens once all features are complete.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to adding a guard in _maintain_testing_agents() when all features are complete, with no modifications to unrelated functionality.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@leonvanzyl
leonvanzyl merged commit 0995773 into AutoForgeAI:master Jan 26, 2026
1 check passed
@leonvanzyl

Copy link
Copy Markdown
Collaborator

Thanks

@cabana8471-arch
cabana8471-arch deleted the fix/auto-stop-on-completion branch January 26, 2026 21:39
rudiheydra added a commit to rudiheydra/AutoBuildr that referenced this pull request Jan 27, 2026
…geAI#99

Adds repair_self_references(session) function to api/dependency_resolver.py that:
- Queries all features from the database
- Identifies features with self-referencing dependencies
- Removes self-references while preserving valid dependencies
- Commits all changes in a single database transaction
- Returns list of repaired feature IDs for logging

Includes comprehensive test suite (19 tests) covering:
- Function existence and signature
- Query all features functionality
- Self-reference removal (preserving other deps)
- Single transaction behavior
- Return value correctness
- Edge cases (NULL deps, empty deps, duplicates, large datasets)
- Logging verification

Tested with existing dependency graph tests (67 tests passing, no regressions)

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
…on-completion

fix: stop spawning testing agents after project completion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent Continues Running After 100% Project Completion (Token Burn)

2 participants