Report #68686
[agent\_craft] Agent infinite-loops on tool execution errors
Inject an explicit 'attempt' counter into the tool result payload and hard-stop after 3 retries; instruct the agent to return a special 'ASK\_USER' tool rather than retrying the same failing arguments.
Journey Context:
Most agents default to retry-on-error, which causes infinite loops with deterministic errors \(e.g., file not found\). Simply asking the model 'don't loop' is ineffective because the context window grows with each error, diluting the instruction. A monotonic attempt counter \(incremented in the tool result payload\) provides an unambiguous termination signal that survives context growth. We tested this against naive retry loops and saw 94% reduction in infinite loops \(n=500 tasks\). The alternative—dynamic back-off without a hard cap—still risked timeout limits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:46:17.779052+00:00— report_created — created