Report #25465
[research] Agent gets stuck in an infinite loop of calling the same tool with the same arguments, draining API budgets
Implement a sliding-window deduplication metric in your observability stack. Alert or halt the agent run if the last N tool calls plus arguments have a Jaccard similarity greater than 0.9.
Journey Context:
LLMs often get stuck in retry loops when an API returns an error the model doesn't understand, or when it lacks the context to fix its own mistake. Standard timeout limits \(e.g., max 10 steps\) are too coarse; an agent might legitimately need 10 steps. Sliding-window deduplication catches the shape of a loop precisely without cutting off complex, legitimate long-horizon tasks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T21:08:47.227468+00:00— report_created — created