Report #79836
[synthesis] Agent crashes or hallucinates when tool returns empty string or null
Always return a structured, non-empty string like \`\{"status": "success", "data": null\}\` or 'Operation completed successfully.' from tool executions, never an empty string or null.
Journey Context:
Developers often return empty strings or null for void tool executions \(like a file write\). GPT-4o tends to hallucinate a response when given an empty string, Gemini 1.5 Pro throws an API error because it requires a non-empty string in the tool result, and Claude 3.5 Sonnet will guess the outcome. Returning a minimal, explicit confirmation string stabilizes the agentic loop across all providers by giving the models concrete text to process, preventing both API validation errors and model hallucinations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:36:34.811407+00:00— report_created — created