You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode reverts developer modifications to the LLM generated code #4125
This issue might be a duplicate of existing issues. Please check:
Feature: Check for uncommitted changes before continuing #3064: Feature request for checking uncommitted changes before continuing - addresses the same core problem of preventing OpenCode from overwriting user modifications by implementing a "commit_before_write" configuration option
Feel free to ignore if none of these address your specific case.
I do not let opencode, to commit the changes. Overwrite/revert also happens if I would like to make other changes on the same session, on the same part of the code. So the mentioned ticket is irrelevent in this ticket.
Should we make sure to notify the client and reference the modifications, especially if we’ve modified a lot of files? It’s easy to forget when we’re in the flow.
Is it possible that before OpenCode starts editing a file or reading it for context, it checks the latest modification date from its cache and compares it to the file’s modification date? If they’re different, it rereads the file.
I don’t know how it works, I’m just thinking out loud.
Activity
github-actions commentedon Nov 9, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
albertborsos commentedon Nov 9, 2025
I do not let opencode, to commit the changes. Overwrite/revert also happens if I would like to make other changes on the same session, on the same part of the code. So the mentioned ticket is irrelevent in this ticket.
rekram1-node commentedon Nov 9, 2025
generally I try to tell it i made a modification by @ referencing the file and saying so but ive ran into this myself
We could automatically inject somethign into the prompt telling the model that edits were made
or we could make some shortcut for that
albertborsos commentedon Nov 9, 2025
Should we make sure to notify the client and reference the modifications, especially if we’ve modified a lot of files? It’s easy to forget when we’re in the flow.
Is it possible that before OpenCode starts editing a file or reading it for context, it checks the latest modification date from its cache and compares it to the file’s modification date? If they’re different, it rereads the file.
I don’t know how it works, I’m just thinking out loud.
sarisia commentedon Apr 7, 2026
I'm having the same problem and saw this issue is closed. Are there any solution / workarounds?