Skip to content

Bug: Unable to Revert Code Outside Workspace in OpenCode #13425

Closed

Description

@satyamkumar420

Description

When working with OpenCode, I noticed that the revert functionality does not work for files located outside the current workspace directory.
If I make changes to a file outside the workspace and attempt to revert those changes, nothing happens. The revert action either fails silently or does not trigger at all.

Expected Behavior
The revert feature should:
Either allow reverting changes for files outside the workspace
Or clearly show an error/notification explaining that reverting is restricted to workspace files only

Actual Behavior
Revert does not work for files outside the workspace
No clear error message or feedback is shown

Steps to Reproduce

  1. Open a workspace in OpenCode
  2. Modify a file that is located outside the workspace directory
  3. Try to revert the changes
  4. Observe that revert does not work

Environment
OS: Windows 10
OpenCode Version: and 1.60

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Feb 13, 2026

    @github-actions
    Contributor

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

    If your issue is distinct from these, please provide additional context explaining how it differs.

  2. OpeOginni commented on Feb 13, 2026

    @OpeOginni
    Contributor

    I am able to reproduce. The issue also allows cases where if you revert a message that made changes to only external directory, breaks the session summary. Could tinker a fix, to allow tracking of specific external directories where updates were made, but not sure how the team might want to handle this.

  3. github-actions commented on Apr 15, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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 workingwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions