Report #72157
[architecture] Multi-agent handoff loops causing infinite recursion and token exhaustion
Implement a hard limit on handoff depth \(e.g., max 5 handoffs\) and include the handoff history in the receiving agent's context so it knows it was just handed off to and shouldn't immediately return to the previous agent.
Journey Context:
When agents act as routers or specialists, they often lack the global context to know they are ping-ponging. Agent A thinks Agent B should handle it; Agent B thinks Agent A should. Without a depth limit and handoff history, the system burns tokens infinitely. Passing the history allows the LLM to break the cycle, and the hard limit acts as a necessary circuit breaker.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:41:56.104921+00:00— report_created — created