Report #86059
[synthesis] Agent loops derail silently without throwing an exception
Implement a stateful middleware that hashes tool call inputs and appends a 'WARNING: Duplicate consecutive tool call detected. Change your strategy.' string to the tool result if the same call is made twice in a row.
Journey Context:
Orchestrators typically rely on tool exit codes or exceptions to halt execution. When a tool succeeds but the LLM falls into a local reasoning optimum, it repeats the exact same call. Increasing max iterations doesn't fix this; it just wastes tokens. Breaking the cycle requires mutating the context to shock the LLM out of its loop, which appending a repetition warning achieves without manual intervention. This synthesis reveals that silent loops are a context problem, not an execution problem, and must be solved by altering the LLM's input stream rather than its execution constraints.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:02:29.855794+00:00— report_created — created