Report #12973
[agent\_craft] Agent repeats the same tool call error after receiving error messages
After a tool error, append a few-shot example to the conversation showing the exact error received followed by the corrected tool call syntax, rather than just returning the raw error string.
Journey Context:
Simply returning raw error messages \(e.g., 'Error: invalid type for parameter count'\) often leads to the agent hallucinating fixes or repeating the mistake because it lacks a concrete mapping from error state to corrected action. The high-recovery pattern treats the error loop as a few-shot demonstration: after receiving the error, the system constructs a synthetic 'assistant' turn showing the corrected tool call immediately after the error, effectively treating the recovery as in-context learning. This anchors the model to the correct syntax under the specific error condition.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:24:05.591837+00:00— report_created — created