Skip to content

fix(core): expose model reasoning capability - #50283

Open
zhengkaics wants to merge 1 commit into
anomalyco:devfrom
zhengkaics:model-reasoning-capability
Open

zhengkaics wants to merge 1 commit into
anomalyco:devfrom
zhengkaics:model-reasoning-capability

Conversation

@zhengkaics

Copy link
Copy Markdown

Issue for this PR

Closes #50257

Type of change

  • Bug fix

What does this PR do?

The models.dev catalog carries a reasoning flag for every model, but it is dropped when V2 model capabilities are built, and the app-side mapper hardcodes reasoning: false. That is why the model picker tooltip always shows "No reasoning", even for reasoning models.

This carries the flag through the chain:

  • packages/schema: optional reasoning on Model.Capabilities
  • models-dev plugin: populate it from the catalog entry
  • config provider plugin: preserve it when user config overrides capabilities (explicit reasoning in config still wins)
  • app global-sync mapper: map capabilities.reasoning into the app model store instead of hardcoding false
  • regenerate client and sdk v2 types, and refresh the vendored @opencode-ai/client snapshot (type-only: adds reasoning?: boolean) so the app typecheck sees the field

The tooltip component already reads model.capabilities.reasoning, so no UI code changes. Keeping the schema field optional means existing serialized catalog data and user capabilities config without reasoning still validate.

How did you verify your code works?

  • Extended packages/app/src/context/global-sync/utils.test.ts: a catalog model with reasoning: true maps to app capabilities.reasoning: true, a model without the field maps to false. 7/7 pass.
  • bun run typecheck passes for schema, core, client and app; the full monorepo typecheck runs in the pre-push hook and passed.
  • bun run generate (client) and packages/sdk/js/script/build.ts reproduce the committed one-line type diffs; prettier check clean.
  • I did not run the desktop app; the tooltip branch is untouched, it just now receives the real value instead of a hardcoded false.

Screenshots / recordings

Not included — the tooltip rendering itself is unchanged; only the value it receives is fixed.

Checklist

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

The models.dev catalog carries a `reasoning` flag for every model, but
it was dropped when building V2 model capabilities, so the desktop model
picker tooltip always showed "No reasoning".

Carry the flag through the chain:

- schema: add optional `reasoning` to `Model.Capabilities`
- models-dev plugin: populate it from the catalog entry
- config provider plugin: preserve it when user config overrides
  capabilities (and allow explicit override)
- app global-sync mapper: map `capabilities.reasoning` into the app
  model store instead of hardcoding `false`
- regenerate client types and refresh the vendored client snapshot so
  the app typecheck sees the new optional field

The tooltip itself already reads `model.capabilities.reasoning` and
needs no change.
@github-actions

Copy link
Copy Markdown
Contributor

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

@zhengkaics

Copy link
Copy Markdown
Author

Gentle ping — this has been open for a few days waiting for a first review.

It's a small change (9 files, +25/−5): the reasoning flag from the models.dev catalog is dropped when building V2 Model.Capabilities, and the desktop mapper hardcodes reasoning: false, so reasoning-capable models show as unsupported in the tooltip (#50257). This PR threads the flag from the catalog through to the app store; no UI changes needed.

All checks are green. Happy to adjust anything that doesn't match the repo's expectations.

@zhengkaics

Copy link
Copy Markdown
Author

Another gentle nudge — this has been open for about a week now without a first review. It is also the fix this repo points to: #50279 was closed as a duplicate of #50257 with "fix in review: #50283", and #50257 is still waiting on it. The diff is small (9 files, +25/−5) and all checks are green. Happy to adjust anything needed to move it forward.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: model picker shows "No reasoning" for all V2 models — capabilities.reasoning is never set

1 participant