feat(mcp): expose thread model selection#10557

merged2
agents/mcp-thin/questions
agents/mcp-thin/configuration
openedSep 7, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 3d ago

Part 7/16 of the shared-core and MCP stack. Based on #10556. Next: #10558.

Read thread configuration and change the calling thread provider/model/options through existing selection and switch commands.

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.

The command choice is now shared with client-runtime through modelSelectionCommandType; MCP does not maintain a separate provider comparison.

MCP-only rebuild of #8695, preserving attribution to Julius Marminge's original work. Original branches remain available for separate service follow-ups.

Validation: The composed stack passes 94 tests across 12 focused files, including shared core MCP and real MCP/V2 integration, attachment intake, project RPC/service contracts, and client model command selection. Server/contracts/shared/client-runtime typechecks and targeted format/lint/diff checks pass. New behavior coverage lives with the shared operation; no per-tool mock suite was added. Current-head CI is shown below.

Layer size: 4 files, +59/-0. No domain-service production implementation or documentation files change in this MCP layer.

Prepared with Codex in the OpenAI agent runtime.

Note

Add t3_thread_configuration and t3_thread_configure MCP tools for thread model selection

  • Adds a read-only t3_thread_configuration tool that returns the calling thread's ID, model selection, runtime mode, and interaction mode
  • Adds a destructive t3_thread_configure tool that dispatches a model-selection command to the current writable thread without changing permission modes or other threads
  • Registers both tools in ThreadToolkit, adds t3_thread_configuration to the Claude read-only allowlist, and adds display-name entries in the T3 MCP presentation map
  • Risk: t3_thread_configure opens the current thread for writing and dispatches a command; callers that invoke it concurrently may interleave sequence numbers. Reviewers should check ThreadToolkitHandlersLive configure handler in handlers.ts for dispatch and error-mapping behavior

Macroscope summarized b0152bc.

Synced from GitHub

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds new MCP tools, including a mutating tool that changes the calling thread's model or provider and can invoke existing provider-switch orchestration. The implementation is localized, but the new MCP dispatch branches lack direct behavioral coverage, so the change warrants human review.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

No code changes detected at b0152bc. Prior analysis still applies.

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

Synced from GitHub

Thread transfer impact

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

This comment will update automatically after the next completed run.

apps/server/src/mcp/toolkits/thread/handlers.tslines 75–94Outdated · 5c8ac23Open thread
……@@ -60,6 +60,38 @@ const readQuestion = Effect.fn("mcp.readQuestion")(function* (
91+ })
92+ .pipe(Effect.mapError(unavailable));
93+ return { sequence: result.sequence };
94+ }),
MmacroscopeappBoton lines 75–94Sep 7, 2026

t3_thread_configure adds new mutating backend behavior with non-trivial branching — the same instanceId dispatches thread.model-selection.set, a different one dispatches provider.switch — and neither new tool has any behavioral test (toolkits/core.test.ts only walks the toolkit for unique names/JSON schema shape). Consider adding a focused test that drives both tools through the toolkit (as OrchestratorMcpToolkit.integration.test.ts does for t3_thread_organize), asserting the dispatched command type for the same-instance and cross-provider cases and that t3_thread_configuration reflects the resulting selection. Use test layers only for external services, not for the orchestrator command path itself.

Posted via Macroscope — Effect Service Conventions

Reviewed against the thin-wrapper scope requested by the maintainer. This handler selects one of the existing thread.model-selection.set/provider.switch commands; their execution and provider behavior stay in the already-tested orchestration services. The maintainer explicitly asked for shared MCP registration/scope/error tests rather than a separate behavior suite for every forwarding tool. No concrete incorrect command mapping was identified here. The core registration, capability, output and real MCP smoke tests cover the boundary; a new orchestration fixture for each selection branch would duplicate service coverage, so no source change is proposed.

The underlying commands are tested, but neither MCP-level branch is covered: t3_thread_configure has no direct toolkit/integration invocation. The requested focused test is specifically for the handler’s instanceId dispatch decision, so this remains applicable.

Added 2 commits

  • feat(mcp): expose current thread model selection0ebe252
  • refactor(mcp): reuse model-selection command choiceb0152bc
Synced from GitHub

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.