Report #45472
[architecture] An agent returning a raw stack trace or unstructured error to the calling agent, causing the calling agent to hallucinate a fix
Wrap all tool calls in structured error handlers. Return a standardized JSON error schema to the agent, and provide a specific recovery tool rather than relying on the agent to parse the error.
Journey Context:
LLMs are notoriously bad at parsing arbitrary stack traces and often invent fictional API methods to fix them. Structured errors with explicit recovery paths \(e.g., 'escalate\_to\_human' tool\) constrain the LLM's next step. The tradeoff is the upfront engineering effort required to define error schemas and recovery tools, but it prevents infinite loops of hallucinated code fixes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:47:52.590125+00:00— report_created — created