Repository navigation
feat(models): expose model capabilities in the catalog - #2281
Merged
Merged
Conversation
…ude and Codex discovery
…model capabilities
…m the provider-scoped catalog Settings showed the reasoning row from declared levels but built its options from a second lookup with Copilot and Claude fallbacks that could no longer render. Both now read getReasoningLevels. The Devin model switch reads findProviderModel, and the unscoped getModelReasoningLevels, getModelDefaultReasoningLevel, getCodex* and isXhighModel helpers are deleted.
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.
What
Closes #2225. Part of #1813.
Before this change, the composer and Settings decided Fast mode, the 1M context window, and reasoning levels with provider checks and model-name rules. Now each provider model declares those capabilities in the catalog, and the UI reads them.
Where the values come from:
model/listreportsserviceTiers. A model supports Fast when that list containspriority. When the field is absent, the static row decides. Every static Codex row declares Fast.["200k", "1m"]. Models from the Anthropic REST list get reasoning levels from the shared effort rules, then merge with the static row. No Claude row declares Fast yet. MPE-03 (feat(MPE-03): Claude Fast mode adapter #2229) adds it.toModelDefinitionis the one mapper from contract row toModelDefinition.findProviderModel(providerId, modelId)andgetReasoningLevels(providerId, modelId)replace the unscoped helpers, which are deleted.Verified with targeted Vitest runs in contracts, providers, and web, plus
bun run typecheckandbun run lint(0 errors).Why
Provider quirks belong in adapters. Each new capability or model previously meant another branch in the composer, Settings, and the registry. With the capability on the model row, MPE-02 (Fast for every provider) and MPE-03 (Claude Fast) only change data in the adapters.
Two behaviour changes follow from reading declared levels:
PROVIDERS_WITHOUT_REASONING_LEVELS, so declared levels were hidden.UI Changes
Parity captures on the fixture runtime, main against this branch. All four before and after pairs are byte-identical (same SHA-256). The 1M pill on Sonnet 4.6 and the Fast bolt on Codex now come from the new fields. The Copilot change needs a live Copilot CLI that declares levels, so it is covered by tests, not a capture.
Composer, Claude Sonnet 4.6, before and after:
Composer, Codex GPT-6 Luna, before and after:
Review Notes
Door: two-way. The new contract fields are optional, and a revert restores the old checks. No migration.
Blast radius: model controls. A wrong capability row would show or hide Fast, 1M, or a reasoning level for one model.
supportedModels()on SDK 0.3.291 takes about 1.3 s because it spawns the CLI (measured). It reports Fast for Opus 5.5, Opus 5, and Opus 4.8, effort levels identical to the static rows, and no 1M field. The static rows give the same data without the spawn. MPE-03 adds Claude Fast.model/listreportsserviceTiers: [{ id: "priority", name: "Fast" }]for every visible model (measured).codexFastModekeeps its name. MPE-02 renames it and adds Fast for other providers.Need help on this PR? Tag
@codesmith-botwith what you need.