Report #16737
[architecture] Agents handing off to each other in an infinite loop
Implement a global handoff depth counter in the shared state. If the handoff count exceeds a threshold \(e.g., 5\), break the loop and route to a fallback or human.
Journey Context:
A common failure mode in multi-agent systems is the ping-pong effect, where Agent A routes to Agent B, and Agent B, lacking the context to resolve the issue, routes back to Agent A. Without a hard limit on handoffs, the system burns tokens and API costs indefinitely. Alternatives like asking the LLM to 'check if we are looping' are unreliable due to context window overwrites. A deterministic counter is the only robust circuit breaker.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:38:39.691396+00:00— report_created — created