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
undoing a request that changed no files corrupts the working dir #32529
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
run opencode TUI inside a git repo with commits
have an agent respond while making no file changes
Activity
github-actions commentedon Jun 16, 2026
This issue might be a duplicate of existing issues. Please check:
/undodoes not restore code, and/redocorrupts Git state — similar report of git state corruption when using undo/redo in a git repositorys4m1r0d4 commentedon Jun 16, 2026
I do not think this is a duplicate as this issue does not create unwanted commits, might be related though
github-actions commentedon Aug 16, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.