Skip to content

restoreCheckpoint hard-resets the worktree with no safety checkpoint first #132

Closed

Description

@currentbits

Problem

electron/worktrees.js:2522-2526 runs git reset --hard <sha> directly when restoring a checkpoint. maybeCreateCheckpoint (worktrees.js:2393-2429) exists and is exactly the right safety net, but it is not invoked before the reset.

Impact

Any uncommitted work in the thread worktree (manual edits the user made in that folder, or changes from a run whose post-turn checkpoint silently failed, which is best-effort by design) is destroyed unrecoverably by one click on an older checkpoint.

Fix direction

Attempt maybeCreateCheckpoint(store, threadId) before the reset. One-line change plus a test.

Activity

  1. added
    bug
    good first issue
    plan:todo
    plan:doing
    and removed
    plan:todo
    on Aug 16, 2026
  2. added
    plan:done
    and removed
    plan:doing
    on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions