Threads started with t3_thread_launch ignore the "new threads start in a worktree" default
What happened
New threads are set to start in a worktree (defaultThreadEnvMode: "worktree", no project override). Threads that an external MCP client starts with t3_thread_launch still run in the project checkout when the call leaves out workspaceStrategy.
Four threads started this way shared one checkout. One of them switched branches under the other three.
Diagnosis
The launch handler ends with workspaceStrategy: strategy ?? { type: "root" } (apps/server/src/mcp/toolkits/project/handlers.ts). It already loads the project's settings, and it uses them for the model, the runtime mode and startFromOrigin (#30226). The workspace is the one launch default that the server never reads. Only the clients read defaultThreadEnvMode.
This is documented ("Project, model, and modes inherit when omitted; workspace does not"). I think that default is wrong when the user has set the worktree default. The setting says it controls "where new threads start", and a caller that omits the field has made no choice.
Possible fix: when the strategy is omitted and the project's default is "worktree", launch in a new worktree from the default branch. The server already picks that base for unbound scheduled tasks. Keep the checkout for non-Git and Scratch projects, as the composer does. An explicit { type: "root" } still means the checkout. The tool description and the agent instructions ("No workspaceStrategy: project root") need the same change.
Steps to reproduce
- Set
defaultThreadEnvModeto"worktree"(global, no project override). - From an external MCP client, call
t3_thread_launcha few times on one Git project. Leave outworkspaceStrategy. - Every thread runs in the project checkout. A thread started from the composer gets its own worktree.
Version
0.1.10, and the same on main @ 3fdd9fc
Environment
Linux arm64, external MCP client
Evidence
Related issues
#19786 and #32491 are the same gap for schedule_task, in the other direction. #30226 made an omitted startFromOrigin follow the setting. None covers the launch workspace.
Fix applied or workaround
Pass a worktree workspaceStrategy on every launch.
Filed by
Claude Code (co-written with Claude Fable 5.2)
Confirmed, I've noticed this myself as well.