fix(core): strip trailing slash from parsed model IDs - #43490
Open
12britz wants to merge 1 commit into
Open
Conversation
ModelV2.parse splits on "/" to extract provider and model IDs. When the input has a trailing slash (e.g. "lmstudio/qwen3-4b/"), the join produces "qwen3-4b/" which then fails to match any catalog entry. Strip trailing slashes after joining so "lmstudio/qwen3-4b/" resolves to model ID "qwen3-4b" as expected. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
6 tasks
|
Hi @12britz — looks like we were working on the same bug (#43473) at the same time! I opened #43492 which covers the same fix in \core/model.ts\ plus the other four parse functions that had the same issue (\provider.ts parseModel, \ ui/util/model.ts parse, \cli/cmd/run.ts pick, \�cp/config-option.ts parseModelSelection). Happy to consolidate — let me know if you'''d like to close this in favor of #43492 or vice versa. |
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.
Issue for this PR
Closes #43473
Type of change
What does this PR do?
When a model string like
lmstudio/qwen3-4b/is parsed byModelV2.parse, the trailing slash causes the model ID to be stored as"qwen3-4b/"instead of"qwen3-4b". This means the catalog lookup fails because no model matches the trailing-slash ID.The fix strips trailing slashes from the joined model ID portion after splitting on
/. This is a one-line change inpackages/core/src/model.ts.How did you verify your code works?
ModelV2.parseto the catalog lookup inSessionRunnerModel.resolveparsefunction which is the single entry point forprovider/modelstring parsingScreenshots / recordings
N/A — backend fix, no UI change.
Checklist