refactor(shared): share model-selection command choice - #10577
Merged
juliusmarminge merged 1 commit intoSep 7, 2026
Conversation
Contributor
ApprovabilityVerdict: Approved at 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. |
Contributor
Thread transfer impact
This comment will update automatically after the next completed run. |
juliusmarminge
added a commit
that referenced
this pull request
Sep 8, 2026
juliusmarminge
added a commit
that referenced
this pull request
Sep 8, 2026
juliusmarminge
added a commit
that referenced
this pull request
Sep 8, 2026
juliusmarminge
added a commit
that referenced
this pull request
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1/16 of the shared-core and MCP stack. Based on
t3code/codex-turn-mappingat415ed0f73b97f1655b6282492f81d0b2bba3a9cc. 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
modelSelectionCommandTypehelper for thread model selectionupdateThreadMetadatainto a sharedmodelSelectionCommandTypehelper in model.tsthread.model-selection.setwhen the current and selected provider instance IDs match, andprovider.switchwhen they differMacroscope summarized a645d4e.