fix(server): let slow worktree submodule checkouts finish#28482

merged1
main
GitHub fork: bugfix/worktree-submodule-timeout-upstream
opened9d agobyIiXab3r
View on GitHubTwo-way sync enabledPR last imported 8d ago

Problem

Submodule initialization inherits Git's 30-second total deadline. Slow clones are interrupted mid-checkout, but worktree creation still succeeds. The reported Windows 0.1.5 trace confirms a timeout after 30.9 seconds.

Change

Set timeoutMs: null only for the submodule update, matching the existing cancellable git worktree add path. Cancellation and best-effort failure handling remain unchanged; the warning now describes submodules as potentially incomplete.

Scope and approval

Follows #26409 to fix the 30-second submodule-update timeout reported in #26390. #7674 introduced automatic initialization; #23802 later removed the worktree-add deadline. This applies the same policy to submodule checkout.

Verification

  • Seven focused tests pass: recursive/top-level checkout with/without progress past six simulated minutes, recorded gitlink and clean status, cancellation, and best-effort failure. Five regression cases fail with the original deadline.
  • Real client, identical slow fixture and separate databases; actual Git verification in the app terminal, with free Replay (dev). Cancellation and cleanup also verified.
  • vp run check:changed: all static checks pass; 204 tests pass, three skipped, ten failures. All ten also reproduce with unmodified upstream code at 8b74a69019 on this Windows/Git 2.32 host.
Before — 31.2 s timeout (6575ce3250)After — 40.9 s complete (6f8633f5de)
sub03/nested has no files despite clean parent statusAll six submodules populated at recorded gitlinks; clean status

Reproduction fixture and transcripts.

Model and harness: GPT-6.1 Sol via Codex in T3 Code.

Checks

23 successful · 14 skipped · 1 neutral
All checks passed
f87917a

Added 1 commit

  • fix(server): let slow worktree submodule checkouts finishf87917a
Synced from GitHub

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — Worktree submodule checkouts now wait without the previous 30-second deadline, preserving progress and failure reporting. This changes the default waiting policy: slow clones can finish, while stalled clones require cancellation.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

Walkthrough

Submodule updates during worktree creation now run without a timeout. Tests cover delayed recursive and top-level updates, optional progress callbacks, cancellation, and failed updates.

Changes: Submodule worktree updates

Layer / File(s)Summary
Submodule update timeout and worktree validation
apps/server/src/vcs/GitVcsDriverCore.ts, apps/server/src/vcs/GitVcsDriverCore.test.ts
Submodule updates now set timeoutMs to null, and the failure warning says submodules may be incomplete. Tests cover updates delayed beyond six simulated minutes, recursive and top-level modes, optional progress reporting, cancellation, and failure reporting while worktree creation succeeds.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Possibly related issues

  • pingdotgg/t3code#26390: The issue describes the submodule update timeout during worktree creation; this change removes that timeout.

Suggested labels: bugfix, size:M

Suggested reviewers: juliusmarminge, macroscopeapp

Merge Risk: External image Low · up to f8791

Slow submodule checkouts can now finish, but a checkout that never exits requires cancellation. This is a bounded concern for the owner rather than an established reason to block merging.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title "fix(server): let slow worktree submodule checkouts finish" matches the main change. The PR removes the 30-second Git deadline for the submodule update during worktree creation, so slow chec…
Description checkPassedThe description follows the template's main sections: Problem, Change, Scope and approval, Verification, and a model/harness note. The Problem section gives the cause (Git's 30-second total deadline) …
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.
Full details: Title check

Explanation

The title "fix(server): let slow worktree submodule checkouts finish" matches the main change. The PR removes the 30-second Git deadline for the submodule update during worktree creation, so slow checkouts can complete. It follows the conventional commit format and names the affected component (server) and the behavior being fixed.

Full details: Description check

Explanation

The description follows the template's main sections: Problem, Change, Scope and approval, Verification, and a model/harness note. The Problem section gives the cause (Git's 30-second total deadline) and the observed trace (30.9 seconds). The Change section explains setting timeoutMs to null for the submodule update and the updated warning. Scope links related issue and PRs (#26390, #26409, #7674, #23802). Verification reports focused tests, regression results, a real-client check, the known failing tests on upstream, and before/after screenshots. The model and harness are named. Minor gaps: the scope section cites related issues but does not clearly state a maintainer approval comment, and the verification section includes an unverified claim that the 10 failures reproduce on upstream without a linked log. Because the template asks for explicit approval evidence in Scope, the author should link the maintainer approval or explain why this small, obvious fix qualifies without it.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
CcoderabbitaiBotreviewed9d ago
Synced from GitHub
External image Additional comments: 1
apps/server/src/vcs/GitVcsDriverCore.ts-4200-4200: 1

4200-4200: External image Major · Stability & Availability · Heavy lift

External image Unverified finding Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Add a safety limit for a stalled submodule update.

If a submodule remote stops responding without exiting, timeoutMs: null leaves the command running indefinitely. createWorktree then remains pending after it claims the worktree, and the best-effort failure handler cannot report incomplete submodules. Use a generous stall or safety limit that preserves slow checkouts but lets a stuck command reach the existing failure handler. (raw.githubusercontent.com)


External image Review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between 8b74a69019e3d0f5be62dc118c526669002fc195 and f87917af447672802eb33060c45e456615dc8e89.

External image Files selected for processing: 2
  • apps/server/src/vcs/GitVcsDriverCore.test.ts
  • apps/server/src/vcs/GitVcsDriverCore.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified unchanged head f87917af447672802eb33060c45e456615dc8e89 on this linux vm, after reproducing the bug on github/main (7195b69954) in a separate worktree. each checkout ran vp i and its own isolated dev database, with only one dev server running at a time.

used playwright from the repo with /usr/bin/google-chrome. through the web ui i added a real git project, selected codex gpt-6.1-sol, selected new worktree, and submitted a read-only verification turn. the submodule came from a real rate-limited http git remote carrying a 4 mib payload. git and codex were not mocked.

  • main: submodule update timed out at about 30 seconds. the real provider turn then reported an uninitialized submodule and missing files, despite clean parent git status.
  • pr: workspace preparation completed in 42.687 seconds. only then did the codex session attach. its commands confirmed the 4,194,304-byte payload and readme existed, the submodule matched the recorded commit, and both checkouts were clean.
  • cancellation: clicking cancel during the slow clone stopped setup after 11 seconds, removed the partial worktree, left no clone process, and started no provider turn.
  • offline remote: an actual connection failure still produced the incomplete-submodule server warning, preserved the worktree, and allowed the real codex verification turn to complete. best-effort failure handling still works.

vp run check:changed 8b74a69019e3d0f5be62dc118c526669002fc195 passed through blacksmith-check: format, lint, both knip checks, graphql, three package typechecks, and 217 tests across two files. the pr currently has 31 successful checks. no source changes or pushes were needed.

before, main:

main: real codex turn reports the missing submodule files

after, pr:

pr: real codex turn confirms populated submodule and clean git state

recording: setup remains active past the former deadline, then hands off to the real provider and shows its result:

slow checkout passes 30 seconds and completes before the provider reads the files

cancellation stops setup before the provider starts

short server and git command transcript

Not verified

native desktop, ios/android, windows/macOS, authenticated external submodule hosts, nested submodules, and runtime top-level/disabled settings were not exercised on this linux web-client pass. an indefinitely silent remote was not left running; explicit cancellation during a real slow clone was verified instead.