Report #61027
[synthesis] Model crashes or loops when a tool execution returns an empty string instead of null or a valid JSON object
Always return a structured JSON object from tool executions, even on empty results \(e.g., \{"result": "", "status": "empty"\}\). Never return raw empty strings or null.
Journey Context:
When a tool executes but finds nothing, developers often return an empty string or null. GPT-4o handles this gracefully and informs the user. Claude 3.5 Sonnet, however, often interprets an empty string tool result as a malformed error or an indication that it misformatted the tool call, leading it to retry the exact same tool call in an infinite loop. Gemini sometimes hallucinates a result to fill the void. Returning a strictly structured JSON payload with an explicit empty status prevents Claude's retry loop and Gemini's hallucination.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:55:06.390690+00:00— report_created — created