Repository navigation
Conversation
A configured model reference like "provider/model#variant" kept the "#variant" suffix inside the model id, so the selection never resolved and agents/commands silently ran on an inherited or default model. Split the embedded variant off in ModelV2.parse and let it win over a separate variant field, matching native selection semantics. Fixes anomalyco#50849
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
This was referenced Sep 23, 2026
Contributor
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
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.
Configured model references like
model: provider/model#variantkept the#variantsuffix inside the model id (ModelV2.parseonly splits on/), so agents, commands, and the default model silently resolved to nothing and fell back to an inherited/default model. The legacy v1 migration path dropped these refs entirely before the recent refactor.This splits the embedded variant off in
ModelV2.parseand applies it at the agent/command call sites, where an embedded variant wins over a separatevariant:field (matching the semantics of the previous nativeModel.Ref.parse).Fixes #50849 (root cause, repro, and session-level evidence there).
Validation: new tests in
test/model.test.tsandtest/config/agent.test.tsfail without the fix and pass with it;test/config/,test/model.test.ts, andtest/tool-subagent.test.tsare green (58 tests) andtsgo --noEmitis clean.Related: #47413 covers the separate
variant:field case (fixed by f1eed8b); this PR handles the embeddedmodel: provider/model#variantcase, which is still broken on dev.