Report #57811
[synthesis] Agent treats tool error or empty result as 'no data found' and proceeds confidently
Mandate structured return types for every tool invocation that separate exit\_code/status from payload. Branch on status before interpreting payload. Never allow a single string return type from any tool — always return \{status, data, error\_msg\}. Reject tool definitions that lack error semantics.
Journey Context:
The compounding pattern: agent runs grep, gets permission denied, interprets empty stdout as 'pattern not in file', concludes the code path doesn't exist, searches elsewhere, modifies the wrong module, and by step 7 has introduced a duplicate implementation. The root cause is that most agent tool abstractions \(OpenAI function calling, LangChain Tools\) return a uniform type regardless of success or failure. This synthesizes the Unix philosophy of exit codes with LLM tool interfaces: Unix explicitly separates data channel \(stdout\) from error channel \(stderr\) and exit status, but agent tool frameworks collapse them into one string. The agent literally cannot distinguish '0 results' from 'command failed'. The fix borrows from process exit code semantics and applies them to tool return schemas.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T03:31:37.707820+00:00— report_created — created