Commit Graph
3 Commits
Author SHA1 Message Date
焦寒营 b8ec827579 cursor: the Claude Cursor hides from an account is listed once per context size (jiaohanying, #634)
By jiaohanying (#634).

An account Cursor blocks Claude for has no Claude in the picker
(AvailableModels), only in the usable list, so those models were listed
as usableOnly fallback entries: a 200K window assumed, no sizes.

AvailableModels with scope 3 (the full catalog) is now asked alongside
the other two (8s; a failure leaves the list as before). The live
Anthropic models the picker lacks (not isHidden, not Auto, not chat-only
or Tab-only, with a variant the account has an id for) are listed as the
picker's models are: once per context size (claude-opus-5-5@300k, @1m),
thinking a parameter, the efforts the account is served, 1m in Max Mode.
A catalog variant without a legacySlug gets the one of the model's ids
that says its effort, thinking and fast; none or several, it is not
offered. Only the parameters the model defines are sent: the catalog's
Opus 4.7 to 5.5 variants carry cyber=false, which the picker's don't and
cursor-agent never sends. A saved sized id (claude-opus-4-8-thinking@1m)
now runs at its size. With no effort asked a catalog model goes at
Cursor's default variant (Opus 5 and 4.8: high), as the picker's do.

The version is bumped in the next commit: main's 17e5ef7 already took
0.2.38.

Run at the reviewed head f4cb8ed449ee63dfb92fa37509a171ee43de3280 (mote,
Bun, temp HOME):
- bun test packages/cursor: 393 pass, 0 fail. bun scripts/check.mjs: ok.
- Squashed onto origin/main a064cf1 with the version at 0.2.39: bun test
  packages/cursor 393 pass; whole bun test 5199 tests, 0 fail (15 skip);
  check.mjs ok.

Broken by hand:
- c588c65's withSlugs (no parameter filter): the cyber test fails
  (Expected false, Received true); the other 8 pass.
- main's index.mjs under the new catalog.test.mjs: 7 of 9 fail.

The author ran a real Run on a blocked account at low effort:
claude-opus-5-5@300k went as claude-opus-5-5-low [context=300k,
effort=low, fast=false], @1m as the same id in Max Mode [context=1m].
Not tried by the reviewer: a real Cursor account (none available for
this review), and a long conversation at 300K or 1m. Every account now
makes the scope 3 request too, so a slow catalog can hold the list up to
8s, as GetUsableModels can.
2026-11-03 17:55:05 +08:00
yetone 944610f8c8 cursor: each test file mints sign-in tokens of its own
The publish run for d9c858c (cursor 0.2.28) went red in
conversation.test.mjs: its first Run went to 127.0.0.1:42583, a closed
agent server of listwait.test.mjs, got ECONNRESET and fell back to
HTTP/1.1, which its fake API doesn't answer. listwait's tokens were
{exp: now+7200+n} with a counter from 0, byte for byte the tokens
conversation.test.mjs mints, so within one second the plugin's agent
endpoint and model list kept for listwait's token were found by
conversation's. conversation, maxmode and usage had the same latent
collision with each other. Each of those files, and context's tokens,
now carry a sub of their own (as http1, latency and the native tests
already did).

Run: on Linux (wsl-run), listwait then conversation was red 6 of 6
before and 0 of 6 after; listwait, conversation, maxmode and usage in
one run 0 of 4 red; bun test packages/cursor 314 pass. On mote, the
whole repo's bun test (2997 pass, 0 fail) and bun scripts/check.mjs (ok).
Broken by hand: the failing order was found by replaying CI's file order
and logging open()'s HTTP/2 failure (ECONNRESET to listwait's port).
Not tried: CI's exact random order beyond the replay.
2026-10-28 14:49:59 +08:00
yetone fc1457162c cursor 0.2.27: a chat request no longer waits for a model list Cursor can't give
ysm119 on Discord: claude-opus-5-5 through the plugin takes 33-36 s to its
first token on every request. A chat request picks its variant from the
account's model list (AvailableModels, up to 30 s) before it opens its
Run. A list Cursor couldn't give was never kept, so every request asked
for it again and waited for the ask to fail before its Run; a list past
its 10 minutes was waited for again too, and requests at once each asked.

listFor now gives the chat path the list without waiting when it needn't:
a list past its keep is used while a new one is asked for in the
background, requests at once share one ask (listing), and after a failed
ask requests go without the list for 5 minutes (LIST_RETRY), as the first
one did. Only a token with no list and no recent failure waits.
provider.models still fails when Cursor can't list, so magpie keeps its
list.

Measured against a fake Cursor (bun 1.4.2, on mote): with AvailableModels
failing after 3 s, every request's setup was 3003 ms before, re-asked each
time; the plugin's own setup is ~20 ms cold, ~4 ms warm, and stream
chunks reach the client 0-7 ms after the server writes them.

Run: bun test packages/cursor (314 pass, 0 fail) and
bun scripts/check.mjs cursor (ok), on mote.
Broken by hand: on the old index.mjs all three listwait.test.mjs tests
are red; with only answerOf back on usable(), the failed-list and stale-
list tests are red.
Not tried: a real Cursor account (its token is in the Keychain); whether
ysm119's AvailableModels fails or is slow is not confirmed.
2026-10-28 14:38:01 +08:00