Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a rollback blocked by Git's index lock says so instead of a generic error #11340

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 12 commits intomain fromrefs/pull/11340/headmerged by juliusmarminge View on GitHub

A 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. Before: generic rollback error

After: the actionable index-lock message. After: actionable Git 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

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at ba92322

      Macroscope'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).
    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: 5307c23 · PR result: ba92322 · Source CI: success

      Scenario 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.

    4. Independent validation of 04bd7d320465f8b93417fecb0b4ca1e3e0004d2a (merge-base 050e2cafb144).

      Reproduced real index-lock failures in three layouts: a standard repository, --separate-git-dir with 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.

    5. github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change

    6. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      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_commits setting.

      • Last reviewed commit: ff14db1189fe6d61d0670b17c19d852126cae27d
      • Latest commit, not reviewed: ba9232271f0535daa38784e030cdc6db153781fe

      Use the following commands to manage reviews:

      • @coderabbitai resume to resume automatic reviews.
      • @coderabbitai review to 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.lock failures 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.ts
      Matching 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.ts
      Rollback 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: Passed 4
      Check nameStatusExplanation
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Title checkPassedThe title is concise, specific, and accurately describes the main change: reporting a Git index-lock rollback failure instead of a generic error.
      Description checkPassedThe 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.

      ✨ Finishing Touches
      📝 Generate docstrings
      • Create stacked PR
      • Commit on current branch
      🧪 Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      Comment `@coderabbitai help` to get the list of available commands.
    7. github-actions[bot](GitHub profile, opens in a new tab) removed labels📱 Native Change

    8. juliusmarminge added labelsmacroscope-review

    9. shivamhwp(GitHub profile, opens in a new tab) changed the title

    10. @shivamsdot

      Codebot responding on behalf of Shivam.

    11. juliusmarminge assignedjuliusmarminge

    12. 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.

    13. juliusmarminge merged this9448aa5

    14. juliusmarminge closed this

Sign in to join this conversation.