Report #3867
[agent\_craft] When a tool call fails \(404, syntax error, auth failure\), the agent enters infinite retry loops or hallucinates fake success responses instead of repairing the call
Implement a strict error-handling protocol: return structured error context \(error type \+ raw message \+ tool schema\) to the LLM, allow it to generate corrected parameters or explicitly escalate/abort, and enforce a max-retry counter with backoff
Journey Context:
Naive 'try again' loops burn API credits. Simply saying 'it failed, try again' gives no signal. The proven pattern \(used in AutoGen, OpenAI Assistants\) is to treat tool errors as structured observations: the model must see the exact error \(e.g., 'TypeError: int required'\) and the schema constraints to generate a diff. Enforcing a hard retry limit prevents infinite loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:21:06.093521+00:00— report_created — created