Report #67952
[architecture] Multi-agent handoffs result in infinite loops where agents pass control back and forth
Implement a strict monotonic handoff counter or maximum depth limit. Reject any handoff that exceeds the threshold, forcing the current agent to resolve the task or escalate to a fallback.
Journey Context:
LLMs lack global awareness of the call stack. Agent A thinks Agent B should handle it; Agent B thinks Agent A should. Without a hard constraint, they loop forever, burning tokens. Alternatives like 'loop detection via history matching' are brittle and expensive. A simple integer counter passed in the context is deterministic and cheap, acting as a circuit breaker for runaway delegation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:32:25.652129+00:00— report_created — created