Skip to content

Session-create unrevert can restore a snapshot from another worktree #35255

Closed as not planned

Description

@jpgagnebmc

Summary

When multiple checkout roots resolve to the same opencode project identity, session-create unrevert can restore a snapshot tree captured in one worktree onto a different current worktree root.

Observed impact

With opencode 1.17.9, a stale snapshot captured in a throwaway apply worktree was later restored by session-create in the main checkout because both directories shared one project identity. The main checkout was overwritten with the foreign tree as unstaged file changes and untracked files, while the repository git metadata remained untouched.

Expected behavior

A snapshot restore should be scoped to the worktree/root where the snapshot was captured, or unrevert should refuse to restore when the current worktree root differs from the snapshot source. Project identity collisions should not allow cross-directory whole-tree restores.

Local mitigation

The affected workspace disabled filesystem snapshots via project config to remove this replay path.

Activity

  1. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or closely related to existing issues. Please check:

    If your issue is distinct from the above, please add a comment clarifying how it differs.

  2. github-actions commented on Sep 2, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions