Skip to content

fix(core): strip trailing slash from parsed model IDs - #43490

Open
12britz wants to merge 1 commit into
anomalyco:devfrom
12britz:fix/trailing-slash-model-name
Open

fix(core): strip trailing slash from parsed model IDs#43490
12britz wants to merge 1 commit into
anomalyco:devfrom
12britz:fix/trailing-slash-model-name

Conversation

@12britz

@12britz 12britz commented Aug 19, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #43473

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When a model string like lmstudio/qwen3-4b/ is parsed by ModelV2.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 in packages/core/src/model.ts.

How did you verify your code works?

  • Traced the bug from the issue report through ModelV2.parse to the catalog lookup in SessionRunnerModel.resolve
  • The fix only affects the parse function which is the single entry point for provider/model string parsing
  • No existing behavior is changed for well-formed model strings (no trailing slash)

Screenshots / recordings

N/A — backend fix, no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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>
@AndyS77

AndyS77 commented Aug 19, 2026

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model name not resolved due to trailing slash

2 participants