Skip to content

t3_thread_launch accepts a worktree launch in a project that isn't a git repo, then the thread fails with "Failed to resolve the VCS driver" #34254

Closed

Description

@diwakar-s-maurya

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

  1. Add a project whose folder is not a git repo (e.g. a parent folder of several repos).
  2. In a thread in that project, have the agent call t3_thread_launch with workspaceStrategy: {type: "worktree", baseRef: "origin/master", startFromOrigin: true} and no projectId.
  3. The tool returns success with a thread ID.
  4. 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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions