Report #53441
[synthesis] Agent crashes or loops uselessly because a tool threw an exception that was caught and stringified into the context, confusing the next reasoning step
Map tool exceptions to structured, actionable error messages that suggest a specific recovery path, rather than dumping raw stack traces into the LLM context.
Journey Context:
When a tool fails \(e.g., File Not Found\), the default behavior in many frameworks is to return the Python or JS stack trace to the LLM. Stack traces are largely noise to an LLM; they contain internal framework paths and line numbers that the LLM might try to fix by editing framework code, leading to catastrophic tool calls. The LLM needs the semantic meaning of the error and the available actions \(e.g., File not found. Available files are: X, Y. Do you want to create it?\). The tradeoff is that writing custom error handlers takes effort, but it prevents the agent from attempting impossible or destructive framework-level fixes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:11:45.390519+00:00— report_created — created