t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: No project disappears when the T3 home is inside a git checkout

Open flamboh opened this issue 1 month ago • 1 comments

Area

apps/server

Steps to reproduce

  1. Put the T3 home inside a git work tree. This happens with a dotfiles repo at ~ (~/.t3 sits inside it), or with a dev server whose home is a worktree's .t3.
  2. Start the server and open the app.
  3. Look for "No project" in the new-thread picker, the command palette, or the sidebar.

Expected behavior

No project is available. It's a way to organize threads in the app, so where the server keeps its data shouldn't decide whether it exists.

Actual behavior

No project is missing everywhere. ManagedProjectFolders only offers the scratch root when <baseDir> is outside any git work tree (apps/server/src/project/ManagedProjectFolders.ts). The server then omits scratchWorkspaceRoot from its config, and clients hide every No project entry point.

The rule exists for a real reason, added in #13612: scratch folders live under <baseDir>/scratch, so inside a work tree they would pick up the parent repo's git status, diffs, and checkpoints. With a dotfiles repo at ~, each checkpoint would snapshot the whole home directory. But that is a problem with where the scratch folders live, not a reason to remove No project.

A possible fix: when <baseDir> is inside a work tree, git init the scratch root once. Git stops at the nearest .git, so the parent repo's status and checkpoints never reach the scratch folders. Two side effects to weigh: scratch threads would gain checkpoints scoped to that repo, and the parent repo would see one untracked nested repo unless it ignores .t3. The alternative is to move scratch outside the work tree, but temp dirs get wiped and a new folder in ~ is clutter.

Impact

Major degradation or frequent failure

Version or commit

main at ab6be13d43

Environment

Any OS. Reproduced on Linux with a dev server whose home is a worktree's .t3.

Logs or stack traces

No errors. The server just leaves scratchWorkspaceRoot out of its config.

Workaround

Move the T3 home outside any git work tree, for example with --home-dir.


Filed by Claude Opus 5.5 in Claude Code.

flamboh avatar Oct 19 '26 03:10 flamboh

[!NOTE] Grok responding on behalf of Julius.

This is intended behavior from #13612. That PR withholds No project when the T3 home is inside a Git checkout, because the scratch folders under it would inherit that repo's git status and checkpoints. The check in ManagedProjectFolders says so in its own comment and names both cases you hit: a dev worktree's .t3 and a dotfiles home. #17959 later kept that rule and only stopped a missing Git install from hiding the feature.

Workaround: run the server with a home outside any work tree, using --home-dir or T3CODE_HOME.

Initializing a nested repo in the scratch root is a design change with side effects, like new checkpoints for scratch threads and an untracked nested repo in the parent. If you'd like to propose it, please open it in Ideas: https://github.com/pingdotgg/t3code/discussions/new?category=ideas

juliusmarminge avatar Oct 19 '26 03:10 juliusmarminge