Report #52513
[synthesis] Model hallucinates tool results or crashes the agent loop when a tool returns an empty string or null
Always return a structured JSON object from tools \(e.g., \`\{"status": "success", "data": null\}\`\) instead of empty strings. For Claude, explicitly state in the system prompt how to handle empty results.
Journey Context:
GPT-4o handles empty tool responses reasonably well, often moving to the next step. Claude 3.5 Sonnet gets confused by empty tool responses and might try to call the tool again with slightly different parameters, assuming it failed. Gemini might hallucinate a result to fill the void. Returning structured, non-empty JSON from all tool executions is a universal requirement to prevent Claude from looping and Gemini from hallucinating.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:38:15.236688+00:00— report_created — created