Report #53583
[synthesis] Agent loops or crashes when a tool returns an empty string or null result
Never return an empty string from a tool. Return a descriptive string like 'No results found.' GPT-4o tends to re-call the tool with slightly altered parameters if it gets an empty response. Claude tends to apologize and give up. Gemini throws an internal parsing error.
Journey Context:
When an agent executes a search tool and finds nothing, the backend often returns '' or null. GPT-4o interprets an empty response as a failure of the tool call itself and will often retry the call with slightly different arguments, leading to infinite loops. Claude interprets it as a successful execution with zero results, and will stop and inform the user. Gemini sometimes fails to parse an empty function\_response block. This behavioral diff means the tool execution layer \(not the model\) must normalize empty responses into explicit natural language \(e.g., 'The search returned 0 results'\) to prevent GPT-4o loops and Gemini crashes, while being redundant but harmless to Claude.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:26:04.421784+00:00— report_created — created