fix(core): expose model reasoning capability - #50283
zhengkaics wants to merge 1 commit into
Conversation
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.
|
The following comment was made by an LLM, it may be inaccurate: |
|
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 All checks are green. Happy to adjust anything that doesn't match the repo's expectations. |
|
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. |
Issue for this PR
Closes #50257
Type of change
What does this PR do?
The models.dev catalog carries a
reasoningflag for every model, but it is dropped when V2 model capabilities are built, and the app-side mapper hardcodesreasoning: 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: optionalreasoningonModel.Capabilitiescapabilities(explicitreasoningin config still wins)capabilities.reasoninginto the app model store instead of hardcodingfalse@opencode-ai/clientsnapshot (type-only: addsreasoning?: boolean) so the app typecheck sees the fieldThe tooltip component already reads
model.capabilities.reasoning, so no UI code changes. Keeping the schema field optional means existing serialized catalog data and usercapabilitiesconfig withoutreasoningstill validate.How did you verify your code works?
packages/app/src/context/global-sync/utils.test.ts: a catalog model withreasoning: truemaps to appcapabilities.reasoning: true, a model without the field maps tofalse. 7/7 pass.bun run typecheckpasses for schema, core, client and app; the full monorepo typecheck runs in the pre-push hook and passed.bun run generate(client) andpackages/sdk/js/script/build.tsreproduce the committed one-line type diffs; prettier check clean.false.Screenshots / recordings
Not included — the tooltip rendering itself is unchanged; only the value it receives is fixed.
Checklist