cursor 0.2.26: a picker model whose usable id is its other family goes as that id

ysm119 on Discord, after 0.2.25: claude-haiku-5-5-thinking still failed
its Test with no answer. A Team account's picker can have Claude Haiku 5.5
with thinking as its default, while cursor-agent models lists Haiku only
as claude-haiku-5-5 (no thinking). modelsOf looked up the usable ids of
the default's family alone, found none, and every Haiku id went out as a
picker variant (claude-haiku-5-5-thinking-high, -low, ...) the account
doesn't have. modelsOf now falls back to the same model's family with
thinking or without it, so each variant id goes as the id the account
lists.

Run: bun test packages/cursor (311 pass, 0 fail) and
bun scripts/check.mjs cursor (ok), in a sandbox HOME.
Broken by hand: with the fam lookup back to the default's family only,
the new context.test.mjs test is red (17 pass, 1 fail).
Not tried: a real Team account whose list has Haiku without thinking;
the owner's Cursor account doesn't show this shape. The fixture is
built from the report's ids, not captured bytes.
This commit is contained in:
yetone
2026-10-27 17:06:02 +08:00
parent cb776e2ebb
commit df4dfcd8f7
4 changed files with 29 additions and 3 deletions
+4 -1
View File
@@ -210,7 +210,10 @@ minutes), the way pi-cursor-sdk lists Cursor's catalog:
them), fast the request's `service_tier`.
- An id for a model with thinking that the account lists only without it
(`claude-haiku-5-5-thinking` when the list has Claude Haiku 5.5 alone),
or the other way round, runs as the model the account has.
or the other way round, runs as the model the account has. So does a
picker model whose default thinks while the account lists it only
without thinking (`claude-haiku-5-5`), or the other way round: each of
its variant ids goes as the id the account lists.
- An `@<size>` id the list no longer has (`claude-opus-5-5@1m` when only
300k is listed, or the model is listed unsized) runs at the model's
nearest size, in Max Mode when the size asked for is over the model's
+16
View File
@@ -440,3 +440,19 @@ test("a picker model with thinking variants only takes an id 0.1.x listed withou
const raw = await usable(tok())
expect(request(raw, "claude-haiku-5-5-low", "", undefined).id).toBe("claude-haiku-5-5-thinking-low")
})
// ysm119 on Discord again, after 0.2.25: claude-haiku-5-5-thinking still
// failed its test. A Team account's picker can have Claude Haiku 5.5, its
// default with thinking, while cursor-agent models lists Haiku under one id
// of another family (claude-haiku-5-5, no thinking). The entry's family was
// its default's alone, which the account hasn't got, so every Haiku id went
// out as a picker variant Cursor answers "AI Model Not Found".
test("a picker model whose usable id is of its other family, with or without thinking, goes as that id", async () => {
const opus = OPUS55_USABLE.filter((m) => /-(medium|high)(-fast)?$/.test(m.modelId))
for (const haiku of [["claude-haiku-5-5"], ["claude-haiku-5-5-thinking"], ["claude-haiku-5-5-low", "claude-haiku-5-5-high"], ["claude-haiku-5-5-thinking-low"]]) {
fakeAPI(PICKER, [...opus, ...REST_USABLE, ...haiku])
const raw = await usable(tok())
for (const id of ["claude-haiku-5-5-thinking", "claude-haiku-5-5", "claude-haiku-5-5@300k", "claude-haiku-5-5@1m", "claude-haiku-5-5-thinking-high", "claude-haiku-5-5-low", "claude-haiku-5-5-thinking-low"])
for (const effort of ["", "none", "low", "medium", "high", "max"]) expect([haiku, id, effort, haiku.includes(request(raw, id, effort, undefined).id)]).toEqual([haiku, id, effort, true])
}
})
+8 -1
View File
@@ -827,7 +827,14 @@ function modelsOf(picker, ids, listed = []) {
const def = defaultVariant({ variants })
const { pid, levels: all } = effortsOf(defs)
const levels = Object.fromEntries(Object.entries(all).filter(([, value]) => has(pid, value)))
const fam = fams.get(familyOf(def?.legacySlug || m.name).family) ?? []
// the usable ids of its default's family, else of the same model with
// thinking or without it: a Team's picker can default Claude Haiku 5.5
// to thinking while cursor-agent lists it as claude-haiku-5-5 alone
// (ysm119 on Discord, after 0.2.25), and a variant id it lacks is then
// asked as that one, as named() takes such an id
const own = familyOf(def?.legacySlug || m.name).family
const bare = own.replace(/-thinking$/, "")
const fam = fams.get(own) ?? fams.get(bare) ?? fams.get(bare + "-thinking") ?? []
const base = { run: m.name, title: clean(m.clientDisplayName || m.name), pid, levels, fast: !!defs.fast?.length, variants, def, partial, model: m, fam, ids }
const contexts = (defs.context ?? []).filter((c) => has("context", c))
if (contexts.length) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@magpie-community/opencode-cursor-auth",
"version": "0.2.25",
"version": "0.2.26",
"description": "Cursor subscriptions (Pro, Pro+, Ultra, Teams) in OpenCode and magpie, through the API cursor-agent talks to",
"type": "module",
"main": "./index.mjs",