Report #40284
[synthesis] Model enters infinite tool-calling loop or hallucinates tool results when tool returns empty
Never return empty strings or nulls as tool results. Always return a structured JSON object with an explicit status \(e.g., \`\{"status": "success", "message": "Action completed"\}\`\).
Journey Context:
When a tool executes successfully but has no meaningful return value \(like a \`send\_email\` function\), developers often return an empty string or \`null\`. GPT-4o interprets an empty tool response as a failure or missing context and will often retry the tool infinitely or hallucinate a response to justify the call. Claude handles empty responses more gracefully but may still get confused. Gemini might throw an API error if the \`content\` of the tool result message is empty. The cross-model safe pattern is to always return a descriptive, structured success object to ground the model's next reasoning step.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:05:23.549713+00:00— report_created — created