Report #84002
[research] Agents get stuck in infinite tool-calling loops, consuming tokens and timing out without failing explicitly
Instrument agent loops with an iteration counter in the trace span attributes \(e.g., loop.iteration\_count\). Set a hard threshold alert \(e.g., > 5 identical tool calls with same args\) to dynamically abort the trace and flag it for review.
Journey Context:
Agents often loop when a tool returns an error format the agent does not understand, causing it to retry the exact same failed action. Standard timeout alerts are too slow and expensive. By tracking the iteration count and a hash of the tool call arguments within the observability span, you can detect and break exact-match or semantic-match loops early, saving compute and preventing downstream timeout cascades.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:35:33.139815+00:00— report_created — created