fix(server): a rollback blocked by Git's index lock says so instead of a generic error #11340
main fromrefs/pull/11340/head·merged by juliusmarminge View on GitHubA held Git index lock makes checkpoint rollback fail with a generic error. This change recognizes that specific Git diagnostic and sends a fixed actionable message after the last rollback attempt. Other failures retain the generic message; lock files, restore behavior and retries are unchanged.
Maintainer takeover of @shivamhwp's original work in #11340. Preserved the implementation and contributor commits, merged current main, and reduced added test cases from nine to five by removing duplicate fixtures.
Verification at ba92322:
- 77 focused tests pass across VcsProcess, CheckpointRollbackService and EffectWorker; scoped lint and server typecheck pass.
- Reverting production to main makes the real-Git lock regression and final-attempt client-message regression fail as expected.
- Live Linux web client: two Codex turns in an isolated disposable worktree; Edit from here → Revert files too shows the actionable lock error. The edited file and test-owned lock remain intact. Removing that lock lets retry restore the file and conversation successfully.
- One independent full-diff review round with Opus 5.5 and GPT-6 Sol returned no blocking findings.
Before/after test results and current-head live proof.
Author's October 14 screenshots remain illustrative (production code is unchanged by the takeover):
Before: main's generic rollback message.
After: the actionable index-lock message.
Verification limits: this VM's browser screenshot renders controls without text, so the current live proof uses actual DOM inspection and filesystem observations. Importing a read-only data snapshot hit a migration-history mismatch; verification used newly created isolated fixture data. Native Windows, macOS, Electron, iOS and Android were not exercised. Windows diagnostics are covered in tests; mobile has no rollback UI.
Model/harness: tests by GPT-6 Astra / Codex; implementation by GPT-6.1 Sol / Codex; reviews by Claude Opus 5.5 / Claude Code and GPT-6 Sol / Codex. Unmerged.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
ba92322Macroscope's review found this PR approvable — This is a narrowly scoped rollback error-message fix: only a recognized Git index lock receives an actionable sanitized message, while rollback mechanics and all other failures remain unchanged. Targeted tests cover the Git diagnostic, retry behavior, and final client-facing message.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 2 2 0 (0.0%) 8 ✅ Baseline:
5307c23· PR result:ba92322· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
Independent validation of
04bd7d320465f8b93417fecb0b4ca1e3e0004d2a(merge-base050e2cafb144).Reproduced real index-lock failures in three layouts: a standard repository,
--separate-git-dirwith spaces in the metadata path, and a linked worktree. Passed Git’s captured failure through the actual VcsProcess classification service. The merge-base gave the generic exit message; this revision identified the index lock in all three cases. The lock and modified file remained untouched after failure; removing only the test-owned lock let Git restore the original file. No native Windows run was performed.Reproduction scripts and recorded results —
fourth.mjs; the numbered metadata file pins this PR’s tested revisions.Model: GPT-6. Harness: Codex.
github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change
Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.- Last reviewed commit: ff14db1189fe6d61d0670b17c19d852126cae27d
- Latest commit, not reviewed: ba9232271f0535daa38784e030cdc6db153781fe
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- ▶️ Resume reviews
- 🔍 Trigger review
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b2db0b4c-8af4-4861-be21-4f3c719f3bd9
📥 Commits
-
Reviewing files that changed from the base of the PR and between aa3ec5e33034a21e3fe58081c0dfbee60a884710 and ff14db1189fe6d61d0670b17c19d852126cae27d.
📒 Files selected for processing: 1
-
apps/server/src/orchestration-v2/EffectWorker.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
📝 Walkthrough
-
The VCS process now identifies Git
index.lockfailures and assigns them a sanitized, specific error detail. Rollback handling exposes that detail only for the matching restore failure. Tests cover lock classification, restore behavior, and rollback error messages.Changes: Git index lock handling
Layer / File(s) Summary Index-lock classification and restore behavior
apps/server/src/vcs/VcsProcess.ts,apps/server/src/vcs/VcsProcess.test.tsMatching Git index-lock failures now use a specific sanitized error detail. Tests cover Unix and Windows messages, permission errors, other lock files, and restore behavior with and without the lock. Rollback client error mapping
apps/server/src/orchestration-v2/CheckpointRollbackService.ts,apps/server/src/orchestration-v2/EffectWorker.ts,apps/server/src/orchestration-v2/CheckpointRollbackService.test.ts,apps/server/src/orchestration-v2/EffectWorker.test.tsRollback handling returns the lock-specific message only for a matching nested restore error. The worker uses that message when a failure value exists. Tests verify the specific and generic messages, including retryable and final attempts. Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge,bil0000
Merge Risk: ⚪ Minimal · up to
ff14d-
Checkpoint restores blocked by Git's index lock now show a specific, sanitized message. Other rollback failures keep the generic message. No merge-blocking risk was identified.
Security architecture risk: ⚪ Minimal · up to
ff14d-
The new client-visible text is a fixed, sanitized explanation. Other failures remain generic, and the change does not expand rollback permissions or alter restore, retry, or interruption behavior.
Retained concerns No architecture-level concerns identified.
Security review details
-
Security Blast Radius
- inferred — The changed rollback exposure is more specific failure text on an existing request, not additional access to repositories or threads. The worker passes the same thread, provider-thread, checkpoint, scope, and restore-files inputs to the existing rollback operation.
Trust Boundaries and Controls
- observed — Even if repository-influenced Git output matches the lock pattern, the newly permitted client payload is a fixed explanation, not attacker-selected stderr, repository paths, or internal identifiers. Added tests distinguish the allowed explanation from raw-output and unclassified failures, which remain generic.
-
Pre-merge checks:
4-
Check name Status Explanation Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Title check The title is concise, specific, and accurately describes the main change: reporting a Git index-lock rollback failure instead of a generic error. Description check The description explains the problem, the implementation, scope, verification results, limitations, and model/harness usage. It does not use the template headings, but it provides the required informa… Full details: Description check
-
Explanation
The description explains the problem, the implementation, scope, verification results, limitations, and model/harness usage. It does not use the template headings, but it provides the required information in a complete and relevant form.
-
Comment `@coderabbitai help` to get the list of available commands.✨ Finishing Touches
-
📝 Generate docstrings
-
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
github-actions[bot](GitHub profile, opens in a new tab) removed labels📱 Native Change
juliusmarminge added labelsmacroscope-review
shivamhwp(GitHub profile, opens in a new tab) changed the title
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
@shivamsdot
Codebot responding on behalf of Shivam.
juliusmarminge assignedjuliusmarminge
Taking over this one as maintainer for batch server-misc-04. I will reduce the regression tests, rebuild against current main, and run independent reviews. Credit stays with @shivamhwp; this work will remain unmerged.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged this9448aa5
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed