You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Threads started with t3_thread_launch ignore the "new threads start in a worktree" default #38254
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 defaultThreadEnvMode to "worktree" (global, no project override).
From an external MCP client, call t3_thread_launch a few times on one Git project. Leave out workspaceStrategy.
Every thread runs in the project checkout. A thread started from the composer gets its own worktree.
#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.
Activity
lunaynx commentedon Nov 17, 2026
Confirmed, I've noticed this myself as well.