Bug summary
The edit and write tools report "Successfully edited" / "Successfully wrote", and the read tool shows the new content, but the changes are not persisted to the actual filesystem. Reading the same file via exec (cat, sed) shows the old content.
This causes silent data loss: edits appear to succeed but never reach disk, leading to bugs that are only discovered when re-reading via shell.
Environment
- OS: macOS (Apple Silicon)
- IDE: Windsurf (Devin integrated via Windsurf Enterprise)
- Devin CLI: bundled with Windsurf
- Filesystem: default macOS (APFS), files under
~/www/devops/...
Steps to reproduce
- Open a file in the Devin session (e.g. a YAML or shell file under the workspace).
- Use the
edit tool to change a string:
edit(file_path="/path/to/file.yaml", old_string="foo", new_string="bar")
→ "Successfully edited ... 1 replacement(s)"
- Read the file back with the
read tool → shows bar (the new content).
- Read the file back with
exec:
exec: cat /path/to/file.yaml | grep foo
→ still shows `foo` (old content, NOT persisted)
- Use
exec to write the same change:
exec: sed -i '' 's/foo/bar/' /path/to/file.yaml
→ persists correctly (confirmed by `cat`)
Expected behavior
edit and write should persist changes to disk immediately, or at least before any subsequent exec reads the file.
Actual behavior
edit/write return success
read shows the new content (appears to read from a cache/layer)
exec (cat, sed, grep) reads the old content from disk
- Changes made via
exec (sed -i, cat >, python3 ... open().write()) persist correctly
Impact
- Silent data loss: edits that appear successful are lost
- Bugs introduced because the "fixed" code is not actually on disk
- Workaround required: use
exec with sed/cat >/python3 for all file writes, which is slower and more error-prone
- Trust in the
edit/write tools is broken — every edit must be verified with exec cat
Hypotheses
- The
edit/write tools write to an in-memory layer or virtual filesystem that is not synced to the real disk.
- The
read tool reads from the same in-memory layer, masking the discrepancy.
exec reads from the real filesystem, exposing the gap.
- Possibly related to Windsurf's file buffer / dirty state management interfering with Devin's writes.
Workaround
Use exec with shell commands for all file writes:
sed -i '' 's/old/new/' file.yaml # small edits
cat > file.yaml << 'EOF' ... EOF # full rewrites
python3 -c "..." # complex edits
Then verify with cat via exec.
Frequency
Reproduced consistently across a multi-hour session. Approximately 30-40% of edit/write calls did not persist. The failure is intermittent but frequent enough to be unreliable.
Additional context
This was discovered while building a Docker image for SuiteCRM 8. Multiple edits to HOWTO.md, k8s/secret.yaml, k8s/mariadb.yaml, README.md, and Dockerfile were reported as successful but not persisted. The issue was only caught when rebuilding the Docker image and seeing the old content, or when cat via exec showed stale content.
Bug summary
The
editandwritetools report "Successfully edited" / "Successfully wrote", and thereadtool shows the new content, but the changes are not persisted to the actual filesystem. Reading the same file viaexec(cat,sed) shows the old content.This causes silent data loss: edits appear to succeed but never reach disk, leading to bugs that are only discovered when re-reading via shell.
Environment
~/www/devops/...Steps to reproduce
edittool to change a string:readtool → showsbar(the new content).exec:execto write the same change:Expected behavior
editandwriteshould persist changes to disk immediately, or at least before any subsequentexecreads the file.Actual behavior
edit/writereturn successreadshows the new content (appears to read from a cache/layer)exec(cat,sed,grep) reads the old content from diskexec(sed -i,cat >,python3 ... open().write()) persist correctlyImpact
execwithsed/cat >/python3for all file writes, which is slower and more error-proneedit/writetools is broken — every edit must be verified withexec catHypotheses
edit/writetools write to an in-memory layer or virtual filesystem that is not synced to the real disk.readtool reads from the same in-memory layer, masking the discrepancy.execreads from the real filesystem, exposing the gap.Workaround
Use
execwith shell commands for all file writes:Then verify with
catviaexec.Frequency
Reproduced consistently across a multi-hour session. Approximately 30-40% of
edit/writecalls did not persist. The failure is intermittent but frequent enough to be unreliable.Additional context
This was discovered while building a Docker image for SuiteCRM 8. Multiple edits to
HOWTO.md,k8s/secret.yaml,k8s/mariadb.yaml,README.md, andDockerfilewere reported as successful but not persisted. The issue was only caught when rebuilding the Docker image and seeing the old content, or whencatviaexecshowed stale content.