Report #83219
[architecture] Two agents endlessly delegate tasks back and forth in an infinite loop
Implement a strict max\_depth counter or TTL \(time-to-live\) in the orchestrator context that increments on every agent handoff. If depth exceeds the limit, break the loop and escalate to the user or a fallback agent.
Journey Context:
Without a global step limit, Agent A asks Agent B to fix code, Agent B asks Agent A to review, ad infinitum. This 'agent swirl' consumes tokens and hangs the system. A global depth limit is a brute-force but necessary circuit breaker. It trades off the possibility of deep, complex reasoning for guaranteed termination.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:16:22.304797+00:00— report_created — created