anomalyco / anomalyco/opencode

Snapshot restore from a subdirectory can overwrite sibling files

Open
#39,513 1 comment 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Jul 29, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Reverting or unreverting a session started in a subdirectory can overwrite an unrelated edit in a sibling directory. Snapshot restore applies its whole shared snapshot index with checkout-index -a -f instead of restoring only the session directory.

Plugins

None

OpenCode version

dev (7565e035)

Steps to reproduce
  1. Create a Git repository with frontend/ and backend/ files.
  2. Start a session in frontend/, create a snapshot, and change a frontend file.
  3. Make an unrelated edit to a backend file, then revert or unrevert the session.

The backend edit is restored from the snapshot. Only files under frontend/ should change.

Screenshot and/or share link

None

Operating System

macOS

Terminal

Ghostty

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.