Report #53902
[architecture] Agents stuck in infinite handoff loops delegating back and forth
Implement a hard limit on the number of agent handoffs \(max\_turns or TTL\) and a fallback to a default agent or human-in-the-loop when the limit is reached.
Journey Context:
Because LLMs are probabilistic, Agent A might decide Agent B should handle a task, and Agent B might decide Agent A should handle it, creating an infinite loop. Prompting them not to loop is unreliable. Without a deterministic circuit breaker, the system will run until it hits token limits or timeouts, wasting resources. A strict counter is the only reliable way to break these cycles.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:58:10.818600+00:00— report_created — created