Skip to content

Side chat permanently blocked after a thread's first worktree setup is interrupted #34672

Closed

Description

@crvouga

What happened

On a thread whose first run requested a new worktree (baseRef: dev, startFromOrigin: true), I stopped the run during "Preparing workspace". Every later run (19 of them) ran fine in the project checkout. Starting a side chat on that thread now always fails with: "Thread ... has no worktree yet. Start the side chat once its worktree is set up."

Diagnosis

orchestrationV2WorktreePending (packages/contracts/src/orchestrationV2.ts) returns true when worktreePath === null and any run has status preparing/failed/interrupted with workspacePreparation.type === "worktree". Run 1 matches this forever. Later runs carry no workspacePreparation and never set a worktree path, so the thread is locked out of side chats for good. The same helper drives the web UI's disabled reason ("Available once the thread's worktree is set up.") and the server's thread.fork refusal (Orchestrator.ts, dispatchThreadFork). The test "a side chat waits for the parent's new worktree, also after its setup ended" only covers the single-run case. A likely fix is to consider only the latest run that requested a worktree, or to clear the pending state once a later run has started in the project checkout.

Steps to reproduce

  1. Create a thread in New worktree mode and send a message.
  2. Stop it while "Preparing workspace" shows.
  3. Send another message; the run continues in the project checkout.
  4. Try /side or the side chat button. It is refused permanently.

Version

0.1.9-nightly.20261111.4501 (desktop). The check is unchanged on main as of 2026-11-11.

Environment

T3 Code Desktop on macOS 27.2.0 arm64, local server, Claude provider.

Evidence

Runs for the thread: ordinal 1 `interrupted` with workspacePreparation {"type":"worktree","baseRef":"dev","startFromOrigin":true}; ordinals 2-20 have no workspacePreparation (one failed, the rest completed); thread worktreePath is null.

Related issues

None found.

Fix applied or workaround

Fork the thread normally instead of opening a side chat.

Filed by

Claude Opus 5.5 (claude-opus-5-5) via Claude Code inside T3 Code triage.

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