Repository navigation
fix(server): bulk worktree launches no longer fail on Git races - #17197
jakeleventhal wants to merge 4 commits into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a localized server-side concurrency bug fix that makes existing bulk worktree launches resilient to Git ref, path, config, and fetch races. The production changes are confined to the orchestration and VCS layers, with focused tests covering the new retry and synchronization behavior. You can add or adjust custom eligibility rules. Learn more. |
Keep upstream migration IDs 59 and 60; move YSK to 61 and repair historical fork ledgers atomically after applying missing schema changes. Adapt selected upstream fixes for Pi approvals, MCP images, workspace discovery, provider worker starvation, concurrent worktree launches, primary runtime ownership, session refresh, DPoP URLs and embedded-render scrolling. Preserve fork lifecycle and notice behavior, and close the approval and authentication gaps found in review. Adapted from pingdotgg#16854, pingdotgg#15879, pingdotgg#17190, pingdotgg#16790, pingdotgg#17197, pingdotgg#17172, pingdotgg#17075, pingdotgg#17037, pingdotgg#17065. Co-authored-by: Adamulek123 <adam.bogucki2018@gmail.com> Co-authored-by: anntnzrb <anntnzrb@proton.me> Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com> Co-authored-by: Lakshmi Tanmay <lakshmi@voltcrash.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Jake Leventhal <jakeleventhal@me.com> Co-authored-by: Malte Sussdorff <malte.sussdorff@cognovis.de> Co-authored-by: sheehanmunim <sheehanmunim@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Dara Adedeji <daraadedeji07@gmail.com> Co-authored-by: Joseph Vidal <josephv4000@gmail.com>
06b39da to
b6bd69f
Compare
Dismissing prior approval to re-evaluate b6bd69f
32ab2f6 to
ea5c623
Compare
ea5c623 to
34c6bf5
Compare
Dismissing prior approval to re-evaluate 34c6bf5
e7aeb01 to
b044dc4
Compare
Dismissing prior approval to re-evaluate b044dc4
|
Taking over this one as maintainer for batch worktree-git-16. I will preserve author credit, merge current main, reduce the tests, rebuild the Git race fix, and run independent adversarial reviews. No merge is planned. |
Dismissing prior approval to re-evaluate 6cb55dd
Launching many threads into new worktrees at once failed most of them: concurrent fetches of the base lost the ref lock, branch and path names collided, and concurrent writes to the shared Git config failed on its lock. Retry hit the same collisions again. Concurrent fetches of one ref now share a single running fetch. A taken branch or path gets the next `-1`, `-2` suffix, the same style renames use, while Git stays the arbiter. Config writes and branch renames take a per-repository lock, so checkouts stay concurrent and concurrent renames pick distinct names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
6cb55dd to
bcedc86
Compare
Concurrent launches into one repository can fail on fetch ref locks, occupied branch names or paths, and shared Git config writes. Retry can hit the same collision again.
This keeps launches independent: concurrent fetches of the same ref share their in-flight result, branch/path collisions retry with a bounded suffix (temporary branches get a fresh hash), and branch creation, merge-base config writes, and renames share a lock keyed by the Git common directory. Checkout stays parallel. A launch never retries once it has claimed a worktree path, and retrying a failed thread keeps its existing run and message.
Maintainer takeover of @jakeleventhal’s #17197, preserving the contributor’s commits and merging current main. The implementation also locks upstream config written during branch creation. PR-added test cases were reduced from 13 to 4 across the existing launch and Git driver test files.
Verification on headless Linux:
review diff previews > preserves renames, unusual paths, modes, and binary statisticsfailure also reproduces with main’s production code.Service-level tests exercise the server and real temporary Git repositories; screenshots do not demonstrate this server concurrency behavior. No browser, Electron desktop, macOS, Windows, iOS, or Android verification was performed. Network fetch coalescing is verified with a controlled process fixture, not a live remote race.
Coordination is local to one Git driver instance; external Git processes do not use its locks. As with Git’s existing
worktree add -b, an attempt that fails before claiming a worktree can leave an unused branch. Collision retries skip it without deleting existing work.Implementation: GPT-6.1 Sol (high) through the Codex harness in T3 Code. Tests: GPT-6 Astra (high), Codex harness. Independent reviews: Claude Opus 5.5 and GPT-6 Sol.