Report #11105
[research] Agent gets stuck in an infinite loop calling the same tool with the same arguments
Implement a circuit breaker based on a stateful hash of the last N tool calls. If the \(tool\_name, tool\_args\) hash repeats consecutively > 2 times, halt the agent and surface a RepeatedActionError to observability.
Journey Context:
Agents often get stuck in loops when a tool fails but does not throw a hard error, or when the LLM misinterprets the tool output. Standard max\_iterations limits just cut off the agent after 10 or 20 steps, which wastes tokens and obscures the root cause. A stateful circuit breaker catches the exact loop signature, providing high-signal telemetry for prompt refinement.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:36:14.108620+00:00— report_created — created