# feat\(mcp\): fork existing conversations · PR \#8696 · pingdotgg/t3code

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

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

Visibility: public

State: closed

Source repository: pingdotgg/t3code

Source branch: agents/mcp-conversations/fork

Target branch: t3code/codex-turn-mapping

Head commit: 1ad23c2032b0aa1ce9a55e4d50ce73cd5f6fc20a

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

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

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

## Description

---

## Problem

Agents could create ordinary or delegated threads, but could not create a durable T3 conversation fork from a precise stable source or inspect its context-transfer provenance.

## Change

Add current-project `t3_thread_fork` and bounded `t3_thread_transfers` tools backed by a focused service and the existing `thread.fork` V2 command through `ThreadManagementService`.

## Behavior

Forks require a completed run, checkpoint, or latest stable source plus a retry key. Results return the committed transfer and receipt, inherited-permission enforcement, and truthful native-fork eligibility while leaving native or portable resolution to the first target turn. Derived target identities use a fork-specific namespace and cannot overwrite existing or soft-deleted threads.

## Focused validation

- transfer contract, service, root-schema, production MCP, and real V2/provider-adapter tests
- retry, inherited history, caller/source race, identity collision, occupied-target, and projection-failure coverage
- 5 focused files / 16 tests passed across the complete native stack
- server and contracts scoped typechecks, targeted formatting, and `git diff --check`

## Dependency

Bottom layer of native stack 8776, based on `t3code/codex-turn-mapping` at the pinned rollout target. [#8697](https://github.com/pingdotgg/t3code/pull/8697) consumes this transfer contract and service for merge-back.

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


<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. -->
> [!NOTE]
> ### Add MCP conversation fork and transfer list tools
> - Adds `ConversationTransferMcpService` exposing `t3_thread_transfers` for bounded read-only transfer listing and `t3_thread_fork` for conversation mutations.
> - `Orchestrator` `thread.fork` dispatch validates caller policy ceilings (runtime and interaction modes) and checks target projection existence before issuing fork commands.
> - Replaces the single command-thread lock with recursive multi-key dispatch locks (`withDispatchLocks`) so forks coordinate on source, target, and caller threads.
> - Contracts package adds `ConversationForkInput`, `ConversationForkResult`, and `TransferPageLimit` schemas with strict validation (e.g., Unicode well-formedness for retry keys).
> - Risk: `thread.fork` dispatch now fails when target projection exists or source runtime/interaction mode exceeds the caller ceiling; `withDispatchLocks` changes dispatch lock acquisition to multiple sorted keys.
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 1ad23c2.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- Macroscope's pull request summary ends here -->
