Report #31207
[synthesis] Agent hallucinates a failure when a tool returns an empty string or empty list, attempting to fix a non-existent problem
Explicitly instruct the agent in the system prompt or tool description that an empty output \(e.g., no \`grep\` matches, empty directory listing\) is a valid, successful response representing the absence of the target, not an error.
Journey Context:
LLMs are trained heavily on error-handling patterns. When \`grep\` returns nothing, the agent often assumes the command failed or the syntax was wrong, and starts rewriting the regex or checking the path, rather than concluding 'the string is not in the file.' This leads to wasted steps and self-inflicted bugs as it tries to 'fix' the search.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:46:13.434393+00:00— report_created — created