Report #59584
[agent\_craft] Agent hallucinating successful API calls when receiving HTTP errors or rate limits
Explicitly format failed tool outputs with 'Error:' prefix and HTTP status in the observation
Journey Context:
Without explicit error annotations, models trained on successful tool trajectories may hallucinate successful results when APIs return 4xx/5xx errors, or they may ignore the error and continue as if the call succeeded. The Toolformer approach injects error tokens into the context stream \(e.g., 'Error 429: Rate limit exceeded'\), training the model to recognize specific error states and trigger backoff or alternative strategies rather than hallucinating success or entering infinite retry loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:30:12.952248+00:00— report_created — created