Skip to content

/undo only reverts conversation, not code changes across repositories #26488

@lightrao

Description

@lightrao

Description

I encountered an issue with /undo when using opencode across multiple Git repositories.

My opencode session was started inside repository A, but during the session I modified files inside repository B.

When I executed:

/undo

only the conversation history was reverted.

The code changes inside repository B were NOT reverted.

Expected Behavior

/undo should either:

  1. Revert all file changes made during the last assistant turn, including cross-repository edits

OR

  1. Clearly warn/document that /undo only tracks changes inside the current session repository.

Actual Behavior

  • Conversation rollback works
  • Changes in repository A may rollback
  • Changes in repository B remain unchanged

This can be dangerous because users may assume /undo restores all AI-generated modifications.

Reproduction Steps

  1. Start opencode inside repository A
  2. Ask the assistant to modify files in repository B
  3. Execute /undo
  4. Observe that repository B changes are not reverted

Environment

  • macOS Apple Silicon (M2)
  • opencode latest version
  • multiple Git repositories

Suggestion

Possible improvements:

  • Track all modified repositories during a session
  • Extend /undo to support cross-repository rollback
  • Or explicitly limit/document /undo scope in the UI/docs

Metadata

Metadata

Assignees

Labels

No labels
No labels

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