Commit Graph
5 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 9f5812f3cf agents: an update says each agent's version from and to (37FlowAI on X: "更新后 显示一次各 Agent 的版本变更列表: 例如 Pi 从 v1.0x 更新到 v1.10")
Update all's line, when the run is done, and its toast now list every
agent it updated with the versions it went from and to ("2 agents
updated: Codex 0.155.1 → 0.159.0, Crush 0.3.0 → 0.4.0"); with some
failed, the ones that went well are listed before the ones that didn't.
The line stays one line (cut short when narrow, so the list under it
doesn't move), and its tooltip has each change and error on its own
line. A row's own pill says "Codex updated: 0.155.1 → 0.159.0".
Three new strings, in zh, zh-TW, ja and de.

Run: agent-update-all and cli-update in Chromium and WebKit (14 pass in
each); the new checks fail on origin/main's app.js (5 fail). A new
case updates two agents in en, zh, ja and de, and checks the line at
420 wide keeps its height with no sideways scroll. gui-de, gui-ja,
i18n-keys, cli-behind, click-scroll and agent-cli-missing pass in both
engines (22 each). Not tried in the real window with real CLIs behind.
2026-10-09 11:01:11 +08:00
FanbuzandClaude Opus 5.5 3ce0a0bf27 fix: 收敛中文界面文案 (#846)
删去中文提示里的过程叙述和动机解释,保留数字、条件和后果;同步更新相关测试的中文断言。

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 10:27:19 +08:00
yetone d51d314ac5 agent: with no Node.js on the machine, Install another agent's npm commands install Node first, in the same line (#727, Sun1090 on v0.1.801: "没写curl的命令… curl xxx && npm xxxx", confirmed as option 1 — Pi, Copilot CLI, Crush and the rest had only npm install -g …, which a new machine without Node can't run) — installCommands now takes whether npm is here (nodeHere: exec.LookPath("npm"), then the folders proc.UserBinDirs knows — nvm's, fnm's, mise's, volta's, Homebrew's, the ~/.npmrc prefix — and on Windows also the registry's PATH (proc.LoginPath) and %ProgramFiles%\nodejs; npm.cmd there), and where it isn't, npmInstall gives on a Mac or Linux export NVM_DIR="$HOME/.nvm" && mkdir -p "$NVM_DIR" && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash && . "$NVM_DIR/nvm.sh" && nvm install --lts && npm install -g <pkg> (nodejs.org's nvm route; NVM_DIR is set because the installer goes by $XDG_CONFIG_HOME/nvm when that is set, and nvm.sh is read in the same shell since the profile line only reaches new terminals; nvm's Node is the user's, so no sudo), and on Windows, for PowerShell, winget install -e --id OpenJS.NodeJS.LTS; $env:Path = <Machine + User Path from the registry>; npm.cmd install -g <pkg> (";" as Windows PowerShell 5.1 has no "&&", PATH re-read since the MSI only adds Node to new terminals, npm.cmd since npm.ps1 is refused under the default execution policy). Each such command carries node (nvm, nvm-mac or winget); the row labels it "Node.js + npm" and the note says the npm commands install Node with nvm/winget first — on a Mac that nvm's installer stops without Xcode's Command Line Tools (run xcode-select --install), on Windows to run them in PowerShell and open a new terminal if npm still isn't found. With Node here everything is as before. magpie still only shows commands to copy (the list never had a one-click install; the page's Update all/update pill run only for CLIs already installed, unchanged). The via column is 84px so "Node.js + npm" stays on one line. TestInstallCommandsWithoutNode (Pi on darwin/linux/windows, Claude's installer untouched, npm alone with Node), TestNpmIn and TestInstallWithoutNodeParses (bash/zsh/sh -n read the line) are new; agent-update-all.test.cjs gains "no Node.js here" (label, note with/without Xcode, the whole line copied, no sideways scroll, winget note in Chinese) and passes in WebKit (8 tests). go vet ./internal/..., builds (darwin, GOOS=linux -tags nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass but for TestCursorSignInJoinsAWrappedLink, which timed out under load and passes alone. Nothing was installed: the commands were only parsed, not run, and not tried on a machine without Node. 2026-10-04 10:13:55 +08:00
yetone e85886c760 gui: the Agents page updates every agent's CLI at once, and lists the agents not on this machine with their vendors' install commands (#727, Sun1090: on a new machine with no agent installed magpie gave no install commands or how-to, and agents updated only one at a time, where cc-switch has both) — Update all: with two or more CLIs behind (#202's cliInfo update), a line above the list says which and offers Update all, which runs the existing per-agent update (POST /api/agents/cli/{id}, updateCLI, now returning why it failed and quiet for the run) for each, one after another (two global npm installs at once can trip over each other's folders), each row's pill busy in its turn, then says how it went ("2 of 3 agents updated · 1 didn't: Gemini CLI", the errors in its tooltip and the status pill). Once shown the line stays until the agents are read again (load), saying what is left ("Crush has an update", "Every agent is up to date"), so neither its click nor a row's own pill moves the list under the reader. Install: agent.Installs (internal/agent/install.go) lists the agents magpie knows that aren't detected (not WSL twins) with their commands: the vendor's installer first where its docs give one (Claude Code's claude.ai/install.sh, install.ps1 on Windows; Codex's chatgpt.com/codex/install.sh, install.ps1, and brew --cask codex on a Mac; OpenCode's opencode.ai/install; Gemini CLI's brew formula), then npm install -g of the package cliSpecs already updates from (pi, omp, copilot, crush, cline, omo too); GET /api/agents/install serves it. Under the list, "Install another agent (n)" unrolls them (open when no agent is here at all), each command with a copy button and a note that npm needs Node.js and magpie lists the agent once installed. magpie doesn't run the installs: a new machine may have no Node.js or Homebrew yet and the update machinery derives its command from where an installed binary is, so the commands are to copy. zh strings for every new one. TestInstallCommands and TestInstallsOnlyMissing pass; agent-update-all.test.cjs (webkit: Update all runs three in order never two at once, a failure named, the page and list not moved, a row's own pill leaves the line in place, one behind gets no Update all, the install list folded under the list without the installed Codex, copy sends the command, open with no agents, Chinese) passes and fails on the old code. Webkit agent-connect, agent-connected-unfolded, agent-disconnect, agent-grip, agent-layout, agent-tweak-fold, click-scroll, copy-command, show-unset-agent, panel-fold, cli-behind pass; cli-update's tight-row subtest fails the same on the old code. go vet ./internal/..., go build -tags nogui ./..., GOOS=windows and GOOS=linux builds pass; the full go test under a temp HOME was not run here (the sandbox refused the HOME override) — internal/agent's install/version tests and internal/gui's asset tests pass. Not tried in the reporter's app. 2026-10-04 07:58:09 +08:00