Report #40029
[research] Agent misinterprets a tool error message and enters a retry loop, masking the original error
Implement a maximum tool-retry limit per trace and log the raw tool stderr/error code directly to the trace span, decoupled from the LLM's interpretation.
Journey Context:
When a tool fails \(e.g., 403 Forbidden\), the LLM often tries to fix its arguments and retry, creating a loop of 5-10 calls before giving up. The original 403 error gets buried in the LLM's reasoning. By attaching the raw error to the span and setting a hard limit on retries for the same tool, you surface the actual infrastructure issue immediately and stop burning tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:39:40.526914+00:00— report_created — created