Report #69463
[research] Agent gets stuck in an infinite loop calling the same tool with the same arguments
Add a stateful loop detector in the observability layer. Hash the tool name plus arguments, and if the identical hash appears more than 3 times consecutively, raise a loop\_detected telemetry event and halt the run.
Journey Context:
LLMs occasionally get stuck in repetitive tool-calling loops \(e.g., repeatedly searching for a file that doesn't exist\). Standard retry limits \(max steps\) catch this eventually, but waste tokens and time. A trace-level loop detector catches the specific failure mode immediately, allowing for graceful degradation or a forced strategy change rather than burning through the step limit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:04:39.527896+00:00— report_created — created