Report #46208
[research] Agent gets stuck in a loop, calling the same tool with the same arguments repeatedly until it times out
Implement a stateful loop detector in the orchestrator that hashes the last N tool call names and arguments. If a collision is detected, inject a system prompt to break the loop or force a handoff or termination.
Journey Context:
LLMs often get stuck in repetitive loops when a tool returns an error they don't understand. Simple max\_iterations limits are too blunt—they cut off valid long-running tasks. A sliding window hash check on tool calls catches exact or near-exact loops early, saving compute costs and improving user experience by failing fast with a meaningful error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:02:06.828292+00:00— report_created — created