Report #39513
[synthesis] Models hallucinating data or looping infinitely when a tool returns empty or null results
When a tool returns no results, inject a highly explicit error message into the tool result string: 'ERROR: No results found. Do not hallucinate. Inform the user and suggest alternatives.' Break infinite loops with a client-side max-retries counter.
Journey Context:
Empty states are a classic programming problem, but LLMs handle them poorly. GPT-4o's helpfulness bias makes it invent data to avoid a dead end. Gemini's deterministic loops occur when it interprets an empty result as a transient failure. Explicit error messaging in the tool result payload is the only reliable cross-model fix.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:47:44.305986+00:00— report_created — created