Skip to content

feat(mcp): configure existing conversations - #8695

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

feat(mcp): configure existing conversations#8695
juliusmarminge wants to merge 6 commits into
t3code/codex-turn-mappingfrom
agents/mcp-conversations/configuration

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 29, 2026

Copy link
Copy Markdown
Member

Problem

Agents could inspect thread activity but could not discover or change an existing thread's provider, model options, runtime mode, or interaction mode through the built-in MCP server.

Change

Add current-project t3_thread_configuration and t3_thread_configure tools backed by a focused service, existing V2 commands, provider-switch planning, typed receipts, provider capability discovery, and caller permission ceilings.

Behavior

All requested fields are validated before the first new command. Omitted fields retain committed values except that a provider-only change selects that provider's default model; omitted options are otherwise preserved, an explicit empty list clears them, and provider or model changes never inherit incompatible options. Durable accepted and rejected command legs replay under the same client request ID; resolving a rejected leg requires a new ID. Results separate committed settings from requested detach/restart and next-turn handoff effects.

Focused validation

  • 18 contract, root-schema, service, production MCP, and real V2/provider-adapter behavior tests
  • durable no-op/replay, cross-provider retry, concurrent selection, and caller-downgrade race coverage
  • vp run --filter t3 typecheck
  • vp run --filter @t3tools/contracts typecheck
  • targeted formatting and git diff --check

Dependency

Standalone PR based on t3code/codex-turn-mapping at the pinned rollout target. It is not a member of a native GitHub stack.

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

Note

Add t3_thread_configuration and t3_thread_configure MCP tools for existing conversations

  • Adds ConversationConfigurationMcpService with read and configure operations that let MCP callers inspect and change a thread's provider/model selection, runtime mode, and interaction mode
  • Registers t3_thread_configuration (read-only, idempotent) and t3_thread_configure (destructive) tools in the orchestrator toolkit, with handlers delegating to the new service
  • Adds contracts in conversationControlMcp.ts covering configuration inputs/outputs, option omission vs. empty array, durable command receipts, change behaviors, and retry guidance
  • Extends OrchestrationV2Command variants with optional policy ceilings and expected-selection guards; the orchestrator now loads the caller thread, enforces mode ceilings, rejects stale partial selections, and dispatches policy-bounded commands under nested caller+target thread locks
  • Retried requests with the same clientRequestId replay accepted or rejected durable receipts instead of re-dispatching; mode reductions below the caller's ceiling are prioritized over other pending changes
  • Fix: EventSink now assigns the thread's latest sequence to command receipts for accepted commands that produce no events, instead of failing
  • Risk: policy-bounded configuration dispatches in makeOrchestrator now acquire nested locks over sorted caller+target thread IDs via dispatchLockKeys; commands without a caller thread still use the single target lock, but any deadlock-prone lock ordering assumptions should be reviewed there

Macroscope summarized 26d25cb.

@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: 212790f6-9bb3-4d5a-bb1d-2021f1442f39

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:XL 500-999 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 of the new ConversationConfigurationMcpService and its touched call sites. One convention violation found; dependency acquisition (yield* ThreadManagementService / ProviderRegistry / ProviderSwitchServiceV2), the make + layer pair, and the absence of ManagedRuntime/runPromise in the service all look correct.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.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 26d25cb.

This comment will update automatically after the next completed run.

Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts
Comment thread docs/user/agent-conversation-controls.md Outdated
Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts Outdated
Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts Outdated
@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 controls that can change conversation providers, models, runtime policies, and interaction modes, including effects such as provider-session detachment. It also modifies shared orchestration locking, policy enforcement, and durable receipt behavior, making human review appropriate.

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

Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/configuration branch from 8d7d617 to 31ec462 Compare August 29, 2026 23:36
Comment thread docs/user/agent-conversation-controls.md Outdated
Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts
Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/configuration branch 2 times, most recently from 414c5da to febe089 Compare August 30, 2026 00:07
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from 490318a to 373612e Compare August 30, 2026 00:13
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/configuration branch from febe089 to 94b0c58 Compare August 30, 2026 00:23
@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
Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/configuration branch from 94b0c58 to e101aad Compare August 30, 2026 00:41

@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.

UI Consistency: 1 issue found

ChatMarkdown is a shared renderer used by chat threads, review annotations, and the pull request panel. At this head it resolves the environment for its editor RPC and capability read from the globally active environment instead of the markdown's own scope, and the explicit environmentId prop that let non-thread call sites supply that scope was removed. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/pullRequest/PullRequestMarkdown.tsx Outdated
Comment thread apps/web/src/components/ChatMarkdown.tsx Outdated
Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts
@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.91, 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 280.58KB $14.03
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
Comment thread packages/contracts/src/orchestrationV2.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/configuration branch 2 times, most recently from 81cd33d to 862c5b2 Compare August 30, 2026 17:10
@juliusmarminge
juliusmarminge changed the base branch from agents/mcp-controls/base-490318a to t3code/codex-turn-mapping August 30, 2026 17:10
Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts

@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 high 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 363abe5. Configure here.

Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from c01ff20 to 9d2539a Compare August 30, 2026 19:57
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/configuration branch from bde0cf4 to 8c07d91 Compare August 30, 2026 20:12
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 8 times, most recently from b82facd to 2ac9bfe Compare September 5, 2026 04:56
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/configuration branch from 8c07d91 to f17cd6b Compare September 5, 2026 06:03
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-conversations/configuration branch from f17cd6b to 8310b79 Compare September 7, 2026 18:23
Comment thread apps/server/src/mcp/ConversationConfigurationMcpService.ts Outdated
@juliusmarminge

Copy link
Copy Markdown
Member Author

Superseded as the active MCP proposal by #10557 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. This intentionally limits writes to the caller. Permission-mode changes, cross-thread configuration and multi-command retry transactions are separate work. Provider/model discovery already exists in orchestrator_capabilities.

Closing this mixed proposal without merging. The remote branch agents/mcp-conversations/configuration and exact head 26d25cba6e28d34bd0139f25e29cb9d48ebdd1ba 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:XXL 1,000+ 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