Skip to content

refactor(shared): share model-selection command choice - #10577

Merged
juliusmarminge merged 1 commit into
t3code/codex-turn-mappingfrom
agents/mcp-shared/model-selection
Sep 7, 2026
Merged

refactor(shared): share model-selection command choice#10577
juliusmarminge merged 1 commit into
t3code/codex-turn-mappingfrom
agents/mcp-shared/model-selection

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 7, 2026

Copy link
Copy Markdown
Member

Part 1/16 of the shared-core and MCP stack. Based on t3code/codex-turn-mapping at 415ed0f73b97f1655b6282492f81d0b2bba3a9cc. Next: #10578.

The client and MCP must choose the same command when changing a thread's model. This extracts modelSelectionCommandType into the existing shared model module and makes client-runtime use it. The MCP consumer follows in its own layer.

Same provider instance uses thread.model-selection.set; a different instance uses provider.switch. The current provider instance is authoritative; changing a model name alone does not switch providers. No new provider policy or command behavior.

Validation: Existing client command and shared model suites: 25 tests passed. Client-runtime/shared typechecks passed. The client regression observes the actual command for same-provider and different-provider changes.

Layer size: 3 files, +31/-5. No MCP tools are introduced in this prerequisite.

Prepared with Codex in the OpenAI agent runtime.

Note

Extract shared modelSelectionCommandType helper for thread model selection

  • Extracts the provider instance comparison logic from updateThreadMetadata into a shared modelSelectionCommandType helper in model.ts
  • The helper returns thread.model-selection.set when the current and selected provider instance IDs match, and provider.switch when they differ
  • Updates tests in commands.test.ts to verify command selection based on provider instance, adding a same-provider case

Macroscope summarized a645d4e.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 7, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a645d4e

Macroscope's review found this PR approvable — This is a small, behavior-preserving refactor that centralizes the existing provider-instance comparison and adds coverage for both command-selection branches. The production impact is limited to calling an equivalent pure helper, with no defaults, schemas, or deployment behavior changed.

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

@juliusmarminge juliusmarminge changed the title refactor: share model-selection command choice refactor(shared): share model-selection command choice Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

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

This comment will update automatically after the next completed run.

@juliusmarminge
juliusmarminge merged commit 3b0999f into t3code/codex-turn-mapping Sep 7, 2026
22 checks passed
@juliusmarminge
juliusmarminge deleted the agents/mcp-shared/model-selection branch September 7, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 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