Repository navigation
fix(server): prevent worktree creation from failing when Git output exceeds 1 MB - #31461
RusiruSadathana wants to merge 3 commits into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Worktree creation can now finish despite oversized Git output while retaining bounded diagnostics and continued progress reporting. Git failures still propagate, and unrelated Git operations are unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
AI-assisted; verified with the tests and tools listed above.
EvidenceCreate a committed disposable repository with a successful post-checkout hook emitting 1,300,000 ASCII characters to stdout. Add it as a project, select New worktree, and send the first message. Real Chromium web client, 1280×800, light theme; fresh synthetic state on each commit. Repository paths are dynamically redacted. Final stills were captured after two identical screenshots 500 ms apart and sidebar regrouping.
Reproduction scenario. scenarios:prove exited 0: base failed and head passed. AI-assisted; verified with the tests and tools listed above. Not shown:
|


Problem
Creating a worktree can fail with
Git output exceeded 1000000 bytes and was truncatedwhen checkout warnings or a post-checkout hook produce more than 1 MB of output. T3 aborts the checkout because its diagnostic capture limit is exceeded, even when Git could otherwise finish successfully.Reproduce with a repository whose post-checkout hook emits over 1 MB to stdout or stderr, then create a worktree through T3.
Change
Enable bounded output truncation for
git worktree addusing the existing Git execution support. Continue draining both streams and delivering checkout progress after truncation, and determine success from Git's exit status. Retained output remains capped at 1 MB per stream.The fix is in the shared server Git driver, so existing worktree provisioning and setup continue through their normal paths for every client.
Scope and approval
This qualifies as a small, focused fix for an obvious bug: a diagnostic output quota should not abort a successful worktree checkout. It introduces no setting, contract change, or new workflow. Only the Git driver and its regression tests change.
Verification
vp test run src/vcs/GitVcsDriverCore.test.tsfromapps/server: all 240 tests passed withTMPDIRresolved to its canonical path. The default macOS/varalias caused an unrelated existing long-worktree-name test to compare/varagainst/private/var; the canonical-path run passed without changing that test.vp run check:changed origin/mainwith canonicalTMPDIR: all checks passed, including formatting, lint, knip, GraphQL validation, typechecking of the three affected packages, and 242 tests across two files. Targeted server typecheck also passed.GitVcsDriver.createWorktreein a disposable repository with a post-checkout hook emitting 1,300,000 bytes each to stdout and stderr:Written with GPT-6.1 Sol through the Codex harness in T3 Code.