Commit Graph
2 Commits
Author SHA1 Message Date
yetone 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).
2026-10-31 02:09:18 +08:00
yetone 2009d33a65 usage: Gemini 4 Argon's own quota group shows beside Gemini's and Claude's, and keeps Claude's in view (01huadalang on Discord)
01huadalang: "反重力有 Gemini 4的条子是7天,有没有5h 的条子,而且有 Gemini 4的条子怎么 claude 的条子没有了".

Google now reports a third group in retrieveUserQuotaSummary for paid
accounts: "Gemini 4 Argon", "For paid Pro plans, Argon quota is
separate", with one bucket, gemini-argon-wtu-weekly, window weekly. That
shape is agy 1.4.0's own /usage output, recorded in CodexBar #4585 and its
test fixture; agy itself shows Gemini 5-hour, Gemini weekly and Gemini 4
Argon weekly, no Argon 5 hours. So there is no 5-hour bar for Argon to
show: Google sends none.

Claude's bar went because the GUI showed only some pools:
- poolLine (an account row on the Providers page) drew pools.slice(0, 2)
  and put the rest in the tooltip;
- the menu bar panel's card drew fam.slice(0, 4) rings;
- poolWindows sorted pools by their first word, so "Gemini 4 Argon"
  ranked with Gemini, before "Claude & GPT".
With three pools, Gemini and Gemini 4 Argon took both places and Claude &
GPT dropped out of sight. The panel also labelled Argon's ring "Gemini 7d",
the same as Gemini's own.

And in Go, pools() matched a model to the first group whose name or
description holds its family: gemini-4-argon went into Gemini's pool (and
its tooltip), and a versioned group listed first with a 5-hour bucket
would have taken every Gemini model.

Now:
- pools(): a group whose name says a version and that a model's name or id
  begins with ("Gemini 4 Argon") is that model's, whatever its windows; the
  family-wide match skips versioned groups and, as before (#745), needs
  the group's 5 hours.
- app.js: every pool shows on an account row (the line already wraps) and
  every pool window on the panel card (a closer gap past four rings); a
  pool named for a model sorts after the family pools, as agy lists it;
  its ring reads "Gemini 4 7d" (poolWord); the #745 fallback, which shows
  a family's own 5 hours before a week-only pool's week, isn't applied to
  a model's pool.

Tests, each red on the old code:
- TestAntigravityQuotaModelGroup: the agy groups in agy's order, Argon
  listed first, and Argon first with a 5-hour bucket. Old code put
  gemini-4-argon in Gemini, and in the last case gemini-3-flash in Gemini 4
  Argon.
- quota-pool-model.test.cjs (Chromium, WebKit; en, zh): the Usage page has
  every group's windows in order; the panel has five rings, Claude's among
  them, labelled Gemini 5h/7d, Claude 5h/7d, Gemini 4 7d, all fitting;
  the account row has Gemini, Claude & GPT, Gemini 4 Argon. Chromium was
  red on the old app.js (order).

Run at the pushed head's tree (7b1faf99f plus this change; rebased on
40a0b442c, which touches only internal/cli):
- go test -tags nogui -count=1 -timeout 45m ./... under a sandbox HOME:
  every package ok;
- gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui for
  internal/provider and internal/gui;
- GUI, both engines, 76 files (quota-*, panel-usage, panel-quota-*,
  tray-usage*, usage-accounts*, usage-card-refresh, usage-quota-head,
  i18n*, old-webkit, click-scroll): 299 of 303 passed. quota-families
  Chromium zh hit a 180s browser launch timeout at load 75 and passed when
  rerun. quota-count-wrap (WebKit, 1100px) and quota-reads (WebKit de 360)
  are red the same way on the untouched 7b1faf99f, already filed as
  #3404/#2228 and #3406/#2150.

Not tried: a real Antigravity account. The Argon group's shape comes from
agy's recorded output, not from a call made here. A summary from the
cloudcode-pa OAuth endpoint may lack the Argon group (CodexBar saw that);
in that case nothing changes.
2026-10-25 02:22:07 +08:00