Commit Graph
4 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 158888d04f gui tests: routing-model-rest waits for the frame that rests the Opus row (#2115)
The test read the Opus row's rest class as soon as the row was in the
list. render() marks it on the next frame, so under a full Routing run
(112 files, concurrency 6) it once read false: "old@x.test: the Opus row
doesn't rest" (webkit zh 1100px). It now waits, a frame at a time, for
up to 5 s for the class, then asserts as before; a row that never rests
still fails, 5 s later.

Run: routing-model-rest alone, 20 pass, 0 fail. The race was not
reproduced by injecting a delay; the failure was seen once, in the full
run of the previous commit.
2026-10-26 03:45:23 +08:00
yetone b8ed806e33 gui tests: reach reads the control it wheels to in one call, so a row drawn again between two looks isn't taken for in sight (#2658)
routing-model-rest and routing-wb-restricted were red 1-2 of 20 alone
on a busy machine ("the button can't be reached"). Cause: each test's own
wheel loop read the Try now button with locator.evaluate, which finds the
element in one call and reads it in the next. Routing draws its account
rows again on its own, and a redraw between the two calls handed the
check the button just replaced: out of the page, a zero box at the
window's top, which "bottom < innerHeight - 80" took for in sight. The
loop stopped after one wheel (the failing run's view sat at scrollTop
200 with the button at y 1836).

reader.cjs's shared reach (and wheelTo) had the same two-call read, and
reach threw on a replaced element (closest(".view") null) or returned
early without scrolling. They now read with locator.evaluateAll, which
finds and reads in one call, and look again when nothing matches.
routing-model-rest and routing-wb-restricted use reach instead of their
own loops.

The tests were red before: with an injected redraw (the Try now button
replaced by a clone every 2ms during the scroll), the old
routing-model-rest is 4 of 4 red (chromium en/de, 1100/420), the new one
4 of 4 green. A page-side main-thread hog showed the same [0,null] reads.

Run (macOS, Playwright 1.62.0, load average 60-190 from other sessions):
- alone, both engines, every language and width the files run:
  routing-model-rest 20 of 20, routing-wb-restricted 20 of 20 green.
- under --test-concurrency=6, with every other GUI file that uses reach
  or wheelTo (37 files, 590 tests): 590 of 590 green.
2026-10-21 02:44:26 +08:00
yetone 42216ea609 gateway, gui: one model out of its pool rests on that model's rows only, not on the account's other models (#1960, WardLu)
An Antigravity account out of its Claude & GPT pool (claude-opus-5.5
refused until Sunday) rests that model alone: the gateway keys the rest
by restID and still sends gemini-3.8-flash, in its own pool, to the
account. Routing's page didn't know a rest could be one model's: it
kept rests by key or account, so the stage marked the account's
gemini-3.8-flash row "quota used up · back at Sun 17:53", and the row
under Accounts and keys said the whole account was out.

- gateway: Rest.Model names the model a rest is for when it rests by
  restID (a pool, a model not served, a paid model beside free ones);
  "" for an account- or key-wide rest.
- routing.js: restModel reads it (or, for a kept request from before,
  the model on the end of Rest.Key). The stage keeps a model's own rest
  by key and model, so only that model's row rests; an answered try
  ends the account's rest and its own model's. Accounts and keys keeps
  an account's model rests apart from its own: the account isn't shown
  as out, a line names the models resting with why and when, and Try
  now lifts those rests. An account resting as a whole is as before.
- docs/subsystems/gateway-routing.md says so.

Run: routing-model-rest.test.cjs (new), Chromium and WebKit, 1100 and
420, en/zh/zh-TW/ja/de, 20/20; with the old routing.js it fails
("old@x.test: gemini-3.8-flash rests with Opus"). All 74 routing/rest
GUI test files in both engines (456 each, 0 fail).
TestPoolRefusalRestsTheModelOnly checks Rest.Model, set and read back.
go test ./internal/gateway ./internal/gui, gofmt -l, go vet
darwin/linux/windows (-tags nogui).
Not tried: the reporter's real Antigravity account in the app.
2026-10-13 17:40:47 +08:00