ac4af582301a4e8a29245dbba767eba31334ddf9
7
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ce8b67de37 |
gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called page.goto with no timeout of its own, so Playwright held the first load of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a busy box (a whole-suite run at load 130-160) that load took longer and goto timed out. The same pattern is in 988 GUI test files (1174 pages): every one of them now also sets setDefaultNavigationTimeout(60000) on the same page, right after its default, so goto, reload and waitForURL wait on the load itself with room, while clicks and waits keep their short bar. group-from-model-add's own 20s navigation bar is raised to the same minute. claude-switch-only also gives its first provider row (drawn from the page's first reads) a minute before clicking it. nav-timeout.test.cjs (no browser) reads every GUI test file and names each page given a default under a minute without a navigation timeout of at least a minute, so a new file can't bring the pattern back. What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from other sessions): - node --check on every file in internal/gui/tests: all parse. - nav-timeout.test.cjs against origin/main's test files: red (names the 1174 pages); against this tree: its only reds were my own probe copies of the old files, since removed. - By hand: claude-switch-only with app.js served 7s late (a busy box's first load), --test-name-pattern "1100 en": origin/main's file 4 of 4 red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green. - claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420: 32 of 32. group-from-model-add, usage-access-key-card and i18n-keys: green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red on a 5s waitForFunction at line 115 (a wait after load, not the navigation), at load ~230. Not tried: the whole GUI suite (about 1000 files; the change is one mechanical line per page), Windows or mote (mote's browsers, #4125). |
||
|
|
18005c8039 |
gui: a provider editor's account rows end at one edge, their settings under ⋯
The owner, 10-29, on Claude Code's editor sheet: its left and right edges
weren't the same, Make first sat alone on a line under the name, and a
band of hover pills took room it didn't show.
Each account row is now a line (dot, name, plan, what is set, then the
status and First or Make first at the right end) and the quota under it.
The settings that aren't set (models, usage cap, requests at once) and
Remove or Sign out wait under ⋯ on a line of their own, which ⋯ opens and
closes. The editor remembers that per row across redraws. A set pill stays
on the line, and a lane pill moves between them as its account starts or
stops running, but not while its menu or box is open. A signed-out
account keeps Sign in again and Remove on its line, wrapping under the
name where they don't fit. The editor's label column fits its labels,
a list's label stands on its first row, every row of the accounts box is
ruled off from the one above, and in the web layout ⋯ is always shown. New
string "Settings for {user}" is in all five languages.
core_budget_test: app.js stays in its budget (1,311,731, comments cut
down). The core's scripts go to 1,532,459. Main had 233 bytes of room
there, so the budget is raised to the exact size with no room added,
as the 10-28/29 editor entries did.
Run (on mote, at this tree, rebased on
|
||
|
|
0d55d9f6c2 | provider, gateway: a Codex account at its usage cap is held from the next turn on: each ChatGPT reply's codex.rate_limits event and x-codex-* headers update the account's reading, and routing's reading ages from when it was made, not when routing took it (up to two minutes old before); the cap's tooltip says a turn under way can still pass it (#1295) | ||
|
|
3ce0a0bf27 |
fix: 收敛中文界面文案 (#846)
删去中文提示里的过程叙述和动机解释,保留数字、条件和后果;同步更新相关测试的中文断言。 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
5a6b90f74f | gui: the only account on, at its usage cap, says Claude Code or Codex signed in to it still uses it (𝕏 on Discord: a Claude account capped at 90% ran its five hours to 100%) — the cap holds back what goes through magpie and moves the agent's sign-in to another account (NextLogin), but Claude Code with its own models (or Codex) asks Anthropic (OpenAI) itself, and with no other account on to move it to it went on past the cap while the row said At its cap beside In use. That row's note now reads At its cap · Claude Code still uses it, in amber, and its title says requests through magpie are refused until the window renews while the agent signed in to it goes on, and what holds it: another account, or the agent's models via magpie. The cap pill's title says the same before the cap is reached. With another account on, nothing changes. zh strings added. account-cap.test.cjs (WebKit, en and zh): the lone account's note and its title, the pill's title, the warning colour, and none of it with the spare on; the new case fails on the old code. account-arrange, -mask, -models, -proxy, -return, keep-login and login-import pass on WebKit; go test -tags nogui ./internal/gui/ under a temp HOME passes. | ||
|
|
92ebdb4104 |
fix(provider): mark a window one model's own as capped, as routing holds it (#760)
* fix(provider): mark a window one model's own as capped, as routing holds it Routing held an account at its usage cap when any window that counts the model was at or past it, Opus's own window included: CapHeld walks the allowance with Limit.applies, and a window naming one model counts every request whose id holds that word. WithCapped, which tells the GUI which windows a cap counts, left those windows out — it marked a window only when it named no model. So a Claude account kept at 70% whose Opus week was at 90% was barred, and then answered 429 with nothing left when it was the only account, while the Providers page showed the account in use, no "At its cap" note and no tick on that window's meter. The rows said the opposite of what routing was doing, and the cap look broken. WithCapped now marks a window as capping as CapHeld holds it: not Aside, not Unlimited, one model's own window like the rest. The GUI needs no change: capHeldOf, capHeldNote and capMark already read Capped, and a mark on a per-model window says the cap holds that window's model — the window's row already names its model. The 429-when-every-account-capped path is untouched: capReached counts only the windows that stop an account for every model, as its comment says, and is not what WithCapped marks. TestWithCappedMarksPerModelWindows fails on the old rule with "the window one model's own is not marked" and passes: the account-wide window, a window naming "opus", on-demand spending (Aside) and an unlimited one are marked, not marked, not marked and not marked, and the windows handed in are left as they were. TestCapHeld, which spells out that Opus's window counts for Opus alone, and the rest of the cap tests are unchanged. Validation on Windows: go test ./internal/provider passes whole; TestWithCappedMarksPerModelWindows fails without the change. go vet ./internal/... and the darwin, GOOS=linux and GOOS=windows builds pass. The full go test -tags nogui -count=1 ./... under a temp HOME leaves the same Unix-only failures as the base commit does on Windows (Keychain, mode bits, shell-script CLIs, skills' folders); the provider package passes whole. account-cap.test.cjs's fixtures carry capped on account-wide windows, so the data change does not touch them; Playwright is not installed in this worktree, so it was not run. * gui: an account held at its cap for some models says which, not that it is held A window that counts some models only (Opus's week, a pool's) is now marked Capped, so the Providers page said "At its cap" and "sends requests to the other accounts" for an account routing still used for every other model. WithCapped also sets CapsSome on such a window; capHeldOf tells those from the account's own windows, and an account held by them alone reads "Opus week at its cap · back in 3h", its tooltip saying other models still use it. When an account-wide window holds it, that window's renewal is the time it is back. account-cap.test.cjs: a Codex account whose five hours and week are under its 70% cap but whose Opus week is at 90% names the Opus week, in English and Chinese; it fails on the PR's head. --------- Co-authored-by: yetone <yetoneful@gmail.com> |
||
|
|
ed79a72927 | provider: a subscription account can be capped at a share of its usage windows, and routing treats it as used up there (Discord: hold a new Claude account at 70% of its five hours and its week to keep its ban risk down, and let magpie go on to the other accounts) — an account's cap (1–99, keyed by the provider id and the account in lower case, AccountCaps in providers.json beside AccountModels and AccountProxies) holds it once any window that applies to the model is at or past the cap and hasn't reset (Allowance.CapHeld; Aside windows and windows kept for another model are left out). One share for every window rather than one per window: the windows an account has differ by vendor (five hours and week for Claude and Codex, a month or a day for others, per-model weeks), the request was one figure for both, and a lower share for one window would be set by lowering the cap. The gateway's perKeyBarred moves a capped account to the candidates left out (barredOf marks it Capped with its use and when it is back, so the routing trace says "held at its 70% usage cap"), so groups, fallback, Ordered and Spread routing and the Codex/Claude Code switch list (NextLogin: a capped account is moved off, not returned to, and isn't a spare) all go on to the next account; a pinned capped account and a draw over only capped accounts answer 429. When every account that serves the model is capped, the client is turned away as when all are used up — 429 rate_limit_error with Retry-After at the soonest reset — and told the cap was reached, which accounts, at what use and cap, and how to lift it. A cap never spends a Codex reset: weekUsedUp, usedUp, BackAt and spendExpiringNow still go by ChatGPT's own 100%, so an account held at 80% with auto reset on is held and nothing is spent; a lone Codex account with a cap goes through serve() instead of being relayed as it came (codexAccounts), so the cap holds it. The Providers page shows a cap pill on each account's row (on hover until set) that opens the app's own menu — No cap, 50/60/70/80/90%, Other… (typed inline, focused without scrolling) — posting provider/accountcap; each window's bar gets a tick at the cap (from the right when the bar shows what is left), and an account held by its cap says so and until when. zh strings in i18n.js. CLI: magpie provider account-cap <id> [account [percent|off]] shows or sets caps. Tests: TestCapHeld, TestCapReached, TestParseCap; TestCapNeverSpendsACodexReset (80% windows, 70% cap: not used up, no reset due, routing held); TestCodexSwitchedAtCap (the active account at 75% with a 70% cap is switched off to the one at 20%, not back while capped, back once lifted; 100 and an unknown account refused); gateway TestAccountCapMovesOn (first account at 75% capped at 70%: the second is tried and the trace says 75/70; lifted: the first), TestAccountCapEveryAccount (429 rate_limit_error naming both caps, nothing sent, logged 429) and TestAccountCapSpendsNoCodexReset (one account at an 80% week, auto reset on: 429, nothing tried or spent; lifted: 200, nothing spent) — the three gateway tests fail with the cap check taken out; TestAccountCapCmd; account-cap.test.cjs (webkit, en and zh: pill, menu, Other…, No cap, cap ticks, held note, no <select>, no border stripes, no scroll on click). account-models, click-scroll, keep-login, codex-auto-reset, account-return, routing-blocked, routing-account-order, routing-quota-left, routing-auto-reset, routing-manual, quota-pools, quota-families and usage-accounts GUI tests pass in webkit. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried with real accounts; a cap acts on usage as last read, so a burst between reads can run a little past it. |