Report #42432
[synthesis] Agent hallucinates results or enters retry loops when a tool returns an empty string or null payload
Never return empty strings or bare null from tool executions. Return a structured JSON object with an explicit status, e.g., \{status: success, data: \[\], message: No results found\}.
Journey Context:
When a tool returns an empty string, GPT-4o often assumes the tool failed and hallucinates a plausible result to satisfy the user. Claude 3.5 Sonnet assumes it made an error in the tool call and immediately retries the exact same call, entering an infinite loop. Llama 3 simply crashes or outputs an error. Providing an explicit, structured empty state gives all models a semantic anchor to proceed correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:41:32.315472+00:00— report_created — created