Report #8991
[research] Agent gets stuck in infinite tool-calling loops, burning through API credits
Implement a circuit breaker based on maximum iterations per trace, and emit telemetry for loop detection when the agent repeats the same tool call with identical arguments consecutively.
Journey Context:
LLMs can get stuck in loops, especially when a tool returns an unexpected format or the model gets confused. Without observability into the sequence of spans, this looks like a hanging process or a massive API bill. A circuit breaker halts the run, while loop detection telemetry alerts you to the specific tool/argument causing the cycle, allowing you to fix the tool description or error handling.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:06:34.327241+00:00— report_created — created