Repository navigation
Description
What happened
An agent called t3_thread_launch with workspaceStrategy: {type: "worktree", baseRef: "origin/master", startFromOrigin: true} and no projectId. The thread went into the caller's project, whose root is a plain folder holding several repos, not a git repo. The tool reported success, then the thread failed before its provider started:
Workspace preparation failed during provision worktree: Git command failed in GitWorkflowService.resolveWorktreeBaseRemote (~/code): Failed to resolve the VCS driver for this Git command.
Retry fails the same way.
Diagnosis
t3_thread_launch (apps/server/src/mcp/toolkits/project/handlers.ts) runs ThreadLaunchService.checkWorktreeBase to reject bad worktree launches before creating a thread. In checkWorktreeBase (apps/server/src/orchestration-v2/ThreadLaunchService.ts) the git checks are wrapped in .pipe(Effect.orElseSucceed(() => undefined)). A GitCommandError, such as the one VcsDriverRegistry.resolve raises for a non-git root, therefore counts as "resolved" and the launch is accepted. prepareInBackground then hits the same error and fails the thread.
Expected: reject a worktree strategy up front when the root isn't a git repo, naming the project and suggesting local or another projectId, as it already does for an unknown base ref. Swallowing every git error likely hides other failures too.
Unchanged on main (034f3ba).
Steps to reproduce
- Add a project whose folder is not a git repo (e.g. a parent folder of several repos).
- In a thread in that project, have the agent call
t3_thread_launchwithworkspaceStrategy: {type: "worktree", baseRef: "origin/master", startFromOrigin: true}and noprojectId. - The tool returns success with a thread ID.
- The new thread's "Worktree setup" fails with "Failed to resolve the VCS driver for this Git command." Retry fails the same way.
Version
0.1.8 (desktop app; local server serverVersion 0.1.8). Triage CLI also 0.1.8.
Environment
Linux x64 (kernel 7.0.0), desktop AppImage with its local server. Agent: Claude Code 2.1.322 over the T3 MCP server.
Evidence
Server trace spans for the launch (one trace):
- `McpServer tools/call` `t3_thread_launch`, params above, no `projectId`
- -> `ThreadLaunchService.checkWorktreeBase`: Success
- -> `GitWorkflowService.hasCommit`: Failure, `GitCommandError ... (~/code): Failed to resolve the VCS driver` (from `VcsDriverRegistry.resolve`)
- -> `orchestrationV2.dispatch.threadCreate`: Success
- -> `ThreadLaunchService.prepareInBackground`: Failure, `ThreadLaunchError ... failed during provision-worktree`
- -> `GitWorkflowService.resolveWorktreeBaseRemote`: Failure (same error)
- -> `prepared-run.fail`Related issues
- t3_thread_launch accepts an explicit branch that already exists, then the thread fails with branch_already_exists #31263: same class;
checkWorktreeBaseaccepts a launch that later fails (existing branch). Its fix wouldn't cover swallowed git errors. - Scheduled tasks that launch a fresh thread always save a worktree workspace strategy, so every run fails in non-git projects #18615, [Bug]: "workspace preparation failed" on scheduled task for "no project" #17309 (closed): same VCS driver failure in non-git projects, via scheduled tasks.
- [Bug]: t3_thread_launch with an unknown projectId fails with "The operation could not be completed." #29094: another
t3_thread_launchpre-check gap (unknownprojectId).
Fix applied or workaround
Archive the failed thread and launch again with the projectId of the real git repo, or with workspaceStrategy: {type: "local"}.
Filed by
Claude Code (Claude Opus 5.5), following the T3 Code triage playbook.
Activity