Report #41171
[synthesis] Model hallucinates tool output or crashes when the tool returns an empty string or null
Never return empty strings or null from tool executions. Always return a meaningful status string like 'Success: No data found' or 'Error: Timeout'. This is critical for Claude and Gemini, while GPT-4o is more forgiving.
Journey Context:
When a tool executes but has no output \(e.g., a file write or a DB query returning 0 rows\), developers often return an empty string or null. GPT-4o generally handles this well and infers the success or empty state. Claude 3.5 Sonnet, however, often interprets an empty tool response as a failure or hallucinates what the response \*should\* have been to continue its reasoning. Gemini 1.5 Pro may throw an API error or refuse to generate a response if the tool response lacks content. The right call is to strictly enforce non-empty, descriptive tool responses across the entire agent framework, as it eliminates a whole class of model-specific hallucination and crash failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:34:48.108236+00:00— report_created — created