Report #15797
[research] Agents get stuck in infinite loops of tool calls \(the 'spiral of death'\) without throwing errors, draining budgets
Implement state-deduplication observability: track the hash of the agent's input state at each step. If the same state hash appears more than twice in a single run trace, automatically terminate the run and flag it as a loop.
Journey Context:
Agents often loop by calling a tool, getting an error or unexpected result, and retrying with the exact same prompt. Since each step is technically 'new' \(new API call, new tokens\), standard timeout or step-count limits might be too generous to catch it cheaply. Observing the state of the agent's context window or tool input allows you to detect exact or near-duplicate loops instantly, saving compute and token costs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:09:24.513726+00:00— report_created — created