cursor: picks keep Cursor's own ids, and the plugin's min is 0.2.24
ysm119 on Discord (Cursor Team account, Claude Code): claude-opus-5-5@1m
and claude-opus-5-5 failed with Cursor's "AI Model Not Found", and a
picked claude-opus-5-5-low was shown and sent as claude-opus-5-5.
- cursorPicks, CursorBase and CursorVariants folded Cursor's ids into
families by the list the retired built-in left in the cache
(catalog.Live("cursor"), a stale `cursor-agent models` dump), so a
pick of claude-opus-5-5-low became claude-opus-5-5, which the plugin
then sent as is. While the plugin serves Cursor (always, since the
built-in is retired) they now read no list: a pick stays the id picked,
and the start-up MoveCursorEfforts leaves agents' ids alone.
- The mover's min is 0.2.24 (npm view --prefer-online: 0.2.24), which
lists a family the account's picker lacks once with its efforts and
sends the usable id the effort picks, and runs a stale @size id at the
nearest size (magpie-community/plugins fc2866f).
Run at 353519f55 + this change:
- gofmt -l internal clean; go vet -tags nogui provider and agent on
darwin, GOOS=linux, GOOS=windows clean; go build -tags nogui ./... on
all three.
- go test -tags nogui ./internal/catalog ok; ./internal/provider ok but
for TestUnreadLoginsWriteErrorsKeepCredentials (skipped, synctest
crash on main, #3632) and three TestFetch* tests red on main since
6eb510f78 without this change (#3854); -run 'Cursor|Effort|Legacy' in
internal/agent and internal/gateway ok.
- Broken by hand: with the guard turned off,
TestCursorPicksKeptWhenPluginServes fails exactly as reported
(picks = [claude-opus-5-5], CursorBase "claude-opus-5-5" "low").
Not run: the full suite (two other sessions' suites were running on the
machine, one per machine); a real Team account; magpie end to end with
Claude Code. The plugin side was run against a real Cursor account (see
plugins fc2866f).
This commit is contained in:
@@ -209,11 +209,26 @@ func withoutCursorCapacity(ms []catalog.Model) []catalog.Model {
|
||||
return out
|
||||
}
|
||||
|
||||
// builtinCursorList is the list the built-in fetched from `cursor-agent
|
||||
// models`, while the built-in serves Cursor. Once the plugin does (the
|
||||
// built-in is retired), what is left of that list is a stale cache: the
|
||||
// plugin lists its own ids and maps a family and effort to a real one
|
||||
// itself. Folding the user's claude-opus-5-5-low into claude-opus-5-5 by
|
||||
// the stale list showed a pick the plugin then sent as a model Cursor
|
||||
// doesn't know (ysm119, "AI Model Not Found").
|
||||
func builtinCursorList() ([]catalog.Model, bool) {
|
||||
if PluginServes("cursor") {
|
||||
return nil, false
|
||||
}
|
||||
raw, _, ok := catalog.Live("cursor")
|
||||
return raw, ok
|
||||
}
|
||||
|
||||
// CursorVariants are Cursor's ids a model magpie offers stands for, by
|
||||
// effort, "" the default; ok is false for a model that stands for none,
|
||||
// which goes to Cursor as it is.
|
||||
func CursorVariants(model string) (map[string]string, bool) {
|
||||
raw, _, ok := catalog.Live("cursor")
|
||||
raw, ok := builtinCursorList()
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
@@ -235,7 +250,7 @@ func cursorVariantsIn(raw []catalog.Model, model string) (map[string]string, boo
|
||||
// itself a model magpie offers, or that no family has. Picks and agents'
|
||||
// models saved before the families were one model still name these ids.
|
||||
func CursorBase(id string) (base, effort string, ok bool) {
|
||||
raw, _, live := catalog.Live("cursor")
|
||||
raw, live := builtinCursorList()
|
||||
if !live {
|
||||
return "", "", false
|
||||
}
|
||||
@@ -259,7 +274,7 @@ func cursorBaseIn(raw []catalog.Model, id string) (string, string, bool) {
|
||||
// Cursor's own ids the model magpie offers for it, in the order picked,
|
||||
// each once.
|
||||
func cursorPicks(ids []string) []string {
|
||||
raw, _, live := catalog.Live("cursor")
|
||||
raw, live := builtinCursorList()
|
||||
if !live {
|
||||
return ids
|
||||
}
|
||||
|
||||
@@ -148,3 +148,38 @@ func TestCursorPluginContext(t *testing.T) {
|
||||
t.Fatalf("fakeco gpt-4o: %d", c)
|
||||
}
|
||||
}
|
||||
|
||||
// Served by the plugin, a pick of Cursor's own id stays that id: the list
|
||||
// the retired built-in left in the cache doesn't fold it into a family the
|
||||
// plugin may send as is (ysm119: claude-opus-5-5-low picked, shown and
|
||||
// sent as claude-opus-5-5, "AI Model Not Found").
|
||||
func TestCursorPicksKeptWhenPluginServes(t *testing.T) {
|
||||
if !PluginServes("cursor") {
|
||||
t.Fatal("cursor isn't plugin-served")
|
||||
}
|
||||
raw := []catalog.Model{
|
||||
{ID: "claude-opus-5-5-low", Name: "Claude Opus 5.5 1M Low"},
|
||||
{ID: "claude-opus-5-5-medium", Name: "Claude Opus 5.5 1M"},
|
||||
{ID: "claude-opus-5-5-high", Name: "Claude Opus 5.5 1M High"},
|
||||
{ID: "claude-opus-5-5-low-fast", Name: "Claude Opus 5.5 1M Low Fast"},
|
||||
{ID: "claude-opus-5-5-medium-fast", Name: "Claude Opus 5.5 1M Fast"},
|
||||
}
|
||||
if err := catalog.SaveLive("cursor", "", raw); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Cleanup(func() { _ = catalog.SaveLive("cursor", "", nil) })
|
||||
// the stale list does fold them: what the guard keeps out
|
||||
if b, _, ok := cursorBaseIn(raw, "claude-opus-5-5-low"); !ok || b != "claude-opus-5-5" {
|
||||
t.Fatalf("fixture doesn't fold: %q %v", b, ok)
|
||||
}
|
||||
picks := []string{"claude-opus-5-5-low", "claude-opus-5-5-medium"}
|
||||
if got := cursorPicks(picks); fmt.Sprint(got) != fmt.Sprint(picks) {
|
||||
t.Errorf("picks = %v, want %v", got, picks)
|
||||
}
|
||||
if b, e, ok := CursorBase("claude-opus-5-5-low"); ok {
|
||||
t.Errorf("CursorBase = %q %q, want none", b, e)
|
||||
}
|
||||
if vs, ok := CursorVariants("claude-opus-5-5"); ok {
|
||||
t.Errorf("CursorVariants = %v, want none", vs)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ func init() {
|
||||
// the plugin reads cursor-agent's token as the built-in does.
|
||||
movers["cursor"] = &mover{
|
||||
pkg: "@magpie-community/opencode-cursor-auth",
|
||||
min: "0.2.23", // 0.2.23: a Team account sends its x-cursor-team-id (plugins #231); 0.2.22: a heartbeat keeps a counted tool batch open (plugins #377); 0.2.20: the MCP server the caller's tools go to Cursor under is "tools", so nothing sent to Cursor (the tool catalog in the prompt, each call, each tool definition) names magpie, and a call under the old "magpie" name is still read back; 0.2.19: two different native tool counts in one step, before any output and with no result submitted, rebuild once from the history instead of failing as "inconsistent native tool count" (plugins #207); 0.2.18: a failed tool result reaches Cursor as failed on the stateless path too; the keychain token is read once per 10s and, after a refused read, not asked again for 10 minutes, as the built-in; 0.2.17: a tool-result continuation in a Run's last minute rebuilds from the supplied history before writing results, not a 502 "native Run lifetime expired" (plugins #157); 0.2.16: a multi-step native turn's last step reports its own share of the turn's usage, the rest billed as usage.magpie_deferred, so Codex doesn't read 1.1M as a 61K context and compact at once (plugins #156); a step's calls get the batch wait from the latest one, so a step of many long calls isn't failed as "did not complete its declared native tool batch" (plugins #155); 0.2.15: calls the plugin answers itself (a tool the request doesn't have, get_mcp_tools) count toward Cursor's tool count, so a step with one isn't failed as "inconsistent native tool count" or a batch never completed, and a long history's blob burst waits for a slow link instead of failing as "native outbound messages limit reached" (plugins #142); 0.2.14: a Run tool call stays on one native Cursor session across its result, and a tool that outlasts Cursor resumes stateless, not as a failed turn (plugins #135); 0.2.13: a Run cancelled while it opens is closed upstream, not left streaming for nobody (plugins #130), and dashboard usage is collected per account, so one account never takes another's event as its debt (plugins #131); 0.2.12: Grok Bot is among the panel's three rings ahead of an On-demand with no limit, which is only a dollar figure (#2213); 0.2.11: a step's usage is its own, and what it collected of earlier steps goes as usage.magpie_deferred, billed with it but never told as its prompt, so pi's context isn't inflated (#1053, plugins #101); 0.2.10: a Team member with no limit of their own spends the team's on-demand pool, which is shown and counted as the limit, not as unlimited (#1868); 0.2.9: a default model whose own branch stops short of the asked effort goes to its nearest effort, so the id and its parameters agree (plugins #55); 0.2.8: a failure's status and its sign-in mark as the built-in's; Max Mode models retried in Max Mode; glm-5.3 listed; catalog entries written as CallDynamicTool calls, an empty turn retried (plugins #11); a tool step's usage from the dashboard's usage event, cache included (#676); far from Cursor a step whose event shows late is counted by the conversation's next steps instead of guessed (#1053); a turn's parallel calls split over two assistant messages keep their results (#1275); the list is Cursor's picker, a model once per context size with that window, effort and fast sent as the variant's parameters, and an id 0.1.x listed still runs as the variant it stood for (plugins #51); an id 0.1.x listed, at an effort only its other branch has, goes as that branch's nearest effort, not as the default's id with parameters that contradict it (plugins #54); a model listed at a size Cursor has a fast variant of says fast, for magpie's Fast switch (#1360); a Run HTTP/2 can't open (a proxy or network that blocks it, "h2 is not supported") goes over HTTP/1.1 as RunSSE + BidiAppend on api2 (plugins #59); a model asked for by its bare name (grok-4.7) counts in the pool its sized ids (grok-4.7@256k) are in (Will on Discord); an account with a Grok Bot allowance shows it on its Usage card, aside, so a spent Bot never stops Cursor requests (plugins #64); an account that may spend on-demand (a team or enterprise that pays past the included usage) is not used up when its included pools are, its On-demand spend is (fottencity on Discord, #1476); an assistant turn's reasoning_content is kept across a tool continuation (plugins #82); an empty reply says what Cursor's Run sent before it, so the next report shows why (plugins #60)
|
||||
min: "0.2.24", // 0.2.24: a family cursor-agent lists that the account's picker lacks (claude-opus-5-5-low … -max) is listed once and runs as the usable id its effort picks, and a stale @size id runs at the nearest size, never sent as an id Cursor answers "AI Model Not Found" for (ysm119 on Discord); 0.2.23: a Team account sends its x-cursor-team-id (plugins #231); 0.2.22: a heartbeat keeps a counted tool batch open (plugins #377); 0.2.20: the MCP server the caller's tools go to Cursor under is "tools", so nothing sent to Cursor (the tool catalog in the prompt, each call, each tool definition) names magpie, and a call under the old "magpie" name is still read back; 0.2.19: two different native tool counts in one step, before any output and with no result submitted, rebuild once from the history instead of failing as "inconsistent native tool count" (plugins #207); 0.2.18: a failed tool result reaches Cursor as failed on the stateless path too; the keychain token is read once per 10s and, after a refused read, not asked again for 10 minutes, as the built-in; 0.2.17: a tool-result continuation in a Run's last minute rebuilds from the supplied history before writing results, not a 502 "native Run lifetime expired" (plugins #157); 0.2.16: a multi-step native turn's last step reports its own share of the turn's usage, the rest billed as usage.magpie_deferred, so Codex doesn't read 1.1M as a 61K context and compact at once (plugins #156); a step's calls get the batch wait from the latest one, so a step of many long calls isn't failed as "did not complete its declared native tool batch" (plugins #155); 0.2.15: calls the plugin answers itself (a tool the request doesn't have, get_mcp_tools) count toward Cursor's tool count, so a step with one isn't failed as "inconsistent native tool count" or a batch never completed, and a long history's blob burst waits for a slow link instead of failing as "native outbound messages limit reached" (plugins #142); 0.2.14: a Run tool call stays on one native Cursor session across its result, and a tool that outlasts Cursor resumes stateless, not as a failed turn (plugins #135); 0.2.13: a Run cancelled while it opens is closed upstream, not left streaming for nobody (plugins #130), and dashboard usage is collected per account, so one account never takes another's event as its debt (plugins #131); 0.2.12: Grok Bot is among the panel's three rings ahead of an On-demand with no limit, which is only a dollar figure (#2213); 0.2.11: a step's usage is its own, and what it collected of earlier steps goes as usage.magpie_deferred, billed with it but never told as its prompt, so pi's context isn't inflated (#1053, plugins #101); 0.2.10: a Team member with no limit of their own spends the team's on-demand pool, which is shown and counted as the limit, not as unlimited (#1868); 0.2.9: a default model whose own branch stops short of the asked effort goes to its nearest effort, so the id and its parameters agree (plugins #55); 0.2.8: a failure's status and its sign-in mark as the built-in's; Max Mode models retried in Max Mode; glm-5.3 listed; catalog entries written as CallDynamicTool calls, an empty turn retried (plugins #11); a tool step's usage from the dashboard's usage event, cache included (#676); far from Cursor a step whose event shows late is counted by the conversation's next steps instead of guessed (#1053); a turn's parallel calls split over two assistant messages keep their results (#1275); the list is Cursor's picker, a model once per context size with that window, effort and fast sent as the variant's parameters, and an id 0.1.x listed still runs as the variant it stood for (plugins #51); an id 0.1.x listed, at an effort only its other branch has, goes as that branch's nearest effort, not as the default's id with parameters that contradict it (plugins #54); a model listed at a size Cursor has a fast variant of says fast, for magpie's Fast switch (#1360); a Run HTTP/2 can't open (a proxy or network that blocks it, "h2 is not supported") goes over HTTP/1.1 as RunSSE + BidiAppend on api2 (plugins #59); a model asked for by its bare name (grok-4.7) counts in the pool its sized ids (grok-4.7@256k) are in (Will on Discord); an account with a Grok Bot allowance shows it on its Usage card, aside, so a spent Bot never stops Cursor requests (plugins #64); an account that may spend on-demand (a team or enterprise that pays past the included usage) is not used up when its included pools are, its On-demand spend is (fottencity on Discord, #1476); an assistant turn's reasoning_content is kept across a tool continuation (plugins #82); an empty reply says what Cursor's Run sent before it, so the next report shows why (plugins #60)
|
||||
agents: []string{"cursor"},
|
||||
out: func() ([]Moving, error) {
|
||||
if CursorExecutable() == "" || cursorSignedOut() {
|
||||
|
||||
Reference in New Issue
Block a user