Commit Graph
4 Commits
Author SHA1 Message Date
yetone bdb1dfdd1b providers: a Command Code sign-in goes through when whoami errs on the new key (tigger_ultra on X: Sign-in didn't finish · Command Code didn't take the new key: Internal Server Error) — magpie asked /alpha/whoami to name the account of the key Studio had just posted, and failed the sign-in on any answer but a 200; whoami answered that key with a 500. The CLI's own browser sign-in never asks whoami (it keeps the key and the name Studio posts; whoami is its check on a key typed in, and only a 401 there means a bad key). Now only whoami turning the key down (401, 403) fails it; any other error is asked again twice, a second apart, and then passed over for the name Studio sent, the plan still read from billing/subscriptions. With no name from Studio either, it fails saying so. Tested: TestCommandCodeSignInWhoamiDown, a fake Command Code whose whoami answers 500: signed in as the posted name with its plan after three asks, a 401 key refused, no name at all refused; go test -tags nogui ./... (TestClaudeSignedOut failed once under load, passes on its own with and without the change and in a rerun), GOOS=linux build 2026-09-29 17:41:26 +08:00
yetone b0c42d738e subscription: a Command Code plan's 5-hour and weekly windows show on the Usage page and the panel (ARNO: command code plan的五小时额度,周额度等订阅信息没有显示到用量面板里) — the plan's card was read right (billing/credits as command-code 1.66's /usage reads it: credits.{planId, monthlyCredits, purchasedCredits, freeCredits}, windowLimits.{limited, fiveHour, weekly}.{used, cap, resetAt in ms} beside it) but also carried the dollars left as its Balance, and a card's Balance is shown in place of its windows everywhere (the panel, the Usage page, the TUI): the windows were read and never drawn. The dollars are now a Credits window, used of the CLI's own pool (the plan's month — Go $10, Pro $30 or $80 for pro-v1, Provider $15, GOAT $70, Teams Pro $40, Max $150, Ultra $300 — or what is left of it if more, plus bought and free credits), "$spent / $pool"; only a reply with no windows and no known plan is a Balance still. A plan's key on the keyed commandcode preset gets the same windows as a plan card (api.commandcode.ai is a plan quota source; a pay-as-you-go key has none and no card), and its balance card is the dollars left alone rather than "5h 42% · week 18% · $12.30" squeezed into one amount. billing/credits carries no planId (4b21f62 found it so on a live account), so the pool's month is the plan billing/subscriptions names; an account with no plan and no windows shows what it bought as its Balance 2026-09-29 00:22:50 +08:00
yetone 4b21f62e89 commandcode: a plan's usage says its plan (为什么Command Code Plan没有用量?) — billing/credits has no planId, so the plan (and the account's badge) came up empty; it's read from billing/subscriptions: planId, currentPeriodEnd as when it ends, cancelAtPeriodEnd as whether it renews, and an account with none is "No plan" (无订阅). The plan is said even when billing/credits fails — Command Code answers it 503, "Couldn't verify your credit balance just now", at times — and an account with a balance but no 5-hour or weekly window shows the balance instead of 暂无用量数据. Checked against a live GOAT account: GOAT, $70.00, both windows 2026-09-29 00:19:00 +08:00
yetone fa3ea3149a subscription: Command Code Plan, signed in from magpie (Yetone 老师,CommandCode 也是有登录订阅额度的,并不是类似中转的那种哇 — @RookieRicardoR) — a Command Code plan (Pro, GOAT, Max, Ultra) is now a subscription under 订阅, not only the keyed relay preset: Add signs in with the CLI's own browser sign-in (commandcode.ai/studio/auth/cli posting the new key to a callback on 127.0.0.1, answered as the CLI does, 303 to its complete page; wrong state 403, access_denied fails), whoami names the account and billing/credits its plan; the CLI's own account is read from ~/.commandcode/auth.json, never changed, others kept in logins.json with switch/on/forget like ZCode's. Its models are served from the Provider API (/provider/v1 Chat and Responses, /provider Messages) with the plan's key, billed against the plan's credits; usage shows the 5-hour and weekly windows with their resets and the credits left. Its id is commandcode-plan, since commandcode is the keyed preset's 2026-09-28 23:24:19 +08:00