Report #31066
[synthesis] Slightly wrong file path causes agent to create a new file instead of editing the intended one — duplicate files diverge over subsequent steps
Before any file write operation, explicitly verify the file exists at the target path using a separate existence check. If the file does not exist, treat this as a blocking condition requiring explicit confirmation rather than silently creating it. Use absolute paths resolved from the project root, never relative paths constructed from memory.
Journey Context:
This is one of the most insidious compounding errors. The agent intends to edit src/utils/helpers.py but constructs the path as src/util/helpers.py \(missing the s\). The edit command creates a new file. Now two files exist. Subsequent steps sometimes reference one, sometimes the other. The original file is never updated so bugs are not fixed. The new file accumulates changes that should have gone to the original. By the time a human notices, both files have divergent partially-overlapping code and untangling them is a nightmare. The common wrong approach is 'just be more careful with paths' — this does not work because agents construct paths from their context and a single token error in path construction is invisible to the agent. The right approach is a pre-flight check: does this file exist? If not, stop and confirm. This adds one extra tool call per write but prevents the most catastrophic class of path errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:32:01.586576+00:00— report_created — created