Skip to content

/undo reverts chat message but does NOT revert file changes #37106

Description

@CodeBreaker-web

Description

/undo only reverts the AI's response text in the conversation history, but does NOT revert the actual file modifications that were made by that response. After running /undo, the files on disk remain modified. This contradicts the documented behavior, which states that /undo should revert file changes.

Plugins

No response

OpenCode version

opencode TUI 1.3.0

Steps to reproduce

Steps to reproduce:

  1. Open opencode TUI in a git repository
  2. Ask the AI to modify any file (e.g. add a blank line)
  3. AI applies the change successfully — file is modified on disk
  4. Run /undo
  5. The chat message is reverted (removed from conversation), but the file on disk remains unchanged — the modification is NOT undone
  6. Running /undo multiple times does not help
    Expected behavior: Per the documentation, /undo should revert all file changes made by that message, restoring files to their original state.

Screenshot and/or share link

No response

Operating System

Ubuntu 20.04.6 LTS, Linux 5.15.0-67-generic x86_64

Terminal

X-terminal-emulator

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions