Repository navigation
fix(server): allow slow worktree base fetches to finish - #24604
Conversation
A healthy fetch before creating a worktree must survive past 30 seconds, and a hung one must still fail with a clear timeout at five minutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 30s The fetch that runs before `git worktree add` inherited the 30s git default, so busy repositories failed to create a worktree while the fetch was still making progress. Give fetchRemote a five-minute bound, matching worktree add, and pin that bound in the test by checking the hung fetch is still running one second before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — Remote fetches now have a five-minute timeout instead of 30 seconds, allowing slow worktree-base fetches to complete. This changes default waiting behavior, requiring a human to accept the longer delay for stalled fetches. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
… 30s The fetch before a start-from-origin worktree inherited the 30-second Git default. On a large Windows checkout a no-op single-branch fetch takes 15-32 s, so new worktree threads failed with "Git command timed out." Remote fetches now allow five minutes per attempt; a hung fetch still fails. Carries juliusmarminge's takeover of watson's fix, applied to current fork code with its TestClock regression cases. Upstream-PR: pingdotgg#24604 Co-Authored-By: Claude Opus 5.5 (high, primary) <noreply@anthropic.com>
|
This also reproduces on Windows with the existing branch-scoped, no-tags fetch. In a 2026-11-10 server trace, two worktree-provisioning fetches timed out after 32.1 s and 31.3 s. A manual no-op run of the same scoped fetch took 15.3 s, including 9.3 s in the connectivity rev-list. The checkout had 2,294 pack files and 6,760 refs, so the generic 30-second limit had little margin even when there was nothing new to download. We carried this change in our fork. Both new regression cases failed against the old implementation and passed with the timeout override; all 34 fetch-related driver tests passed on the rebased fork commit. These results support the longer bounded timeout while keeping genuine fetch failures visible. A live launch against a slow external remote was not exercised. Posted by GPT-6.1-Sol on behalf of Alb11747. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceCreate a synthetic remote with a 37-second upload-pack delay. In the real web app, select New worktree → From main (remote), advance the remote after the background fetch settles, leave origin/main stale, and submit using Replay Showcase. Both sides use fresh databases, Chromium at 1280×800, and light theme. Fixture paths are masked.
The replay harness disables paid text generation, so the successful run retains its autogenerated branch name and shows a branch-renaming warning. Not shown:
|
) (cherry picked from commit 8b30961)
The fork already contains the upstream versions of the slow Git fetch, Codex effort-only reload, bounded delegation waits, and requeued-steer visibility. Drop duplicate Git and timeline tests. Keep the Antigravity delegation coverage and thread-wait parameter help as a fork follow-up. This reverts commit 94257e3. This reverts commit 78db7eb. This reverts commit 367053b. This reverts commit 4202c26. This reverts commit e651005. This reverts commit 3ce35da. Refs: 94257e3 Refs: 78db7eb Refs: 367053b Refs: 4202c26 Refs: e651005 Refs: 3ce35da Related-PR: pingdotgg#15622 Co-Authored-By: GPT 6.2 Sol (high, implementation) <noreply@openai.com> Co-Authored-By: GPT 6.2 Sol (xhigh, review) <noreply@openai.com> Co-Authored-By: Claude Fable 5.2 (medium, design) <noreply@anthropic.com>




Creating a worktree could fail while fetching a healthy busy remote because fetch inherited the 30-second command limit. Remote-base fetches now allow five minutes per attempt; a genuinely hung fetch still fails with
Git command timed out.Takeover
Original fix by @watson in #18537, rebuilt on current main on an origin branch. Kept the fixed five-minute fetch bound and replaced the regression coverage with two TestClock cases. Omitted the unrelated executable-bit fixture change.
Evidence
Server-only runtime proof from real dev servers, isolated fresh homes, and a local bare remote behind delayed/hung upload-pack. Before: 7fd2e09e38. After: cefc1ace94.
Evidence index and all reproduction scripts. Corrected fixture matrix · Proof audit: SUFFICIENT · Independent replay bundle. Independent replay succeeded in 37.218s with fresh HEAD; all affected rows passed.
Environment: Linux x86_64, Node 26.12.1, Git 2.43.0; real
vp run dev, RPC thread launch with remote-base fetch, no browser. No screenshots or pixel diffs apply.What else changed: the longer fetch uses the existing long-command path outside the short-command semaphore. Retry/fallback logic, other fetch helpers, checkout/removal timeouts, clients, contracts and provider adapters are unchanged. Five minutes bounds each fetch attempt; retry can extend the whole workflow.
Verification log
Original description by @watson
Creating a worktree from origin could time out during a healthy fetch on a busy repository. That fetch inherited the 30-second command limit even though the following checkout allows five minutes.
fetchRemotenow uses the same five-minute bound as worktree creation, including its existing ref-lock retry and missing-branch fallback. Slow fetches also stay outside the short-command semaphore, so they do not hold slots needed by status commands. A genuinely hung fetch can now take five minutes to fail.The regression uses real git and a local bare remote with an Effect test clock: a fetch lasting over 30 seconds succeeds and updates the remote ref. Removing the timeout override reproduces the failure. The existing timeout test still proves that a hung fetch is bounded and not retried.
After merging current main, all 166 GitVcsDriverCore tests, server typecheck, targeted lint and formatting pass at e0882fa. Fresh independent Opus and Sol reviews found no blocking defects.
The broader test run exposed a local executable-bit fixture failure on cups; current main CI already passed that fixture. One
checkout-index --forcecall makes the test file on disk match its staged executable mode, retaining both mode-change assertions. The cause of the environment difference was not identified. A real launch against a slow external remote was not exercised; no UI changes require screenshots.Explicit maintainer approval of the longer timeout policy remains a landing requirement.
Original fix by @watson in #18537. Maintainer takeover by Claude Opus 5.5 and Claude Fable 5.1 through T3 Code, independently reviewed by Claude Opus 5.5 and GPT-6.1-Sol through the Codex harness.