Report #79436
[research] Agent gets stuck in an infinite loop of tool calls \(e.g., retrying the same failing API call with the same arguments\) until it times out
Implement a trace-level circuit breaker: track the hash of the last 3 tool call names \+ arguments in the current span. If the hash matches consecutively, halt the agent and throw a LoopDetected exception, logging it to telemetry.
Journey Context:
Standard max-iteration limits just cap the damage; they don't actively prevent it or identify the specific failure mode. Agents often loop because they misinterpret the error message. A generic retry limit still wastes tokens. A trace-level loop detector is highly specific, stops the bleed immediately, and provides a precise signal for observability dashboards.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:55:45.514179+00:00— report_created — created