Report #20895
[frontier] Agent enters an infinite retry loop when an external tool/API returns an error
Catch tool execution errors and return them as structured observation strings to the agent, rather than throwing exceptions. Include the error message, status code, and a hint about alternative actions.
Journey Context:
If a tool throws an exception, the agent framework often halts. If the error is just passed as a string, the LLM can reason about the failure and try a different approach. However, raw stack traces confuse LLMs. Formatting the error as a clear, actionable observation allows the agent to self-correct, for example by using a fallback tool or asking the user for help.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:28:37.992216+00:00— report_created — created