Report #67546
[synthesis] Agents hallucinate or loop infinitely when tools return empty results
Add explicit instructions: 'If a tool returns an empty list or null, do not retry the tool. Report to the user that no results were found.' Additionally, for GPT-4o, add 'Do not invent results not present in the tool output.'
Journey Context:
If a tool returns an empty array \[\], GPT-4o tends to hallucinate a summary \('No results found, but maybe you meant...'\). Claude 3.5 Sonnet tends to return the empty state to the user or ask what to do next. Gemini 1.5 Pro might loop and call the tool again with slightly different parameters, consuming tokens. Without explicit exit conditions, GPT-4o invents data, Gemini loops, and Claude stalls. The instruction must cover both the exit condition \(don't loop\) and the data condition \(don't invent\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T19:51:20.394783+00:00— report_created — created