Skip to content

feat(mcp): fork existing conversations - #8696

Closed
juliusmarminge wants to merge 2 commits into
t3code/codex-turn-mappingfrom
agents/mcp-conversations/fork
Closed

feat(mcp): fork existing conversations#8696
juliusmarminge wants to merge 2 commits into
t3code/codex-turn-mappingfrom
agents/mcp-conversations/fork

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 29, 2026

Copy link
Copy Markdown
Member

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 consumes this transfer contract and service for merge-back.

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

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 summarized 1ad23c2.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f1504bd4-3f53-49c1-822c-a7e1bd9ac198

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 29, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effect service conventions review: one convention violation found in the new ConversationTransferMcpService module.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts Outdated
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 1ad23c2.

This comment will update automatically after the next completed run.

Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts
Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts
Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts Outdated
Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts Outdated
Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts
Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts
@macroscopeapp

macroscopeapp Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds production MCP tools that create durable conversation forks and context-transfer records, with new provider-resolution behavior and shared orchestration locking and permission enforcement. Its new user-facing workflow and cross-cutting runtime changes warrant human review.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/fork branch from b268728 to 99b0ed2 Compare August 29, 2026 23:42
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Aug 29, 2026
Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/fork branch from 99b0ed2 to b3772e6 Compare August 30, 2026 00:01
Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/fork branch from b3772e6 to 125913a Compare August 30, 2026 00:26
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Aug 30, 2026
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/fork branch from 125913a to d55ea91 Compare August 30, 2026 00:38
@macroscopeapp

macroscopeapp Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Macroscope skipped reviewing this pull request. Per-review cost limit exceeded (workspace setting).

This review would cost an estimated $246.19, which exceeds your per-review limit of $10.00.

The top 3 files driving up this estimate:

File Diff Size Estimate
apps/server/src/orchestration-v2/Orchestrator.ts 279.68KB $13.98
apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts 271.74KB $13.59
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts 215.40KB $10.77

Tip

To get this pull request reviewed, you can:

  1. Comment @macroscope-app on this PR to request a manual review (monthly spend limits still apply).
  2. Exclude the file(s) above from review by adding a pattern to your .macroscope/ignore.md — note that creating this file replaces Macroscope's built-in default ignores rather than extending them.
  3. Raise your cost limit in your workspace billing settings.

Turn off this reminder going forward

@juliusmarminge
juliusmarminge changed the base branch from t3code/codex-turn-mapping to agents/mcp-controls/base-490318a August 30, 2026 00:51

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One convention issue found: a new single-tag Effect.catchTag in Orchestrator.ts. The rest of the new ConversationTransferMcpService module (inline Context.Service interface, environment-acquired ThreadManagementService, exported make/layer, namespace imports of Effect modules) matches the conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/orchestration-v2/Orchestrator.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/fork branch from d55ea91 to ef0aa12 Compare August 30, 2026 01:20
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Aug 30, 2026
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/fork branch from ef0aa12 to eced912 Compare August 30, 2026 17:15
@juliusmarminge
juliusmarminge changed the base branch from agents/mcp-controls/base-490318a to t3code/codex-turn-mapping August 30, 2026 17:15
@github-actions github-actions Bot added the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Aug 30, 2026
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/fork branch from eced912 to 7577ec0 Compare August 30, 2026 20:12
@github-actions github-actions Bot removed the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Aug 30, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts
Comment thread packages/contracts/src/conversationTransferMcp.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/fork branch from 9fb7083 to 6f3e626 Compare September 5, 2026 06:05

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but a cloud agent failed to start.

Reviewed by Cursor Bugbot for commit 6f3e626. Configure here.

Comment thread apps/server/src/mcp/ConversationTransferMcpService.ts
@juliusmarminge

Copy link
Copy Markdown
Member Author

Superseded as the active MCP proposal by #10558 in the rebuilt MCP stack, following the maintainer request to review thin service wrappers separately from service hardening.

This is not a full feature-parity replacement. Each invocation generates a new command. No additional clientRequestId protocol, transfer journal or provider implementation. Merge targets remain in the calling project.

Closing this mixed proposal without merging. The remote branch agents/mcp-conversations/fork and exact head 1ad23c2032b0aa1ce9a55e4d50ce73cd5f6fc20a are retained so the service changes can be extracted for separate review later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant