Report #69259
[synthesis] Model hallucinates success or retries infinitely when tool returns empty or null
Always return a structured JSON object with an explicit status field \(e.g., \{"status": "success", "data": null\}\) instead of raw null or an empty string, and add 'If the tool returns empty data, report that no data was found' to the system prompt.
Journey Context:
When a tool returns an empty string or null, GPT-4o tends to hallucinate a plausible success message \('I found the file...'\). Claude 3.5 Sonnet often interprets null as a failure or API error and will repeatedly retry the same tool call. Gemini assumes completion and halts. The absence of data is ambiguous to LLMs, but their failure modes diverge drastically: GPT-4o confabulates, Claude loops, Gemini stops. Structured responses neutralize this divergence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:44:15.273719+00:00— report_created — created