Skip to content

undoing a request that changed no files corrupts the working dir #32529

Closed as not planned

Description

@s4m1r0d4

Description

In a working directory with an active git repository, while using TUI mode, when a user does the /undo command after an agent made a response with no file changes, opencode adjusts the conversation history while acting as a "git revert" to a previous commit, leaving several files changed.

I have not pinned down if this "revert" behavior corresponds to the latest commit or an older one.

This is especially troublesome in cases were the working dir has unstaged changes because these are then mixed with the corrupted changes.

Plugins

No response

OpenCode version

1.17.1 (npm)

Steps to reproduce

  1. run opencode TUI inside a git repo with commits
  2. have an agent respond while making no file changes
  3. use the /undo command

Screenshot and/or share link

No response

Operating System

Fedora 42

Terminal

xfce4-terminal

Activity

  1. github-actions commented on Jun 16, 2026

    @github-actions
    Contributor

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

  2. s4m1r0d4 commented on Jun 16, 2026

    @s4m1r0d4
    Author

    I do not think this is a duplicate as this issue does not create unwanted commits, might be related though

  3. github-actions commented on Aug 16, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 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

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions