fix(variants): normalize enum keys and drop 'none' for provider parity#48
Merged
Conversation
Cursor GPT models expose a 'none' reasoning value (reasoning OFF) and label the top tier 'extra-high'. Standard opencode providers (models.dev) use 'xhigh' for that tier and treat 'none' as the implicit default, not a selectable level. The cycler therefore showed 'none' and 'extra-high' as variant keys, breaking parity with how the same models appear under other providers. Skip 'none' in the enum reasoning branch — it's the model default (no variant selected). Alias 'extra-high' to 'xhigh' for the variant KEY so the picker label matches the standard; the param VALUE sent to Cursor's API stays 'extra-high' (wire format unchanged). The collision-prefix guard now uses the display key. Tests: extra-high→xhigh rename, none dropped, realistic GPT shape (none+extra-high+fast composition), and an extra-high/xhigh collision guard.
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.
Problem
Surveyed all 29 models in the real Cursor catalog (cached model discovery) and compared variant output against models.dev standard providers. Two mapping inconsistencies found on GPT models:
extra-highxhighnonesurfaced as a selectable variantnone= implicit default (no variant selected)Fix
buildModelVariantsenum reasoning branch (src/model-variants.ts):none—none= reasoning OFF = the model's default when no variant is selected. Surfacing it as a selectable entry is meaningless; it's dropped from the enum loop.extra-high→xhigh— the variant KEY normalizes toxhighso the cycler label matches standard providers. The param VALUE sent to Cursor's API staysextra-high(Cursor's wire format, unchanged). Collision-prefix logic now uses the display key.Behavior matrix (after fix)
Out of scope
thinkingmodels (no effort enum on Cursor; only reasoning control available) — unchangedfasttoggle placement (UX/categorization concern, not a mapping bug) — unchangedcontextenum (intentionally unsupported; consistent with models.dev) — unchangedTests
4 new tests in
test/model-variants.test.ts:extra-high→xhighrename (key normalizes, wire value preserved)nonedropped from reasoning enumreasoning=[none,low,medium,high,extra-high]+fast→low, medium, high, xhigh, fastwithfast:falsebaked ineffort=xhigh+reasoning=extra-high→ second prefixedreasoning-xhighVerification
npx vitest run→ 194 passed (18 files) (+4)npx tsc --noEmit→ exit 0xhigh(notextra-high) and nonone; Claude and boolean-only models unchanged