Skip to content

/undo command only rolls back AI conversation message, not the associated file changes #5474

@sdivens

Description

@sdivens

Description

In OpenCode, when using the /undo command to revert an AI-generated change (e.g., after the AI modified code or wrote new code), only the conversation message in the chat is rolled back, but the actual file changes made by the AI remain in the workspace. This results in a mismatch between the conversation history and the actual code state.

OpenCode version

1.0.152

Steps to reproduce

  1. Start a conversation with the AI in OpenCode.
  2. Ask the AI to make changes to a file (e.g., "add a function to main.js").
  3. Let the AI apply the changes to your workspace.
  4. Type /undo in the chat to undo the last AI action.
  5. Observe: the conversation message disappears, but the file changes remain in your project.

Screenshot and/or share link

Image Image Image

Operating System

macos 15.7.1

Terminal

item2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
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