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 path | Base ddc72ec5c9 | Head eaea1aebd2 |
|---|
| Directory with a manual | plain | plain |
| Path absent | missing | missing |
| Regular file containing the manual | plain | missing |
| Original directory restored | plain | plain |
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.
The automated pipeline stopped on this pull request and will not merge it:
the proof has no capture anyone can open:
It stays open for a person to finish or close.