Report #3347
[research] Agent gets stuck in infinite tool-call loops, draining tokens and budget without raising an error
Implement a hard span-attribute limit on consecutive identical tool calls \(or identical tool\+argument pairs\) within a single trace. If exceeded, break the loop and emit a specific agent\_loop\_detected telemetry event.
Journey Context:
LLMs often get stuck in Action-Observation-Action loops, especially when a tool returns an unexpected format the model cannot parse but keeps retrying. Standard timeout limits are too coarse; the agent is actively working, just unproductively. Tracking consecutive identical spans is a high-signal, low-cost way to detect this specific failure mode in observability pipelines without manual log sifting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T16:34:34.987093+00:00— report_created — created