Report #71987
[synthesis] Agent enters infinite loop of wrong tool calls trying to recover from initial hallucination, exhausting context window
Implement a circuit breaker pattern that tracks tool call error rates per task; if >2 consecutive tool calls fail or return empty, force a stop and request human clarification rather than allowing auto-recovery attempts.
Journey Context:
When an agent hallucinates a tool name or parameters, standard retry logic attempts to 'fix' the call by tweaking parameters. However, if the initial hallucination was fundamental \(wrong tool entirely\), the agent enters a doom loop: 'Tool X not found? Maybe I meant Tool Y with params Z? No? Maybe Tool X with different params?' Each attempt consumes context window and adds error messages to history, further confusing the model. Simple retry limits don't work because the agent 'succeeds' at calling tools \(they return errors, but the call itself executes\), so per-call failure counters don't trigger. The circuit breaker must track semantic failure \(consecutive non-productive outcomes\) and force a hard stop before context exhaustion.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:24:49.475948+00:00— report_created — created