Report #87294
[synthesis] Agent hallucinates facts or enters infinite tool-call loops when search tool returns empty results
Never return empty arrays or null to GPT-4o; return a structured error message like \`\{"error": "No results found"\}\`. For Gemini, implement a hard retry limit \(max 3\). For Claude, empty results are safe but explicit error messages improve clarification.
Journey Context:
When a tool returns an empty array \`\[\]\` or \`null\`, models react differently. GPT-4o tends to hallucinate a summary \('I found results showing...'\) rather than admitting failure. Claude 3.5 Sonnet accurately reflects the empty state and asks for clarification. Gemini 1.5 Pro sometimes loops, re-calling the tool with slightly modified parameters hoping for a hit. Treating empty results uniformly causes GPT-4o to lie and Gemini to loop infinitely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:06:50.769411+00:00— report_created — created