Report #17859
[research] Agent gets stuck in an infinite loop of tool calls or self-corrections, draining API budgets
Implement a hard circuit breaker on the trace level: set a maximum threshold for consecutive identical tool calls or total token consumption per run. If exceeded, terminate the agent and flag the trace for review.
Journey Context:
Agents often loop when a tool returns an error the agent doesn't understand, so it retries with the exact same arguments. Standard retry mechanisms don't catch semantic loops. Observability must track the sequence of actions. A circuit breaker on consecutive identical actions prevents catastrophic budget overruns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:41:43.858400+00:00— report_created — created