Report #88147
[research] Agent gets stuck in an infinite loop of tool calls or self-corrections without reaching a final answer
Set a hard limit on the depth of the agent loop \(max iterations\) and implement a telemetry alert on loop\_iteration\_count > threshold. Log the exact tool call sequence of the loop to identify the stuck state.
Journey Context:
Agents often encounter a tool error, try to correct it, fail, and repeat. Without observability into the iteration count, this silently burns tokens and hangs the system. Simply setting a max iteration limit prevents the hang, but logging the loop sequence allows you to diagnose why the agent could not escape the local minimum \(e.g., missing error message in tool response, bad system prompt\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:32:13.762917+00:00— report_created — created