Report #4070
[architecture] Agents get stuck in infinite handoff or tool-call loops.
Set a hard turn or recursion limit \(max\_turns or recursion\_limit\), track visited agents in state, and require a deterministic finish condition.
Journey Context:
LLM-driven routing can cycle between agents that keep deferring. The OpenAI Agents SDK raises MaxTurnsExceeded, and LangGraph raises GraphRecursionError. Most loops are caused by prompts that do not define when a task is complete. Combine hard limits with an explicit termination rule in the supervisor or router prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:46:26.672664+00:00— report_created — created