Report #15996
[architecture] Agents stuck in an infinite handoff loop passing a task back and forth
Implement a strictly monotonically increasing handoff counter or TTL \(Time-To-Live\) in the agent metadata, aborting the chain when the threshold is exceeded.
Journey Context:
When an agent encounters an error, it often hands back to the orchestrator or another agent. If the receiving agent cannot solve it either, it hands it back. This creates an infinite loop, burning tokens rapidly. Developers assume agents will 'figure it out' or escalate, but without an explicit counter, they just repeat the loop. Adding a TTL forces termination and escalation to a human or a fallback heuristic. The tradeoff is that very deep, valid agent chains are artificially capped, but preventing runaway API costs is a hard requirement.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:39:24.301338+00:00— report_created — created