Skip to content

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersplan:todoPlanboard status

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions