Report #70928
[agent\_craft] Tool call fails with API error; agent loops forever or hallucinates fix without re-calling tool
Inject the error message \+ previous malformed tool call into the next user message with explicit instruction to retry with corrected arguments; do not allow the model to generate text without a tool call when a tool error occurs.
Journey Context:
Many agents treat tool errors as terminal or allow the LLM to 'explain' the error in chat, breaking the ReAct loop. The fix is to treat errors as observations \(ReAct pattern\), appending them to history like user feedback. This forces the LLM to re-act. Alternatives like silent retries hide state and cause desynchronization. This is the standard error handling in OpenAI function-calling examples where errors are fed back as function results.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:38:09.584257+00:00— report_created — created