[Bug]: t3_worktree_handoff drops git's error message ("git worktree add failed")

Open Beginner friendly
#38,935 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
73/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, typescript
Domain
backend, devtools

Research direction

Start in the apps/server area by tracing the t3_worktree_handoff call to GitVcsDriver.createWorktree, where the reported failure comes from. Check how git command errors and stderr are handled, then reproduce a failing git worktree add and confirm the returned error includes git’s message, branch and path.

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
  1. Fill the disk until it has a few hundred MB free (or any other condition that makes git worktree add fail for a reason other than the ones T3 already names).
  2. From a Claude thread on the project root, call t3_worktree_handoff with {"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.

Dominant language
TypeScript
Stars
24.8k
Forks
6.4k
Avg merge
4h 46m
Merged PRs (30d)
488

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pingdotgg/t3code

All issues in pingdotgg/t3code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.