Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped server bug fix that makes optional worktree metadata configuration best-effort while preserving required worktree creation behavior. A regression test covers the locked-config scenario, resulting worktree contents, missing metadata, and lock preservation. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesWorktree base-ref resilience
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Worktree creation remains available when optional base metadata cannot be written, with no actionable merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Dismissing prior approval to re-evaluate fc7431a
fc7431a to
08307ea
Compare
|
A held lock is not the only trigger. Concurrent worktree creation in one repository causes the same failure, without a sandbox or any lock file left behind. On 2026-10-09, an app launched three worktree threads into one repository in the same second. One of them failed during workspace preparation: Each Reproduction in a fresh repository, with git 2.54.0 on macOS: git init -q
for i in $(seq 1 12); do git config branch.b$i.gh-merge-base main & done; waitIn three runs of 12 parallel writes, 5, 2 and 3 writes failed. All 10 failures were exit 255 with This PR makes the write best-effort, so it also covers the concurrent case. A short retry alone would fix the race, but not a lock that a sandboxed command holds for minutes. That makes this PR the better fix. |
What Changed
A held
.git/config.lockmakes worktree creation fail after checkout has already succeeded, leaving the caller without the new worktree. Treat the optionalbranch.<new>.gh-merge-basewrite as best-effort: log a warning and return the usable worktree.Why
The shared Git driver covers both thread bootstrap and direct worktree requests. Base-branch resolution already falls back to the default branch when this metadata is missing, so a locked config should not prevent starting a thread. Required checkout failures and cancellation still propagate.
Closes #11735.
Scope and approval
Maintainer-triaged bug: triage comment on #11735 (labels
bug,accepted), which confirmsconfigureBaseReffailing on a locked config after a successfulgit worktree add. This PR only makes that optional metadata write non-fatal; orphan cleanup for other failures is not part of it.Verification
.git/config.lock:configureBaseReffailed with exit 255.0cf482b08b(Claude Opus 5.5, this session; resolved a test-file conflict by keepingmain's new submodule and parallel-progress tests alongside this regression):vp test run src/vcs/GitVcsDriverCore.test.ts -t worktree(apps/server): 19/19 passed, including the regression, which checks the returned branch, checked-out content, missing optional metadata, and the untouched lock.vp lintandvp fmt --checkonapps/server/src/vcs/: clean.tsc --noEmitwas not completed after the rebase (the machine was too loaded to finish it); it passed before the rebase. CI covers it.No UI changes.
Checklist
Created with GPT-6 in Codex. Rebase by Claude Opus 5.5 via Claude Code.