Skip to content

opencode reverts developer modifications to the LLM generated code #4125

Closed

Description

@albertborsos

Description

Opencode reverts/overwrites the user modifications on opencode generated contents.

I think opencode should watch if these file are changed since it red last time. Before any new file modification.

OpenCode version

1.0.35

Steps to reproduce

  1. If I give a task to opencode, it implements in its way. Usually it is OK, but not perfect. That is fine.
  2. I modify the generated code to my needs
  3. then I give another task to opencode
  4. and it reverts my modifications to the previously generated code by opencode.

Screenshot and/or share link

No response

Operating System

macOS 15.7.2

Terminal

vscode

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 9, 2025
  2. github-actions commented on Nov 9, 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.

  3. albertborsos commented on Nov 9, 2025

    @albertborsos
    Author

    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.

  4. rekram1-node commented on Nov 9, 2025

    @rekram1-node
    Contributor

    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

  5. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    bugSomething isn't working
    on Nov 9, 2025
  6. self-assigned this
    on Nov 9, 2025
  7. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Nov 9, 2025
  8. albertborsos commented on Nov 9, 2025

    @albertborsos
    Author

    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.

  9. sarisia commented on Apr 7, 2026

    @sarisia

    I'm having the same problem and saw this issue is closed. Are there any solution / workarounds?

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

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions