[Bug]: New worktrees fail with "Git output exceeded 1000000 bytes" when git worktree add writes over 1 MB
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- git, typescript
- Domain
- developer-experience, tooling
Research direction
Start in apps/server at src/vcs/GitVcsDriverCore.ts, in createWorktree and its call to executeGitWithStableDiagnostics; compare the output handling with the git pull change in #17376. The issue points to truncation handling and progress callbacks as the area to investigate. Verify that oversized output no longer makes a successful git worktree add fail, and that the worktree is created.
Written by the indexing model from the issue text.
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- In any repo, add a
post-checkouthook that prints more than 1 MB (git sends hook stdout to its stderr):printf '#!/bin/sh\nhead -c 1100000 /dev/zero | tr "\\0" x\n' > .git/hooks/post-checkout && chmod +x .git/hooks/post-checkout - Start a new-worktree thread for that project, or call
delegate_taskwithisolation: "worktree".
The hook is a stand-in for any large output during checkout. A focused driver test on main (695f5c99) fails the same way.
Expected behavior
If git worktree add succeeds, the worktree is created and the thread starts. T3 only needs the progress lines from this command, not its full output.
Actual behavior
createWorktree runs git worktree add under the default 1 MB per-stream output cap, without appendTruncationMarker (GitVcsDriverCore.ts, createWorktree → executeGitWithStableDiagnostics). Once stderr passes 1 MB, the command fails and git is stopped partway through:
Workspace preparation failed during provision worktree: Git command failed in GitVcsDriver.createWorktree (<repo>): Git output exceeded 1000000 bytes and was truncated.
The failed attempt's t3/… branch is left behind.
We hit this in a repo with about 85,000 tracked files and 12,000 Git LFS objects. Two delegate_task worktree launches started 19 s apart from the same commit; one failed this way after about 230 s, and the other succeeded. Checkout progress (GIT_PROGRESS_DELAY=0) isn't the cause: piped stderr from git worktree add measured about 4.4 KB in that repo. We couldn't identify what went over 1 MB, because the output isn't logged. Anything that writes to git's stderr during checkout counts, including hooks, filter drivers such as git-lfs, and per-file warnings.
Impact
Minor bug or occasional failure
Version or commit
Desktop 0.1.1 (same createWorktree as main @ 695f5c99)
Environment
macOS (Darwin 25.6), Apple git 2.50.1, git-lfs 3.5.1
Logs or stack traces
GitCommandError: Git command failed in GitVcsDriver.createWorktree (…): Git output exceeded 1000000 bytes and was truncated.
❯ src/vcs/GitVcsDriverCore.ts:870:21 (collectOutput)
Screenshots, recordings, or supporting files
No response
Workaround
Delegate with isolation: "shared" and create the worktree manually.
Possible fix (suggestion only)
Do what #17376 did for git pull: run worktree add with appendTruncationMarker: true. Oversized output is then cut off instead of failing a checkout git completed, and the exit code still decides success. Progress updates past the cap would also need keepLineCallbacksAfterTruncation. Related: #17358, #25207, #21635.
- Dominant language
- TypeScript
- Stars
- 24.8k
- Forks
- 6.4k
- Avg merge
- 2h 54m
- Merged PRs (30d)
- 350
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pingdotgg/t3code
-
[Bug]: Pen taps on sidebar rows start a drag and lose their clickPossibly taken @makhnatkin claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
[Bug]: Guest messages near the 4,000-char limit fail with 400 "The request was not valid." because multipart turns \n into \r\nPossibly taken @juliusmarminge claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
pingdotgg/t3code#26523 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: preview_evaluate forbids WebMCP write tools even when the user explicitly asks for the changePossibly taken A pull request linked to this issue is open or already merged. Openbug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
All issues in pingdotgg/t3code
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
scaleway/ultraviolet#7089 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
tencent-connect/dsh-qqbot#81 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
clangd/vscode-clangd#1009 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day