Skip to content

An agent's write to a bound file is refused when it comes from a copy older than the file #7292

Backlog

Description

@max-sixty

A page can bind a local file (leaf file bind), and the file editor saves it at the revision it read: the page's server refuses a stale save (save_file in src/leaf/file_bindings.py). The agent has no such write. A whole file it writes from a copy read before the reader's last save puts back the words the reader saved since, and the editor can't undo it, since a write from elsewhere starts its undo history afresh (writeFromElsewhere in packages/file-editor/widgets/editor.js).

Claude Code's Edit and Write already refuse a file changed since the agent read it, and the file editor's author instructions are gaining a sentence telling the agent to edit a bound file with such a tool. So only a shell or script write reaches this case: for example, a heredoc into the file composed from a read made before the reader typed and the editor saved.

Trigger: an agent's shell or script write to a bound file loses a reader's saved words.

Then: add a leaf file write PAGE BINDING --revision R that takes the text on stdin and runs save_file's revision check, and point the file editor's author instructions at it in place of the edit-tool sentence. Estimated at about 60 lines.

This was written by Claude Code on behalf of max-sixty

Activity

  1. added
    backlog
    etc
    agent-experience
    on Nov 26, 2026
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

    agent-experiencebacklogetc

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions