GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): a worktree thread moved to the project checkout no longer holds new messages by MarcoDotIO · Pull Request #40100 · pingdotgg/t3code

Conversation

@MarcoDotIO

@MarcoDotIO MarcoDotIO commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Problem

When a worktree thread's first turn fails or is stopped, and the user then moves the thread to the project checkout, every new message is held. Two things move the thread there: picking the default branch in the branch picker, which sends thread.metadata.update with worktreePath: null, or thread.project.adopt-folder. Resume is refused with "Retry worktree setup or choose a workspace before resuming the queue." There is nothing to retry, because the setup succeeded. The only way out is to move the thread back into a worktree.

The cause is in Orchestrator.ts. worktreeSetupPending, the worktreeMissingRun check in dispatchMessage and the worktreeMissing check in startNextQueuedRun all treat any failed or interrupted run with workspacePreparation.type === "worktree" as a failed setup once worktreePath is null. dispatchPreparedRunRelease keeps workspacePreparation on the run, so a run whose worktree was created and which later failed in the provider looks the same as a real setup failure. The shared orchestrationV2WorktreePending uses the same test, so side chats are blocked the same way ("Available once the thread's worktree is set up.").

Fix

A run only gets startedAt after its preparation is released, which happens after its worktree is recorded. A failed setup (prepared-run.fail) or a Stop during preparation leaves startedAt null. All four checks now also require startedAt === null, so only a setup that never finished holds the queue or blocks side chats.

Threads that are already stuck recover after the update, because nothing new needs to be stored.

Three existing fixtures modeled a failed setup as a run that had started (startedAt: now), which production never writes. They now use startedAt: null: the end patch in the runtimeLayer.test.ts queue harness can now set it, and writeParentRun in ThreadFork.execution.test.ts uses it too. What those tests assert is unchanged.

Scope and approval

This is a small fix for an obvious bug: a hold meant for a failed worktree setup fires for a setup that succeeded, and leaves the thread unable to run anything in the checkout the user chose. The change adds one condition at four sites. It adds no new state, schema or UI. It does not touch the separate open report #37196, where a Stop during preparation leaves a held message with no retry control.

Verification

  • New test, runtimeLayer.test.ts, "starts messages in the project checkout after a failed turn whose worktree was set up". It launches a run with a worktree strategy, releases it, fails it, sets worktreePath: null through thread.metadata.update, then sends a user message.
    • Base efbd13983f: AssertionError: expected 'queued' to equal 'starting'.
    • With the fix: it passes.
  • vp test run on runtimeLayer.test.ts, ThreadFork.execution.test.ts, ThreadLaunchService.test.ts, ProviderRuntimeRecoveryService.test.ts and OrchestratorMcpService.test.ts: 415/415 pass.
  • vp run check:changed: format, lint, knip, graphql and typecheck (36 packages) pass. Two tests in Orchestrator.control-reads.test.ts fail with statement.stat is not a function. They fail the same way on base, because the local Node (22.22) lacks that node:sqlite API.
  • Measured impact: in the scenario above, one user message sent after the move to the checkout.
    • Base: held (status: "queued", queueHeld: true), queue.resume refused with "Retry worktree setup…", still queued afterwards.
    • Fix: it starts. Held messages go from 1 to 0, and Resume refusals from 1 to 0.
  • Not checked:
    • The flow in a real client: branch picker, then send.
    • Mobile.
    • A real provider.
    • A run released and then stopped before its provider turn began still has startedAt: null, so that narrow window still reads as an unfinished setup.

Claude Opus 5.5 (Claude Code desktop app)

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@MarcoDotIO @claude
fix(server): a worktree thread moved to the project checkout no longe…
b8b755a
…r holds new messages

When a worktree thread's first turn failed or was stopped and the user then
switched the thread to the project checkout, every new message was held with
"Retry worktree setup", though the setup had succeeded and there was nothing
to retry. Any ended run that had asked for a worktree counted as a failed setup.

A run that started already had its worktree, so only runs that never started
now count, for the queue hold and for side chats.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Closing: MarcoDotIO already has 3 or more open PRs here, which is the limit for contributors who are not vouched.

Once one of them is merged or closed, open this again. See the open PR limit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Nov 21, 2026
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 21, 2026
@tiliakoos tiliakoos mentioned this pull request Nov 22, 2026
fix(server): a worktree thread moved to the project checkout no longer holds new messages #41052
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@MarcoDotIO
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.