The same fix as plugin 0.2.6, for users who haven't moved Cursor onto its
plugin. cursorWindows read only GetCurrentPeriodUsage's planUsage, so a
team or enterprise that pays for on-demand usage read as used up once
Cursor Models / Other Models hit 100%: smart routing put it last, and a
failure then rested it until the billing period renewed.
It now also reads GetHardLimit (in parallel) and the period's
spendLimitUsage, and cursorOnDemandOf derives the On-demand state exactly
as cursor-agent 2026.10.01's usage view (usage-data.ts) and the plugin's
onDemandOf do: fixed (the member's own limit, or a personal hard limit),
unlimited (a team with a hard limit or a pooled limit, or a personal
limit of the top int32), disabled, or not known. Fixed or unlimited: the
pools stay on the card but aside, and an On-demand window ($used /
$limit) is the allowance, used up at its limit; unlimited is aside too.
Disabled or not known: the pools are the allowance, as before.
TestCursorOnDemandKeepsTheAccount uses the plugin's fixtures (Connect
JSON of SpendLimitUsage in cents with pooledLimit as an int64 string,
GetHardLimitResponse in dollars) and checks the windows and that
allowanceOf doesn't count the account full. On the old cursor_usage.go
three of its four subtests FAIL (pools not aside, no On-demand window);
the "no on-demand" subtest passes on both, as it should.
go test -tags nogui ./internal/provider passes (temp HOME, pinned caches);
go vet -tags nogui for darwin, linux, windows; gofmt -l clean. Not tried
with a real Cursor account (no enterprise account here).
Cursor 的两个额度池和汇总值原先同时参与每个模型的路由计算,导致 Other Models 用尽时仍有额度的 Grok、Composer 和 Auto 也被判为用尽。按服务端名单及官方已确认的模型归属分别匹配额度池,汇总值仅用于展示,并统一额度名称。
路由用量按账号和模型分别保存,避免同一账号的不同模型覆盖用量及重置时间。补充额度池独立耗尽、模型别名、重置和路由排序的回归测试。