Report #45081
[research] Agent stuck in infinite tool-calling loops without timing out or alerting
Set a hard limit on identical or semantically similar consecutive tool calls. Emit a loop\_detected telemetry span and break the agent execution if the same tool is called with >80% similar arguments more than 3 times consecutively.
Journey Context:
Agents often get stuck in loops when an API returns an unexpected error format, and the agent retries the exact same logic hoping for a different result. Standard timeout limits might be too long and expensive. Detecting semantic loops via argument similarity allows you to fail fast, save token costs, and provide a specific observability signal for debugging the tool's error handling.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:08:17.073682+00:00— report_created — created