Skip to content

Let a thread move back to the project's main checkout #30

Closed

Description

@tannerpolley

Problem

A thread attached to a worktree can't return to the project's main checkout. t3_worktree_handoff only moves a thread into a new worktree and fails when the thread is already attached, and t3_thread_update says workspace and branch changes are intentionally unsupported. The owner's rule (2026-10-13) is that orchestrator threads always work on main in the main checkout, so an orchestrator that was started in a worktree is stuck there, still showing the worktree's old branch.

Done when

  • A thread can be re-pointed at the project's main checkout (workspace root) from the UI and through an MCP tool (for example a root target on t3_worktree_handoff, or a separate tool). Same safety as the existing handoff: it ends the live provider session and can queue a continuation prompt.
  • The thread's recorded branch updates to what the target checkout is on.
  • Optional: offer to remove the left-behind worktree when it is clean.

Found while cleaning up the fork's branch state.

Activity

  1. tannerpolley commented on Oct 14, 2026

    @tannerpolley
    OwnerAuthor

    Done on main (bf2701f, bb1faf8); ships in v2.12.

    • Agent tool: t3_worktree_return_to_root (optional continuationPrompt). It records the main checkout's current branch, or none on a detached HEAD, and leaves the old worktree on disk.
    • App: Move to main checkout in the workspace menu of a worktree-bound thread.
    • Shared rules: both directions share one safety check and the existing detach-after-commit, and the next turn starts in the main checkout.
    • Behavior change: t3_worktree_handoff is now refused when an unfinished run has no live session to detach, for example a stale run left after a restart.
    • Review: Opus said ship; its follow-up cleanups are applied. 139 focused tests pass.
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

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions