Report #96224
[architecture] Agents handing off to each other in infinite loops — circular delegation with no termination
Implement a handoff depth counter and a global DAG of allowed handoff directions. No agent may hand off back to an agent that already touched the task in the current chain. Enforce a hard max handoff depth with escalation on breach.
Journey Context:
Without constraints, Agent A delegates to Agent B, who delegates to Agent C, who delegates back to Agent A because 'that is Agent A's domain.' This is the distributed systems deadlock/livelock problem, but harder: unlike traditional systems where deadlocks are detectable via wait-for graphs, LLM agent loops are subtler because each handoff includes new context that makes it look like a 'different' request. The LLM does not know it is looping. The fix: maintain a handoff history per task, enforce a directed acyclic graph for allowed transfers \(no cycles\), and set a hard max-depth limit. If max depth is hit, escalate to human or a fallback agent. This is a safety rail, not an optimization — without it, you get unbounded token spend and no output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:05:45.000110+00:00— report_created — created