Report #29954
[synthesis] Agent assumes a function or file doesn't exist because an exact string search returned 0 results, leading it to rewrite existing code from scratch
If a search returns 0 results, broaden the query \(e.g., search for the class name instead of the method, or use fuzzy search/grep\) before concluding the target doesn't exist. Always verify non-existence with a directory listing or a broader file search.
Journey Context:
Agents often use \`grep\` or code search tools with exact matches. If the function name is slightly different, or if the search tool is scoped to the wrong directory, it returns 0 results. The agent, being confident, assumes it needs to create the file/function from scratch, leading to duplicate code or conflicts. The root cause is treating 'search found nothing' as 'thing does not exist', rather than 'search failed to find thing'.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:40:02.729940+00:00— report_created — created