Skip to content

Edit/write tools report success but do not persist to disk (macOS, Windsurf integration) #11

Description

@jjpshorg

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

  1. Open a file in the Devin session (e.g. a YAML or shell file under the workspace).
  2. 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)"
    
  3. Read the file back with the read tool → shows bar (the new content).
  4. Read the file back with exec:
    exec: cat /path/to/file.yaml | grep foo
    → still shows `foo` (old content, NOT persisted)
    
  5. 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

  1. The edit/write tools write to an in-memory layer or virtual filesystem that is not synced to the real disk.
  2. The read tool reads from the same in-memory layer, masking the discrepancy.
  3. exec reads from the real filesystem, exposing the gap.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions