[Bug]: t3_worktree_handoff drops git's error message ("git worktree add failed") #38935
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#
- Fill the disk until it has a few hundred MB free (or any other condition that makes
git worktree addfail for a reason other than the ones T3 already names). - From a Claude thread on the project root, call
t3_worktree_handoffwith{"branch": "fix/example", "baseRef": "origin/main", "startFromOrigin": true, "continuationPrompt": "…"}.
Expected behavior#
The error carries git's own message and the ref and path T3 used, e.g. git worktree add failed: fatal: … No space left on device (branch fix/example from origin/main), so the agent can act on it.
Actual behavior#
{"_tag":"WorktreeMcpFailure","code":"operation_failed","message":"Unable to create the worktree: Git command failed in GitVcsDriver.createWorktree (<project root>): git worktree add failed"}
git's stderr is dropped. In the case above the agent only found the cause (disk 100% full, 356 MB free) by running git worktree add --dry-run and df itself; the identical handoff call succeeded later once space was freed.
In my usage over one week this generic error came up 3 times in 3 sessions, with different underlying causes. The cases T3 already recognises are clear (e.g. Branch '…' already exists and is checked out at '…'), so this is about the fallback path.
Impact#
Minor bug or occasional failure
Version or commit#
0.1.10 (desktop); also seen on the build before it
Environment#
macOS 27.2 arm64, Claude Code 2.1.327 provider
Logs or stack traces#
See "Actual behavior".
Workaround#
Run git worktree add --dry-run by hand to see git's message.
Related: #38027, where a missing ref was reported as a different error and the error text didn't name the ref.
tanstack-source added labelsbug
rishabhx29(GitHub profile, opens in a new tab) linked this to #40251
Note
🤖 GPT-6.2 Astra responding on behalf of Kayzel
This also affected delegated worktree creation on Linux with the worktree directory on a separate mount. A checkout reported
No space left on device. The project filesystem had 458 GiB available, while the filesystem containing the new worktree had 2.4 GiB available. Checking free space at the project root pointed to the wrong disk.For this failure, report the mount and available bytes for the worktree destination (or its nearest existing parent). The error handler currently records the Git command’s working directory and stderr length. GitVcsDriverCore.ts, lines 1625–1634
Sign in to join this conversation.
Note
Written by Claude Opus 5.5 on behalf of @seankoji
The same fallback hides pre-push hook refusals in
pull_request_create/ "Push and create PR".On
0.1.12-nightly.20261123.5151(Linux), a local pre-push hook rejected T3's push. The only error T3 returned was:Git manager failed in createPullRequest: Could not push : Git command exited with a non-zero status.
server.trace.ndjsonshowsGitVcsDriver.pushCurrentBranch.pushWithUpstreamexiting non-zero and nothing else. TheGitCommandErrorkeepsstderrLengthbut not the text. Git's stderr in this case is the hook's own message followed byerror: failed to push some refs to '<url>', with no[rejected]line. No entry inGIT_FAILURE_REASON_PATTERNSmatches that, so the reason is null and the detail is generic. Running the same push by hand showed the hook's message at once.Two changes would have made this self-explanatory:
error: failed to push some refsand no[rejected]or[remote rejected]line, e.g. "A local pre-push hook or the transport refused the push. Push this branch from a terminal to see its message."GIT_DIAGNOSTIC_LINE_PATTERN, with credentials redacted, as the existing patterns allow, instead of only the length.The trigger here was a local hook that didn't yet allow the
maintenance.auto/gc.autoentries this build adds toGIT_CONFIG_*. That part was our configuration, not a T3 bug.