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 d95822eb35 provider: a keyless public plugin stays listed with subscription accounts off, and its name isn't blurred (lileo0668)
lileo0668 on Discord (#help): OpenCode Zen Free (plugin 0.1.18, the
public credential) said 已登录 on the Plugins page, the Add sheet had one
blurred row for it, a red line said "<name> 已登录,但 magpie 无法列出它",
and Zen's free models were nowhere.

Cause, reproduced on a sandbox magpie (HOME and XDG dirs under a scratch
folder, :3561, `magpie web` on :3562) built from origin/main 8701eb35e
with the real plugin from npm: with Settings -> Privacy -> Subscription
accounts off (#1535, or MAGPIE_NO_ACCOUNTS), pluginLogins and All()
drop every plugin provider, but PluginAPIKey, the keyless/key route, was
not gated. The sign-in went through, plugin-auth.json held it, the
Plugins page said signed in, and /api/providers listed nothing, so the
GUI showed "signed in, but magpie can't list it". With accounts on it
signs in and lists fine. v0.1.1847 (the reporter's) has the same code.

The blur: /api/plugin-signin answered user = the plugin's name, Hide
accounts takes every answer's user for an account, and spares only
listed providers' names, so "OpenCode Zen Free" was blurred on the card,
the sheet row and the red line.

Fix:
- publicPlugin: a plugin whose every way in is keyless holds no account
  of the user's. With accounts off it is still listed (pluginLogins,
  All, Accounts), served (Sign) and signed in (PluginAPIKey).
- Any other plugin's key is refused with errAccountDiscoveryOff before
  anything is saved, as its browser sign-in already was.
- /api/plugin-signin's key answer no longer names the plugin as a user;
  the GUI names it from subOf. Hide accounts spares every plugin's id
  and name from providers.plugins.
- providers-accounts.md and discovery.go say so.

Run at the rebased head (792f0f286, then fd80ed99c):
- internal/provider TestPublicPluginListedWithAccountsOff,
  TestAccountDiscoveryOffReadsNoSignIn, TestAccountDiscoverySetting,
  TestPluginKeylessSingleIdentity, TestPluginEmptyKeyOnlyKeyless: ok.
- wsl-run go test -tags nogui ./... -timeout 45m: every package ok but
  internal/agent: TestGrokInstalled (#3548) and TestOmpDetectedWithPiDir
  (#4033), the Linux box's known reds; internal/agent isn't touched here.
- go vet nogui ./internal/provider ./internal/gui for linux and windows,
  darwin for provider; gofmt clean.
- GUI (wsl-run, chromium + webkit, en zh zh-TW ja de, 900 and 360 wide):
  plugin-name-unmasked (new), plugin-keyless-signin, account-eye-provider,
  account-eye, account-mask, privacy-hides-accounts, plugin-moved-signin,
  plugin-other-ways, plugin-signin-no-url, plugin-key-hint, i18n*:
  106 of 106 (on 792f0f286); plugin-name-unmasked and
  plugin-keyless-signin 20 of 20 there too.
- Rebased again onto fd80ed99c (mover mins, Picked only, Kimi, usage):
  the provider tests above ok there.
- A first GUI batch on mote timed out on browser launch at load ~90 from
  other sessions' runners; not a code red, rerun on WSL.

Broken by hand:
- the four provider files back to origin/main: the new test fails "Zen
  Free not listed with accounts off: map[]".
- Sign's exemption alone: "Zen Free not served with accounts off".
- All's exemption alone: "not listed ... map[]".
- PluginAPIKey's gate off: Acme's key is not refused (it goes on to the
  plugin host).
- app.js's plugin-name exemption off: plugin-name-unmasked red 5 of 5
  (chromium).

Not tried: the reporter's own computer; that their Subscription accounts
switch is off is inferred, the one route that reproduces it. A real
request through the gateway with the fixed build and accounts off wasn't
sent; the provider test signs Zen's request. The plugin itself is
unchanged (0.1.18 on npm).
2026-10-29 16:50:17 +08:00