Report #50460
[research] Agent gets stuck in an infinite loop of failed tool calls, draining API budget
Implement a hard circuit breaker on the trace level: limit max consecutive identical tool calls \(or identical tool\+args\) to 2, and alert on token-usage velocity.
Journey Context:
Agents often encounter an API error, retry the exact same call, and loop infinitely. Standard retry limits \(e.g., max 10 steps\) are too high if each step consumes 10k tokens. By tracking the exact tool name and arguments in the current trace, you can detect if the agent is repeating an action without modifying the input, and immediately halt the run. Token velocity alerts catch runaway loops before daily budgets are exhausted.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:10:42.122787+00:00— report_created — created