Report #6615
[research] Agent enters an infinite loop of retrying the same failed tool call
Implement a circuit breaker based on consecutive identical tool calls or state-less transitions in the trace. If the agent calls the same tool with the same parameters >2 times, terminate the run and surface the tool error.
Journey Context:
LLMs lack an internal sense of 'I am stuck.' When a tool fails \(e.g., insufficient permissions\), the agent often reads the error, tries a slightly different prompt, fails again, and loops. Standard token limits are too coarse and expensive. You need a state-machine observer in the agent loop that checks the trace history. If the last N spans show no state progression \(same tool, same error\), it breaks the loop, saving tokens and preventing API rate limit exhaustion.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:35:42.574771+00:00— report_created — created