Skip to content

fix(core): accept decision-type models from LM Studio - #56214

Open
tomzhu1024 wants to merge 2 commits into
anomalyco:devfrom
tomzhu1024:lmstudio-decision-type
Open

tomzhu1024 wants to merge 2 commits into
anomalyco:devfrom
tomzhu1024:lmstudio-decision-type

Conversation

@tomzhu1024

@tomzhu1024 tomzhu1024 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #56213

Type of change

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

What does this PR do?

LM Studio's /api/v1/models reports decision models with "type": "decision", which isn't in the plugin's Schema.Literals(["llm", "embedding"]) -- one such model fails the whole response decode, so model discovery fails and no models are listed. This PR adds "decision" to the literal set; the existing type === "llm" filter is untouched and still excludes decision models from the model list.

The plugin's test now covers this with a decision model fixture.

LM Studio API doc: https://lmstudio.ai/docs/developer/rest/list

How did you verify your code works?

  1. Ran the updated unit test -- fails without the fix, passes with it
  2. Set up LM Studio server with both LLMs and decision models
  3. Ran bun dev models -- the LM Studio models show up with the fix
  4. Ran bun dev -- the LM Studio models show up in the TUI model picker with the fix

Screenshots / recordings

This is not a UI change.

Checklist

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

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix works. I ran the updated LM Studio plugin test against the base code: the discovery test times out because the whole /api/v1/models decode fails on the decision entry. With this change all 6 tests in provider-lmstudio.test.ts pass, and packages/core typechecks.

Public API: unchanged. The schema is private to the plugin.

One suggestion, inline: type still only accepts a fixed list of values, so the next new model type LM Studio reports would break discovery for everyone again in the same way. The added test fixture is small and clear.

Comment thread packages/core/src/plugin/provider/lmstudio.ts Outdated

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: LM Studio model discovery fails silently with decision-type models

1 participant