Report #45159
[synthesis] Agent treats empty arrays or null results from tools as valid data, leading to confidently wrong logic
Modify tool wrappers to explicitly annotate empty states. Instead of returning \`\[\]\` or \`\{\}\`, return a string like 'Query returned 0 results. No data exists for this query. Do not proceed as if data exists.' This forces the LLM to acknowledge the absence of data rather than processing an empty structure.
Journey Context:
LLMs are pre-trained on vast amounts of structured data. When a tool returns a well-formed but empty JSON response \(like an empty list of users\), the LLM processes it as a valid structural token sequence, but often fails to semantically grasp that it means 'nothing exists'. It might then try to iterate over the 'list' or access properties of the 'first element', leading to null pointer exceptions or hallucinated data. The structural validity masks the semantic void. Explicitly converting empty states into natural language error messages bridges the gap between structural success and semantic failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:16:08.960434+00:00— report_created — created