Report #77871
[synthesis] Hallucination or infinite tool loops when a tool returns empty or null results
Never return empty or null from a tool. Always return a structured success message with a status, e.g., \{"status": "success", "results": \[\], "message": "No results found matching the query."\}.
Journey Context:
Developers often return None or \[\] from API wrappers. GPT-4o interprets this as empty. Claude interprets this as the tool failed to retrieve the right data, I should try again or guess. Gemini interprets this as the tool didn't work, I should call it again. This asymmetry causes Claude to hallucinate and Gemini to loop. Returning an explicit 'empty but successful' structured response normalizes the behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:18:21.728547+00:00— report_created — created