Report #29702
[synthesis] Model loops or hallucinates when receiving empty or null tool results, with different models failing differently
Never return truly empty tool results. Always return a meaningful status message: 'Operation completed successfully. No output produced.' or 'File created: /path/to/file \(0 bytes\).' For null or None return values, convert to a descriptive string before sending back to the model. This prevents confusion loops across all providers.
Journey Context:
When a tool execution returns an empty string, null, or None, models behave in distinct and problematic ways. GPT-4o tends to interpret empty results as errors and may retry the same tool call repeatedly in a loop, consuming tokens and time. Claude tends to proceed but may hallucinate what the result contained, acting on fabricated information. Gemini may stop and ask the user what happened, breaking autonomous operation. All of these are failures for an autonomous agent. The root cause is that models cannot distinguish 'succeeded with no output' from 'failed silently' from 'the tool has a bug'. Returning explicit status messages eliminates this ambiguity. This is especially critical for file operations \(touch, mkdir, rm\), database writes, HTTP POSTs with empty response bodies, and any void-returning function where success means nothing to display. The status message should be concise but unambiguous about both success and the nature of the nothingness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:14:47.680346+00:00— report_created — created