t3code icon indicating copy to clipboard operation
t3code copied to clipboard

Worktree setup hides malformed local Git refs behind a generic fetch error

Open mikebanks opened this issue 1 week ago • 0 comments

What happened

Two T3 workers on my Mac stopped at Fetch base branch before either agent started. The message said git fetch origin failed. Running the fetch directly named the invalid local ref, which was the detail I needed to tell what happened.

Diagnosis

On Nightly 4890, the scoped fetch in GitVcsDriver.fetchRemote uses fetchFailureDetail to classify stderr and otherwise falls back to the generic message. The classifier has no case for fatal: bad object refs/.... The same gap is present on current main. Please show a fixed message such as “Git found a broken local ref. Check the local repository before retrying.” If the ref is shown, validate and bound it. Preserve the existing protection against persisting raw Git stderr, which can contain credentials.

Source: https://github.com/pingdotgg/t3code/blob/8cf97b5f06f30a872ce30ab8a888f2ff012365a2/apps/server/src/vcs/GitVcsDriverCore.ts#L656-L696

Steps to reproduce

  1. Make a disposable clone with origin/dev. Advance the remote branch by one commit, leaving the clone behind.
  2. In the clone, run git rev-parse refs/remotes/origin/dev > '.git/refs/remotes/origin/dev 2' to model the numbered file found on the affected Mac.
  3. In T3, create a worktree from origin/dev with Start from origin. For the Git-only check, run git fetch --dry-run --no-tags -- origin +refs/heads/dev:refs/remotes/origin/dev from the clone.

Version

0.1.11-nightly.20261118.4890 (desktop and local server)

Environment

macOS 27.3 (26C5047e), arm64; Apple Git 2.54.0 (Apple Git-157); local T3 desktop server on the Mac.

Evidence

Two affected launches on November 18, 2026. T3 trace: `GitVcsDriver.fetchRemote: git fetch origin failed`. The source checkout's Git fetch named a local ref ending in ` 2`. The disposable Git repro returned exit 0 with clean refs, exit 1 with `fatal: bad object refs/remotes/origin/dev 2` after adding the fixture, and exit 0 again after removing it. GitHub was reachable from the affected Mac.

Related issues

#10179 requested better fetch diagnostics for an SSH credential failure. #10905 concerned a checkpoint writer leaving an empty ref. This report covers the missing diagnostic for an already-malformed local ref during worktree setup.

Fix applied or workaround

Point T3 at a healthy clone. On the same Mac, the replacement worker prepared its worktree and started successfully from a separate clone outside iCloud Documents.

Filed by

Codex (GPT-6.2 Sol) via t3 triage

mikebanks avatar Nov 18 '26 23:11 mikebanks