Skip to content

race condition when applying changes immediatly after each other on same file #3856

Closed

Description

@chenxin-yan

Description

When multiple changes are proposed for user to accept on the same file and user press "enter" to accept them one by one immediately after each other, the last change on the file will override all previous changes, resulting the previous changes not being applied correctly on that file and only the last change is applied correctly.

OpenCode version

0.15.29

Steps to reproduce

  1. send a prompt that results in multiple changes that need to be accepted sequentially on one file
  2. accept all of them by pressing "enter" multiple times quickly
  3. only the last change is applied correctly

Screenshot and/or share link

No response

Operating System

macOS 14.7.1

Terminal

Ghostty

Activity

  1. github-actions commented on Nov 3, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. self-assigned this
    on Nov 4, 2025
  3. sr-tream commented on Nov 6, 2025

    @sr-tream

    Found workaround: set permission "write": true. OpenCode rejects writes out of the working directory, and has functionality to undo the last edit. So I think this permission must be safe for most cases

  4. chenxin-yan commented on Nov 7, 2025

    @chenxin-yan
    Author

    Found workaround: set permission "write": true. OpenCode rejects writes out of the working directory, and has functionality to undo the last edit. So I think this permission must be safe for most cases

    I think write tool is being enabled by default. Also, to reproduce this error, the file do not have to be outside of cwd.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions