# feat\(mcp\): let agents change thread workspaces · PR \#8680 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/8680)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: closed

Source repository: pingdotgg/t3code

Source branch: agents/mcp-workspaces/checkout

Target branch: agents/mcp-workspaces/inventory

Head commit: 84f260db922bef1a7b54624c2e2f9bc6805f8094

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/8680)

[Commits](https://git.cafe/pingdotgg/t3code/pull/8680/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/8680/diffs?format=markdown)

## Description

---

Agents need a safe way to move an existing thread to a branch, project root, existing checkout, or new worktree while keeping durable thread metadata aligned with actual Git state.

This dependent layer adds `t3_thread_checkout` over the existing VCS, V2 command, provider-session, and continuation workflows. It verifies requested refs, canonical repository/worktree identity, dirty state, active and shared ownership, and the final checked-out state before committing the binding. Physical workspace admission covers aliases and nested project roots. New-worktree handoff rechecks ownership after creation and retains any checkout whose cleanup ownership becomes uncertain.

Pre-mutation reads remain cancellable. Once mutation starts, the narrow Git/binding/rollback section preserves atomicity and truthful partial-failure outcomes. A successful move ends the current provider turn; `continuationPrompt` schedules the replacement turn in the selected workspace. Status broadcasting is refreshed after committed changes without allowing refresh failure to rewrite the completed result.

Focused validation:

- 314 tests across the combined inventory/checkout stack, including real Git ref handling, cancellation, concurrent ownership, rollback retention, provider detach/continuation, contracts, registration, and presentation
- `vp run --filter t3 typecheck`
- `vp run --filter @t3tools/contracts typecheck`
- `vp run --filter @t3tools/shared typecheck`
- `vp run --filter @t3tools/client-runtime typecheck`
- Targeted `vp lint`, `vp fmt --check`, and `git diff --check`

Depends on [#8685](https://github.com/pingdotgg/t3code/pull/8685) for canonical bounded workspace discovery. Native stack: [#8685](https://github.com/pingdotgg/t3code/pull/8685) → [#8680](https://github.com/pingdotgg/t3code/pull/8680), rooted on `t3code/codex-turn-mapping` at `415ed0f73b97f1655b6282492f81d0b2bba3a9cc`.

Implemented by GPT-5.6-Sol via Codex in T3 Code.

