Repository navigation
Let an agent attach its current thread to an existing worktree, preserving the chat #37652
Replies: 3 comments
|
Same need here. We use worktrunk ( Today an agent cannot do it: |
|
+1 — we just hit a sharper version of this when switching providers mid-thread on A thread started at the project root on Claude, which created a linked worktree via shell Having Authored by Gemini 4 Neon (Antigravity, T3 Code); reviewed by Claude Opus 5.5 (Claude Code) and GPT-6.2 Sol (Codex). |
|
Definitely seems like a missing piece I've come up against this working on a large multi-repo project. It's a pain. Might be worth just opening a PR with the proposed solution? |
Uh oh!
There was an error while loading. Please reload this page.
The branch picker can already move an existing chat onto an existing worktree while preserving its history. The exposed MCP tools cannot currently do the same:
t3_thread_updateexcludes workspace and branch changes.t3_worktree_handoffmoves the current thread but creates a new branch/worktree.t3_thread_launchwithexisting_worktreeuses the correct checkout but creates a new chat.Could
t3_worktree_handoffaccept an existing-worktree destination? It should validate that the checkout belongs to the current project, preserve the thread identity/history, and safely end/resume the provider session there. It should neither switch the shared root checkout nor create another branch or chat.Concrete case
In an existing project thread, coding happened in a separate existing Git worktree, but T3 still assigned the thread to
mainwithworktreePath: null. Changing the agent's shell working directory did not update that assignment. Manually selecting the existing worktree fixed it, andt3_worktree_statusthen confirmedattached: truewith the correct branch/path. I would like the agent to perform that same assignment directly next time.Suggested scope
Same project, same environment, existing checkout. Validate the canonical worktree path and derive its actual branch; apply the existing permissions and concurrent-update guards; preserve the chat while safely ending the live provider session and optionally queuing a continuation. Do not create/delete checkouts or run setup scripts by default. Account for other threads sharing the checkout.
The underlying
thread.metadata.updatecommand already carriesbranch,worktreePath,expectedBranchandexpectedWorktreePath, and the web branch picker uses the metadata-update path. This looks like a missing agent-facing operation rather than a missing manual capability.Checked against the exposed tools on server 0.1.9 and the relevant source at nightly
v0.1.10-nightly.20261116.4774and upstream maind427894aa1d170ce0222fe005723f5e91419916bon 16 November 2026.Related requests
Would this narrow extension be a welcome direction before a PR is prepared?
Drafted and posted with Codex (gpt-6.1-sol) in T3 Code on my behalf.
All reactions