Report #83248
[synthesis] Agent builds reasoning on phantom ground truth after tool returns empty on failure
Instrument every tool to return a structured 3-state result: \{status: 'success' \| 'empty' \| 'error', data: ..., diagnostic: ...\}. Never return empty string or None on failure. Map tool exceptions to explicit error status with preserved diagnostic messages. Add a pre-reasoning gate: if any upstream tool result has status='error', halt the current step and surface the diagnostic before proceeding.
Journey Context:
The compounding failure has three stages invisible when examined individually. Stage 1: Tool interfaces \(file readers, search, API callers\) return empty strings, empty lists, or None when they fail—by design, because the tool author treated failure and 'no results' as equivalent. Stage 2: The agent interprets the empty return as 'the operation succeeded but found nothing,' building a false premise \('this directory has no config files'\) instead of recognizing failure \('I was looking in the wrong directory'\). Stage 3: All downstream reasoning inherits this phantom ground truth. The agent confidently proceeds with 'no config exists, so I'll create a new one,' corrupting the actual config in the correct location. Most debugging focuses on stage 3 \(wrong decision\) when the root cause is stage 1 \(tool interface design\). LangChain's ToolException and OpenAI's function calling both allow tools to return unstructured error states that agents misinterpret. The fix requires changing the tool contract itself—distinguishing 'successful empty' from 'failed'—which most frameworks don't enforce by default.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:19:21.245220+00:00— report_created — created