fix: prevent runaway testing agent spawning (critical)#130
fix: prevent runaway testing agent spawning (critical)#130leonvanzyl merged 1 commit intoAutoForgeAI:masterfrom
Conversation
running_testing_agents was keyed by feature_id, so when multiple agents tested the same feature, each spawn overwrote the previous dict entry. The count stayed at 1 regardless of how many processes were actually running, causing the maintain loop to spawn agents indefinitely (~130+). Re-key the dict by PID so each agent gets a unique entry and the existing max-agent guards work correctly. Also check the return value of _spawn_testing_agent() to break the loop on failure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughRefactored testing agent tracking in ParallelOrchestrator to use process ID as the dictionary key instead of feature ID, now storing Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
|
Thanks |
- Add comment on running_coding_agents explaining why feature_id keying is safe (start_feature checks for duplicates before spawning), since the sister dict running_testing_agents required PID keying to avoid overwrites from concurrent same-feature testing - Clear running_testing_agents dict in stop_all() after killing processes so get_status() doesn't report stale agent counts while _on_agent_complete callbacks are still in flight Follow-up to PR #130 (runaway testing agent spawn fix). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…utoForgeAI#130) - Added TestAcceptanceGateEvaluatesValidators class with 8 tests - Step 1: Verify AcceptanceGate.evaluate() called after kernel execution - Step 2: Verify each validator executed independently - Step 3: Verify ValidatorResult contains passed, message, score - Step 4: Verify all_pass gate mode requires all validators - Step 5: Verify any_pass gate mode requires at least one validator - Step 6: Verify AgentRun.final_verdict set correctly - Step 7: Verify acceptance_results contains per-validator JSON array - Step 8: Verify acceptance_check event recorded in agent_events - All 62 tests in test_dspy_pipeline_e2e.py pass with no regressions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…and determines final verdict - All 8 verification steps passed via pytest - TestAcceptanceGateEvaluatesValidators: 8/8 tests PASS - Full suite: 62/62 tests pass (no regressions) - No production code changes needed - tests prove existing behavior - Marked feature AutoForgeAI#130 as passing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add comment on running_coding_agents explaining why feature_id keying is safe (start_feature checks for duplicates before spawning), since the sister dict running_testing_agents required PID keying to avoid overwrites from concurrent same-feature testing - Clear running_testing_agents dict in stop_all() after killing processes so get_status() doesn't report stale agent counts while _on_agent_complete callbacks are still in flight Follow-up to PR AutoForgeAI#130 (runaway testing agent spawn fix). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…s_spawned fix: prevent runaway testing agent spawning (critical)
- Add comment on running_coding_agents explaining why feature_id keying is safe (start_feature checks for duplicates before spawning), since the sister dict running_testing_agents required PID keying to avoid overwrites from concurrent same-feature testing - Clear running_testing_agents dict in stop_all() after killing processes so get_status() doesn't report stale agent counts while _on_agent_complete callbacks are still in flight Follow-up to PR AutoForgeAI#130 (runaway testing agent spawn fix). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CRITICAL BUG FIX - Testing agents spawn uncontrollably (~130+) when launching a project, overwhelming the system.
new spawn overwrote the previous entry. The dict length stayed at 1, defeating all max-agent guards and causing an infinite
spawn loop.
max_concurrency, MAX_TOTAL_AGENTS) now work as intended.
Test plan
testing_agent_ratio)
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.