73d20064443ab31dd2b29664dbfbcd9a5093e2fc
15
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
00de68a0f8 |
cursor 0.2.33: free credit (the plan's bonus and credit grants) on the card, with its limits
CryptoSarom on X (2116260605053321489): "magpie 似乎没法支持 cursor 的赠金读取,
以及赠金使用限制". The card read only the included pools and on-demand.
What Cursor exposes, as Cursor 3.x's IDE (workbench.desktop.main.js) and
cursor-agent 2026.10.01's schemas have it:
- GetCurrentPeriodUsage planUsage.bonusSpend (cents), remainingBonus (bool,
no amount) and bonusTooltip: the IDE's "+$X free usage on us" line.
- DashboardService/GetUsageLimitStatusAndActiveGrants activeGrants
(aiserver.v1.ActiveCreditGrant): totalCents, remainingCents, expiresAtMs,
allowedModelIds / allowedModelTags / allowedModelSelections (models it
may be spent on), allowedClientTypes ("glass" without "ide" is the IDE's
Cloud Agent credits), campaignName. The IDE's "Use your $X free credits"
banner reads it; it matches tags lower case with "-" as ".".
The card now shows Free usage (bonus spent, "more left" when
remainingBonus) and a window per grant (spent / total USD, runsOutAt and
runsOut at its expiry, models when limited, "(Cloud Agents only)" when
cursor-agent can't spend it). All are aside. Routing: a bonus with some
left, or a grant magpie can spend on every model, sets the spent pools
aside as on-demand does; a model-limited grant leaves its models out of
a spent pool (Cursor Models keeps a non-empty list, or goes aside). With
Included usage only on, none of this keeps an account served. A grants
read that fails leaves the card as before.
Run on mote at this tree: HOME=$(mktemp -d) bun test: 3960 pass, 9 skip,
1 fail (a test of my own, since fixed); then credit/usage/included-only
79 pass 0 fail; bun scripts/check.mjs cursor ok. Broken by hand: the new
credit.test.mjs against the old index.mjs, 9 of 9 red.
Real account (Premium, merged weekly, cursor-agent's sign-in, read only):
GetCurrentPeriodUsage, GetUsageLimitStatusAndActiveGrants,
GetCreditGrantsBalance, GetClientVisibleCreditGrants read; it has no bonus
and no grant, and the new plugin's card for it is unchanged (Weekly, Grok
Bot, On-demand). Those replies are credit.test.mjs's REAL_ fixtures; the
#1868 team account's real bonusSpend 14151 now shows "+$141.51 on us".
Not tried: a real account with a grant or remainingBonus true (none at
hand), so the grant fixtures follow the schema, and whether Cursor
really serves a spent pool on bonus is Cursor's word ("free usage beyond
what you've purchased"), not a request made past a spent pool.
|
||
|
|
060722efcf |
cursor 0.2.32: a merged (newer) plan's included usage is one Weekly window for every model, no Other Models
majiang_ai on X: Cursor's newer plans have no third-party-model pool, while magpie's card still showed Cursor Models, Other Models and Total. What Cursor says: GetPlanInfo answers isMerged true and planInfo.includedUsagePeriod INCLUDED_USAGE_PERIOD_WEEKLY for such a plan (enum 1 MONTHLY, 2 WEEKLY, from cursor-agent 2026.10.22's proto), and GetCurrentPeriodUsage's billing cycle is then the week, with autoPercentUsed == totalPercentUsed and apiPercentUsed 0. The dashboard's usage page (cursor.com/v2/usage, chunk read on 10-29) draws one meter, "Weekly usage limit", from the period's totalPercentUsed. Now planOf reads isMerged and the period with the plan name (same hourly cache, last good answer kept). A merged plan's usage is one window, Weekly (span 7d; Monthly on a monthly merged plan, Included when not said), with no models list, so it counts every model; On-demand and Grok Bot as before; no Other Models or Total. A plan GetPlanInfo can't read, or isMerged false, keeps the two pools. Run: - HOME=$(mktemp -d) bun test (whole repo, on mote): 3229 pass, 8 skip, 0 fail - bun scripts/check.mjs: ok - Broken by hand: the merged branch turned off, 5 of the 6 new tests red (the 6th checks the unmerged case still has the pools). - Real account (owner's Cursor, a merged Premium plan, keychain token, read-only calls): the published 0.2.31 shows Cursor Models 7%, Other Models 0%, Total 7%; this change shows Weekly 7% (resets 11-03), Grok Bot, On-demand. Not tried: an old (unmerged) plan's real account; none is at hand, the unmerged path is unchanged and covered by the existing tests. A merged monthly plan was not seen for real. |
||
|
|
719de026e7 |
cursor 0.2.30: an Enterprise account's overall allowance from usage-summary (#391)
Fixes yetone/magpie#3288. An Enterprise account's GetCurrentPeriodUsage has no planUsage, so its card was empty. usage() now reads the website's /api/usage-summary with the same dashboard session the Grok Bot read builds, and shows an Enterprise window (amount/limit in USD, reset at the cycle's end) when the summary is Enterprise with overall enabled and used/limit real numbers. It is aside while team on-demand is unlimited or a measured budget has room, and a measured on-demand budget gets its own window. Anything else leaves the card empty, as before. Version 0.2.30. The reviewer pushed 9435f59 on top of e2f03a0: main merged in (the only conflict was the version line; main took 0.2.27 to 0.2.29 meanwhile), version 0.2.30. Run at 9435f59f0f0e4902e37f8634eebe8e41127cc9b1, on mote (mote-run, HOME=$(mktemp -d)): - bun test packages/cursor: 328 pass, 0 fail (19 files). bun scripts/check.mjs cursor: ok. - Full bun test: 3063 pass, 8 skip, 0 fail (257 files). - Broken by hand on usage.test.mjs, each red then restored: the old Number() reads of overall.used/limit (the can't-be-read test; null/""/false/[] read as 0 again), no room check on the on-demand budget (the 50000 and 60000 of 50000 cases), the summary read off (10 tests). - npm pack 0.2.30 and imported the packed index.mjs (CursorAuthPlugin, _internal). npm has 0.2.29. Not tried: a real Enterprise account (none here); the summary's shape rests on the author's account. Still unanswered from the review: whether an Enterprise seat's summary carries a personal on-demand cap (individualUsage.onDemand); a ms-string billingCycleEnd gives no resetsAt. #372 touches the same `if (!u)` branch and now has to rebase onto this. |
||
|
|
944610f8c8 |
cursor: each test file mints sign-in tokens of its own
The publish run for
|
||
|
|
f2f4ff4014 |
cursor 0.2.12: Grok Bot is among magpie's three panel rings ahead of an On-demand with no limit (yetone/magpie#2213, Morganwan90)
The usage windows went Cursor Models, Other Models, On-demand, Grok Bot, Total. magpie's tray panel draws an account's first three, so on an account that may spend on-demand without a limit, the On-demand ring (always 0%, only a dollar figure) pushed Grok Bot out, while an account with no on-demand showed Bot third. An On-demand with no limit (aside) now goes after Bot, beside Total. One with a limit keeps its third place ahead of Bot: it is the window that can stop the account's requests, with the pools aside. Run: bun test in packages/cursor (89 pass), bun scripts/check.mjs (all packages ok). The new test fails on 0.2.11's index.mjs (Bot fourth, On-demand third). Not tried with a real Cursor account that has Grok Bot and on-demand. |
||
|
|
a885a16190 |
cursor 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 (yetone/magpie#1868)
PaSSw0rds' Team account has on-demand turned on for the whole
organization: spendLimitUsage has no individualLimit, pooledLimit
"45120000" and pooledRemaining "38785730" are int64 strings, pooledUsed
6334270 a number, and GetHardLimit answers {"hardLimit": 451200} with or
without a team id. onDemandOf read that as "unlimited", as cursor-agent's
own usage view does, so the On-demand row showed only the member's own
$198.55 at 0%, and a spent team pool never counted the account used up.
Now a team member with no individualLimit and a pooledLimit > 0 gets a
fixed On-demand window on the pool: used = pooledUsed / pooledLimit,
display "$63,342.70 / $451,200.00 (you: $198.55)", not aside, so magpie
stops routing to it when the pool is spent. A hard limit that forbids
on-demand still reads as disabled; a team with no pool and a hard limit
still reads as unlimited. Dollar figures group thousands.
Run: bun test in packages/cursor (86 pass), bun scripts/check.mjs (exit 0).
The new test, built from the payloads quoted in yetone/magpie#1476, fails
on the old index.mjs (On-demand "$198.55", used 0, aside) and on a fix
that shows the member's spend against the pool instead of the pool's own.
Not tried against a real Team account.
|
||
|
|
a298e5430f |
cursor 0.2.6: an account that may spend on-demand is not used up when its included usage is (fottencity on Discord)
A Cursor team (or personal plan) with on-demand spend allowed keeps being served once Cursor Models / Other Models reach 100% of the included usage. The usage read gave only those pools, so magpie counted the account used up: smart routing put it last, and any failure while a pool read 100% rested it until the billing period renewed (held to 8 days). usage now also reads GetHardLimit and the period's spendLimitUsage, and derives the On-demand state exactly as cursor-agent 2026.10.01's usage view does (fixed limit, unlimited, disabled, unavailable). When on-demand is fixed or unlimited, the pools are still shown but marked aside, and an On-demand window ($used / $limit) is the allowance: used up at its limit, never when there is none (then aside too). Disabled or not known: the pools are the allowance, as before. Bot stays before Total. Verified: bun test (77 pass); the three new on-demand tests fail on the old index.mjs (pools not aside, no On-demand window); bun scripts/check.mjs cursor. Fixture shapes come from cursor-agent's own protobuf schema (GetCurrentPeriodUsageResponse.SpendLimitUsage, GetHardLimitResponse); not tried against a real enterprise account. |
||
|
|
6bed2c1c32 |
cursor 0.2.5: a Cursor account with a Grok Bot allowance shows it on its Usage card (#64)
Grok Bot has an allowance of its own, apart from Cursor's monthly usage, and it shows on cursor.com's dashboard only. auth.usage now also reads https://cursor.com/api/dashboard/get-sand-usage-status with the sign-in as the dashboard session (WorkosCursorSessionToken, as Cursor's dashboard and CodexBar's CursorSandUsage.swift send it), and adds a "Grok Bot" window: a paid grant with its weekly reset, a live trial as "Grok Bot (trial)" without one. The window is aside, so Bot running out never stops Cursor model requests, and it comes before Total so it is among the Usage card's three rings. No grant, an expired trial, a non-2xx, a redirect (not followed), a hang past 5 s or a reply that isn't JSON each leave Cursor's own windows as they were. Rebased onto main after cursor 0.2.4 ( |
||
|
|
7516d636d8 |
cursor 0.2.4: 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)
The model list offers Grok 4.7 only at its context sizes, grok-4.7@256k
and grok-4.7@500k, while a routing group picked before the list had sizes
still asks for bare grok-4.7, which named() runs at its default size.
usage() built the Cursor Models window's models (and Other Models'
notModels) from the listed ids only, so magpie counted bare grok-4.7 in
Other Models: used up, 0% left on the Routing page, ranked last, while
Cursor Models had ~84% left. The pool now also names each listed id's
bare name; inPool still decides which pool it is in.
magpie 99009b93 makes the same match on its side for every plugin (a bare
id and its id@size count as one); this release covers magpie versions
before it.
Verified: the new usage.test.mjs case fails on 0.2.3's index.mjs ("Grok
4.7" counted false/true) and passes now; packages/cursor 67 pass;
check.mjs green. The whole-repo bun test needs HOME=$(mktemp -d) (CI does
it), not run here that way.
|
||
|
|
8cd5a0fad8 |
cursor 0.2.0: the list is Cursor's picker, a model once per context size with that window; effort and fast are the request's (#51)
* cursor 0.2.0: the list is Cursor's picker, a model once for each context size with that window (claude-opus-5-5@300k, @1m), and effort and fast are the request's, sent as the variant's parameters
The usable list (AgentService/GetUsableModels) names a model once for each effort and speed, and the window was read off the name: 1M when it said 1M, else 200K. The names say 1M of models Cursor serves at 300K outside Max Mode ("Claude Opus 5.5 1M"), and nothing of the 300K Sonnet and Haiku or the 256K Grok have, so on this account 110 of 153 names gave a wrong window: Opus too large, Sonnet, Haiku and Grok too small, and the agents compacted at the wrong point. The request carried no context parameter either, so the window Cursor ran at was its own choice, not the one magpie reported. The same id could go to a 300K and a 1M variant.
Now the list is Cursor's model picker alone (AiService/AvailableModels, asked as the CLI asks it: useModelParameters, doNotUseMarkdown), the way pi-cursor-sdk lists Cursor's catalog. A model with a context parameter is offered once for each size, as <model>@<size> named "<name> @ <size>", its window that many tokens; one without is offered once, its window Cursor's contextTokenLimit (Max Mode's for a model served only there), 200K when Cursor gives none. Effort is not a model of its own: the model's efforts (effort / reasoning_effort / reasoning; extra-high is xhigh) are its variants, the request's reasoning_effort is fitted to the nearest and sent as that parameter, and none turns a Claude's thinking off. Fast is not one either: a service_tier of priority or fast sends fast=true, anything else fast=false, so it is paid for only when asked. A request goes as the variant those parameters pick, by the variant's legacySlug (claude-opus-5-5-medium): the agent API refuses the picker's base name with 502 "AI Model Not Found: Model name is not valid". It goes in Max Mode when that variant is Max Mode's (a 1M size; Opus 300K with fast), or, with no variant for the size, when the size is over Cursor's limit outside it; the "Max Mode Required" retry stays. Hidden, Tab-only and chat-only models stay out, as in the CLI.
The ids change (cursor/claude-opus-5-5 is cursor/claude-opus-5-5@300k; the -fast, -low and -thinking models are gone), so 0.2.0: a model picked in magpie or an agent's config has to be picked again. An id the list doesn't have goes to Cursor as it is named, with the default window. poolBase and firstParty take the @size off, so usage pools as before (grok-4.7@256k Cursor Models, claude-opus-5-5@300k Other Models).
context.test.mjs (new) covers the list, the windows, the variants and the request's parameters and mode; maxmode.test.mjs (rewritten) checks what reaches a fake agent API; usage.test.mjs adds the sized ids. HOME=$(mktemp -d) bun test: 45 pass, 0 fail; check.mjs cursor passes. Tried with a real Cursor account: claude-opus-5-5@300k goes as claude-opus-5-5-medium with context=300k and answers, grok-4.6 as cursor-grok-4.6-high, and pi -p --model magpie/cursor/claude-opus-5-5@300k answers; the base name got the 502 above.
* cursor 0.2.0: an id 0.1.x listed still runs as the variant it stood for, and a variant the account hasn't got is neither offered nor asked for (review of #51)
An id the new list doesn't have went to Cursor as it was named. The ids 0.1.11 listed are families of the variants' own ids (claude-opus-5-5, claude-opus-5-5-fast, claude-haiku-5-5-thinking, cursor-grok-4.6), and they are saved in agents' configs, magpie's picks and routing groups: request(raw, "claude-opus-5-5", "high") was {id: "claude-opus-5-5", params: [], maxMode: false}, the bare name the agent API answers 502 "AI Model Not Found" for, with the effort dropped.
Now an id the list doesn't have is read as one of Cursor's own (named): a variant's legacySlug is that variant; a family of them, taken apart as 0.1.x's splitID did, is the family's variant nearest the default, fast for a -fast family, thinking as the family says, at the effort the id names when the request names none; the picker's name for a model, one of its legacySlugs or idAliases, is its default. Each is at the variant's context size, the default's when two sizes share the id. The request's reasoning_effort and service_tier count as for a listed model. The family is tried before the picker's name, so claude-haiku-5-5 stays the Claude without thinking it was in 0.1.11 where Cursor has variants named so; where it has none it is the model's default. Anything else still goes as it is named.
The usable list (AgentService/GetUsableModels) is read again, beside the picker: a variant whose legacySlug isn't in it is dropped, the model's efforts and sizes are the ones its remaining variants have, and a request no remaining variant matches goes as the nearest of them, not as the default's id with parameters the account hasn't got. A model the usable list has nothing of is the picker's alone (GLM-5.3, as 0.1.7 found) and is kept whole; a usable list Cursor can't give leaves the picker as it is.
answerOf's comment says what pick does with no service_tier (fast off). context.test.mjs checks the PICKER_SKIP names stay out (claude-4.5-haiku, claude-haiku-4-5), each id 0.1.11's offered() gives for the fixture's slugs, variant ids and a model's legacy slug, and the usable list's filter; maxmode.test.mjs checks claude-opus-5-5 reaches the fake agent API as claude-opus-5-5-medium. On b33ec2f's index.mjs the three new context tests and that maxmode test fail. HOME=$(mktemp -d) bun test: 48 pass, 0 fail; check.mjs cursor passes. Not tried with a real Cursor account, and not read against cursor-agent's source (neither is on this machine): the old-id rules follow the review's description and 0.1.11's splitID.
|
||
|
|
3ae3e4393e |
cursor 0.1.7: a model Cursor serves only in Max Mode is asked for in Max Mode, and the models Cursor's picker offers beyond the CLI's list (GLM-5.3, GLM-5.3 Flash) are listed (ARNO on Discord: "Cursor: Max Mode Required: The model "gpt-5.6-luna-low" requires Max Mode to be enabled"; "cursor provider 里少了 glm-5.3 和 glm-5.3-flash")
The Run's model went as ModelDetails and RequestedModel with its id alone, never max_mode (ModelDetails field 7, RequestedModel field 2), so a model Cursor serves only in Max Mode was refused. cursor-agent (2026.10.01) turns Max Mode on for such a model itself: requiresMaxMode is supportsNonMaxMode === false or a variant's isMaxMode in AiService/AvailableModels, and a usable model's own maxMode is kept. Now the list notes Max Mode from GetUsableModels' maxMode and from the picker (AvailableModels with useModelParameters, as the CLI asks for it), the Run sends it, and a model neither says it of is asked once more in Max Mode when Cursor answers "Max Mode Required" (the CLI's MAX_MODE_REQUIRED), and in Max Mode from then on. An account Max Mode isn't open to gets Cursor's own answer. The list was GetUsableModels alone, which is `cursor-agent models`; Cursor's picker offers models it leaves out. The picker's models that no usable id, name or slug names are added: one per variant with a legacy slug, else the model by its name with its default variant's parameters, sent as RequestedModel.parameters; hidden, chat-only, Tab-only and non-agent models, and the four the CLI drops, stay out. A picker Cursor can't give leaves the list as it was. The tests now import nonet.mjs first: fetch and HTTP/2 reach only this machine, so a test without its fake, or work still running after it, can't send a token to Cursor. maxmode.test.mjs (fake API and agent API: the list with GLM-5.3 and its Flash and Max Mode marked, the picker down, the Run's max_mode and parameters, the retry after Cursor's refusal) fails without the change (5 of 5) and passes with it; bun test packages/cursor (27 pass) and bun scripts/check.mjs pass. No request was made to Cursor. |
||
|
|
01aee5da28 | all: a usage read says what it means for the sign-in, and a renewal clears the mark whatever follows, as the built-ins did (要保证插件跟内置的所有逻辑都要一模一样) — auth.usage returns signIn on every path: expired where the built-in's quota read marked the account (Zed's /users/me 401, Factory's and MiMo's refused renewals, Qoder's refused job refresh), renewed after a renewal, which took the mark off, kept everywhere else, so magpie no longer guesses from the words 'sign in again' (Kiro's, Devin's and ZCode's usage errors marked accounts their built-ins never did) nor clears on a clean read. A request after a renewal says renewed on any status; one without says kept, as the built-ins cleared only on renewal. Kiro, Cursor, Devin, Command Code, WorkBuddy, Grok and ZCode, whose built-ins never marked an account, say kept on every answer. New tests fail against 85d7dd0's index.mjs. | ||
|
|
85d7dd0d0a | all: each plugin fails with its built-in's status and marks the sign-in as it did, through X-Magpie-Sign-In (要保证插件跟内置的所有逻辑都要一模一样) — Factory's and MiMo's refused renewals are the built-ins' 502 marked expired, not 401s; Qoder's vendor 403 is the built-in's 401 kept, its model list's failure a 400, its job refresh refused marked expired; Zed's retried 401 is a 401 kept, not a 403; Kiro's unreachable refresh a 401 kept; Cursor's expired trial a 401 kept; a vendor 401 WorkBuddy, Grok, Devin, Command Code and ZCode passed on no longer marks the account, as their built-ins never did, and Grok and MiMo no longer retry what their built-ins sent once. Messages take the built-ins' words. New tests fail against the previous index.mjs. | ||
|
|
befd071701 | cursor 0.1.3: the card names the plan as cursor-agent about does (GetPlanInfo's planName, kept an hour); only a token or session run out is a 401, as magpie marks the account lapsed on one; errors no longer start with "Cursor: ", which magpie adds; a model list Cursor couldn't give fails instead of shrinking to the configured few | ||
|
|
0f61665ff8 | cursor 0.1.1: usage shows as magpie's built-in did — plan, period, windows and what they count, balancecursor |