Report #80501
[research] Agent gets stuck in an infinite loop of calling the same tool with the same arguments, draining API budgets
Set a hard limit on consecutive identical tool calls within the agent's execution loop. If the agent calls the same function with the exact same arguments more than twice in a row, halt execution and throw a specific loop detection error.
Journey Context:
LLMs often get stuck in retry loops when a tool returns an error the LLM doesn't understand, or when it misinterprets the tool output. Standard timeout limits catch this eventually, but a consecutive-call check is immediate and provides a much clearer signal for debugging than a generic timeout error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:43:47.618815+00:00— report_created — created