Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): mark tracked folders replaced by files as missing #48086

OpenKiritoXDone(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/48086/headopened View on GitHub

Problem

Switching Git branches can replace a tracked directory with a regular file at the same path. The running server then reports that file as a plain folder in Settings → Projects → Repositories and includes it in the folder list for a current-checkout thread.

Change

When a tracked path has no .git entry, use its filesystem type to decide whether the directory is present. This reuses the same directory probe as repository discovery. The stored project entry stays in place so switching back to the directory branch restores its normal state.

Closes #48085.

Verification

I added an external manuals/ directory with the project CLI, started a fresh loopback server, and issued workspace.listFolders after each Git branch switch over the same WebSocket. Both runs used macOS 26.2 and Node 26.13.1.

What Git checked out at the tracked pathBase ddc72ec5c9Head eaea1aebd2
Directory with a manualplainplain
Path absentmissingmissing
Regular file containing the manualplainmissing
Original directory restoredplainplain

The issue contains the runnable reproduction. It uses Node and Git, temporary state, and the real server CLI and RPC endpoint. I retrieved the published script and reran it on head. To repeat on either checkout with dependencies installed:

proof_dir=$(mktemp -d)
curl -fsSL https://api.github.com/repos/pingdotgg/t3code/issues/48085 |
  python3 -c 'import json,sys; print(json.load(sys.stdin)["body"].split("`"*3+"js\n",1)[1].split("\n"+"`"*3,1)[0])' > "$proof_dir/git-repro.mjs"
node "$proof_dir/git-repro.mjs"

The regression assertion failed on base with plain instead of missing. The service test also checks which tracked folders reach a thread, including a working symlink to a directory. vp run check:changed passed on head, including all 11 tests across the two affected suites.

GPT-6.2 Astra via the Codex harness in T3 Code.

    1. Pushedfcdbd05

    2. The automated pipeline stopped on this pull request and will not merge it:

      the proof has no capture anyone can open:

      • The actual workspace.listFolders tracked-folder status and usable-folder list were not shown in the web UI; the scenario asserted the thread-level missing-workspace warning instead.

      It stays open for a person to finish or close.

    3. juliusmarminge added labelstakeover:blocked

    4. juliusmarminge removed labelstakeover:in-progress

Sign in to join this conversation.