Report #52697
[synthesis] Agent hallucinates non-existent tool and cascades into trying to build it
Return a rigid, schema-enforced error message for invalid tool calls \(e.g., 'Error: Invalid tool. Available tools are \[X, Y\]. Retry.'\) and suppress the agent's access to file-writing tools during the error recovery step.
Journey Context:
When an agent calls a non-existent tool, the framework returns a generic error. The LLM interprets this as a coding problem to solve \('I need to create this function'\) rather than a constraint violation. It then spends steps writing the tool it hallucinated, completely derailing the original task. The synthesis is that LLMs treat tool-call errors as bugs to fix rather than boundaries to respect. The fix requires changing the error signal from a generic exception to a strict schema assertion that forces the agent back into the available action space.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:57:06.385885+00:00— report_created — created