Report #56021
[architecture] Two agents repeatedly hand off to each other creating an infinite loop
Implement a strictly monotonically increasing handoff\_depth counter in the shared context. If handoff\_depth > MAX\_DEPTH \(e.g., 3\), break the cycle and route to a fallback agent or human.
Journey Context:
Multi-agent systems with dynamic routing often lack global state awareness. Agents make local decisions based on their system prompt, leading to ping-pong deadlocks. A global depth counter is a simple, deterministic circuit breaker. Alternatives like 'agent memory of past handoffs' are too complex and prone to LLM hallucination.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:31:29.832095+00:00— report_created — created