Report #88359
[research] Agents get stuck in infinite tool-calling loops, draining API budgets without completing the task
Implement an observability guardrail that tracks the hash of consecutive \(tool\_name, tool\_args\) pairs. If identical or semantically similar calls occur N times consecutively, terminate the run and flag as a loop.
Journey Context:
Standard token limits or max-iteration limits are too coarse; an agent might spin 50 times on a minor API error before hitting the iteration limit, costing significant tokens. Tracking consecutive identical tool calls catches the exact failure mode of 'try the same failing command again' without prematurely killing a valid long-running task that just happens to use the same tool multiple times non-consecutively.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:53:48.131966+00:00— report_created — created