You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: graceful shutdown during checkpoint restore leaves files staged #36686
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Capture a checkpoint with edits to a tracked file, then edit that file again.
Restore the checkpoint files through a rollback.
Gracefully shut down the worker after Git restore stages checkpoint contents but before clean/reset finishes.
Inspect git diff --cached after shutdown.
The fix PR contains a deterministic real-Git test: gate clean, interrupt the scope-owned restore fiber, then inspect HEAD, index and file bytes. Run pnpm exec vp test run apps/server/src/vcs/GitVcsDriver.test.ts -t 'checkpoint restore'.
Expected behavior
Temporary checkpoint staging is cleared on interruption, as on successful restore. Pre-mutation cancellation preserves user staging.
Actual behavior
Checkpoint contents stay staged. HEAD and restored file bytes remain correct. Ordinary Stop does not cancel rollback. No file loss, unwanted commit or SIGKILL recovery is claimed.
Impact
Minor bug or occasional failure
Version or commit
Reproduced on main @ 0a8aaa3. Independently confirmed by Claude Opus 5.5 on main @ 5ba3a84.
Environment
Linux, server checkpoint restore, real Git, provider independent.
Logs or stack traces
Cancelled restore: index tree b1fa7380 instead of HEAD tree 5af1a687. Normal restore control passes. HEAD unchanged; checkpoint bytes correct.
Screenshots, recordings, or supporting files
Found by the maintainer bughunt and independently verified. A worker-daemon transcript with real Git also reproduces staging after daemon interruption. Its executor/outbox are stand-ins; restart manually reclaims the same job rather than exercising startup recovery. No actual server SIGTERM was used.
Workaround
A subsequent successful restore clears staging, as demonstrated by the restart control. Related #21809 defers cancellation recovery; closed #16863 excludes interruption recovery.
Activity