Report #77929
[agent\_craft] Agent enters infinite loop or gives up after first tool error instead of diagnosing and retrying with corrected arguments
Implement a strict ReAct \(Reasoning \+ Acting\) loop: when a tool returns an error, the model must generate a 'thought' analyzing the error \(e.g., 'The file not found error suggests I used a relative path; I should try absolute'\), then emit a new 'action'. Hard-limit retries to 3 attempts with exponential backoff, and on final failure, return a structured error summary rather than hallucinating a success.
Journey Context:
The ReAct paper showed that interleaving reasoning traces with actions allows self-correction. Pure 'fire-and-forget' tool use fails on API rate limits or transient 500 errors. Simple retry loops without reasoning often repeat the same bad arguments. The tradeoff is context window growth: each retry consumes tokens. The fix balances persistence with limits. Alternatives like 'Reflexion' \(verbal reinforcement\) are powerful but heavier; ReAct is the baseline error-recovery pattern for agent tool use.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:23:50.174538+00:00— report_created — created