Commit Graph
15 Commits
Author SHA1 Message Date
yetone f3681b90c3 gui: the Agents page says a model's load by the picked model and in its picker (axelburks on Discord)
axelburks (Discord #feedback) could see a model's load only on its
provider's page, too deep to judge which model to pick on the Agents
page. A plugin's reported load (magpie.load) now shows there too, as the
same quiet grey badge the provider page uses:

- by the picked model in each agent's model row, before the chevron;
- on each row of that row's model picker, after the speed.

GET /api/model-loads (speeds.go) answers every fresh load (LoadFresh,
5 minutes) by "provider/model" lowercased, the ref /api/model-speeds
uses: plugin.FreshLoads copies the fresh entries under one lock, and
provider.ModelLoads keys them by magpie's provider id, the user's own
listed id too (ModelIDs), with model@size falling back to its model as
ModelLoad does. With no plugin reporting it is one lock and an empty
map. The page reads it when a model picker opens and with the Agents
page's 15s drift check, each throttled to once per 30s, and the drift
read only while a row shows a magpie model. No new poll; /api/state and
Option are unchanged. The core script stays under its budget
(1,533,802) by shortening comments in the picker and agent-row code;
no budget raised. The
route is named in the CLI's route list (read-only, U) like model-speeds.

Run at this head (rebased on origin/main b4073c06a; the rebase onto
dcc84dbc0 touches none of these files), on mote:
- go test ./internal/gui (TestModelLoadsByRef, TestModelLoadsNoneReported,
  budgets) ./internal/plugin ./internal/provider ./internal/cli: ok,
  except TestEveryRouteHasACommandOrIsNamed's POST
  /api/usage/checkin-account, red on main (#4826, e87140242).
- Full go test ./... -timeout 45m before the rebase: 84 packages ok;
  reds were TestEveryRouteHasACommandOrIsNamed (this route, now named,
  and #4826), TestCodexPoolSaysTheClientsVersion (#4807, full-package
  run only) and TestMainWindowCorners/macOS_26_SDK (#3949, macOS 27).
- go vet for darwin, GOOS=linux -tags nogui and GOOS=windows on
  plugin, provider, gui, cli: ok. gofmt -l: clean.
- agent-model-load.test.cjs: chromium and webkit, 1000 and 440px, en,
  zh, zh-TW, ja, de: 40 of 40. Screenshots looked at in both engines.
- Whole GUI suite: not finished. Three whole-suite runs (WSL, mote) were
  cut at 1,266 and 642 tests by load and a session restart; their reds
  were all in provider-editor, Settings and Usage files. Then the files
  a new API call or the Agents row can reach (183: every agent-*, every
  model/picker/speed/load file, the five strict-fixture files, every
  file using .field, ag-open, renderAgents or /api/drift, i18n-keys),
  split mote/WSL, both engines: reds only in model-chip-steady (#4388),
  mobile-web (#3952), model-copy-id (#4621), balance-fix (#4683),
  allow-ips (#4357, output added), agent-update-all (#2988), account-eye
  (#4244), models-works-only, models-select-all-api, model-suffix-own,
  provider-detect-models, provider-models-rest, remote-magpie,
  routing-rule-models, usage-speed (WebKit on WSL, #4218/#4471). Each red
  file was run alone at this head and at origin/main b4073c06a: the same
  reds both sides, except agent-update-all's fixed 200ms wait (#2988),
  red once at the head. codex-subagent-model, red under load, passed
  alone.

Broken by hand, each red, then restored: the picker row's badge line,
fieldBtn's badge line (red at the renderAgents redraw check), the
readLoads painter, and ModelLoads' listed-id loop (TestModelLoadsByRef).

Not tried: a real plugin reporting load in the live app; the tray panel
layout; WebKitGTK in the real Linux app and the Windows app.
2026-11-03 05:21:47 +08:00
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 1198cff601 gui: a model picker's row says how fast its provider answered this week, fastest first under a search
axuhere on X: with several providers serving one model, the list and the
model picker should show each one's speed and sort by it. Each row of an
agent's model picker now carries a quiet tag from the usage ledger's last
seven days: tokens a second, or the first token's wait when only that was
timed (title: "first token in Xs, N tokens a second"). Under a search,
rows that match equally go fastest first by about how long a 200-token
reply takes, the untimed last. Without a search the rows keep catalog
order, grouped by provider. "Fastest first" for a routing group already
existed as Speed first (d9a8148d7); nothing added there.

- GET /api/model-speeds (internal/gui/speeds.go): usage.SummarizeTop(Week)
  models by provider/model, the catalog ref an option carries; a model
  whose calls went to more than one host is left out.
- app.js: readSpeeds (once a minute, on a model picker opening, re-filters
  keeping the cursor), speedRank, speedTag. Existing i18n keys only.
  app.js 1,304,233 under its 1,311,735 budget, no raise.
- menu-scroll's strict fixture answers /api/model-speeds.

Run, at this head (rebased on bb3565309) unless said:
- mote: go test -run 'Budget|TestModelSpeedsByRef' ./internal/gui ok;
  go vet ./internal/gui darwin ok, GOOS=windows ok.
- picker-speeds.test.cjs: Chromium 1000/440px x en, zh, zh-TW, ja, de 10/10
  on mote; WebKit 10/10 on the Linux box (wsl-run), because WebKit launch
  hangs on mote at present (many pw_run.sh from several sessions, 0 WebKit
  processes). i18n-keys 4/4.
- Broken by hand: speeds.go without TPS -> TestModelSpeedsByRef red;
  filter() without the speedRank tie-break -> picker-speeds red
  ("fastest first, the untimed last").
- 57 other GUI files that open a model picker, Chromium, at the pre-rebase
  tree, concurrency 4 on mote at load ~30-40: 185 pass, 180 fail. One was
  real (menu-scroll's "Unexpected API: /api/model-speeds", fixed here); the
  rest were 5000ms locator timeouts and 11 WebKit launch timeouts. A rerun
  of those files at concurrency 2 was still running at push.

Not tried: native Linux go vet (the WSL box lacks gtk4/webkitgtk dev
packages); the real app with a real ledger; the full GUI or Go suite.
2026-10-29 17:09:13 +08:00
yetone e8e9245ecf agents: Install another agent says Plugins has more agents, and opens them
The owner, on the Agents page: 因为我们支持Agent插件了,这里是不是也应该
显示插件中有更多? Install another agent listed only the agents magpie has
an install command for; the agents a plugin adds were nowhere on that page.

- GET /api/plugins/agents names the suggested agent plugins (the market's
  kind "agent") not installed here. One installed but turned off, or
  pinned to a version, counts as installed: Plugins turns it on.
- Install another agent counts them in its header and ends with one row,
  "More in Plugins" with their names, as the Providers add sheet does for
  subscriptions. The row opens Plugins › Discover scrolled to its Agents,
  only while the click is fresh (scrollOnPurpose), on the section drawn
  last, since npm's answers draw it again.
- The list is fetched beside the install commands, not before them, so a
  slow market never holds the commands back. With no install command left,
  the section shows the plugins' row alone and no install note.
- Budgets: app.js 1,311,681 and the core 1,530,449 (+1,430 / +2,408 over main),
  the Agents page and Plugins page are the core's own, no room added.

Run at this tree, rebased on e2efbd357 (on mote):
- go test -tags nogui ./internal/gui -count=1: ok (budgets included);
  GOOS=linux and GOOS=windows go vet ./internal/gui: ok; gofmt -l: none.
- TestPluginAgentsNotInstalled: a fake registry with every kind, installed,
  turned-off and pinned agents; all installed gives [], never null.
- agent-plugin-agents.test.cjs: chromium and webkit, en zh zh-TW ja de,
  1100 and 420px: count, row order, words, tooltip, one line, name not cut,
  no sideways scroll, the click landing Agents at the top and staying.
- 69 GUI files that reach this (install section, Plugins Discover, strict
  fixtures, i18n), 1044 tests: 1033 pass. The reds were i18n-keys' #4053
  (fixed in the next commit) and mobile-web, whose copy had no .git for
  origin/main; run again with one fetched (d4f1d64): 30/30.

Broken by hand: main's assets under the new GUI test, 11/11 red; the
scroll line taken out, 11/11 red (webkit); the Go installed filter taken
out, TestPluginAgentsNotInstalled red.

Not run: the whole GUI suite (mote was busy with other sessions' suites),
and the real app with the live market.
2026-10-28 22:34:52 +08:00
yetone b9f790d37b plugins: panels in magpie's pages, a page that replaces a built-in one, titles in the window's language, and a look that matches
P5 of the plugin runtime (docs/subsystems/plugin-runtime.md):

- Panels (magpie.panels): a plugin draws a frame into a slot of a
  built-in page (a provider's editor, Settings, Usage); magpie.context
  says where it is, and the frame is as tall as what it draws.
- A page can replace a built-in one (magpie.page.replaces); show() opens
  it in that page's place, and the sidebar row goes to it.
- page.titles and a panel's titles name it in the window's language
  ({"zh": …}); a malformed map is dropped, the title kept
  (TestWindowTitles).
- main's #2501 already names wails:// in the policy of a page in the
  desktop window (through ownWindow), which is why the usage page drew as
  bare HTML from v0.1.1259. TestPluginPageLoadsItsFilesInTheWindow loads
  a page through ownWindow in a real WKWebView, which Playwright on http
  can't; the subsystem page says how.
- The bridge adds magpie's look for what a page leaves unstyled, every
  rule in :where() so any rule of the page's wins, and the theme's
  colours as --magpie-* variables.

One commit: the panels, the replacing pages and the titles share hunks
in page.go, pluginpage.go, pluginpages.js and the docs, and couldn't be
split cleanly.

Run:
- Full: this series (P5, the Plugins dot, the probe test, P6, and a
  built-ins-on commit since dropped for main's own 5a2414acd) was run
  together, at load 200-660.
  At the pushed tree, 88dfab2d3 on origin/main 5380114da (rebased
  from 210bc2b77, no conflicts; its GUI assets and tests are the same
  bytes as the tree the GUI runs below used, diff -rq): gofmt clean,
  vet darwin/linux nogui/windows ok, TestCoreScriptBudget ok
  (1,446,845 of 1,447,000). go test -timeout 45m ./... at load
  193-278: 62 packages ok, red in TestMainWindowCorners (#1936) and
  TestPluginStreamLargeReplies JSON_fast (client timeout; alone 1 of
  3 red here, 0 of 3 on 5380114da side by side at load ~280; the
  series doesn't touch the stream path; #2551 reopened with the
  output, taken). Two earlier runs at this tree are discarded: one
  stopped when the disk filled, one when another session's go clean
  -cache emptied the build cache mid-run. The whole GUI suite at
  this tree was not finished (the disk filled); the files the series
  reaches ran (1318 tests, 124 red), and the 39 red files ran again
  at concurrency 1 on both trees: here 148 ok 120 red, origin/main
  135 ok 127 red. Both sides' reds are page.goto/launch timeouts
  under load (66 here, 71 there) and the same assertions:
  title-bar-tools' and settings-proxy-auth's "access control checks"
  on a cut-off /api/providers read (#2740, taken next), sidebar's
  "the list unrolls" and WebKit "#prefs pressed darkens" (#2684;
  alone, 1 red here, 3 on main), side-toggle (#2732); plugin-move
  red on main only. Six files again one by one on both trees:
  plugin-actions red 1 of 6 here, a 5s goto of ?view=plugins at load
  260; plugin-clash red on both; plugin-own-icon, plugin-gateway,
  plugin-checkin ok on both; settings-proxy-auth ok here, 3 red on
  main.
  At 976c9893a (on origin/main 6f950653f): go test -timeout 45m ./...
  red only in TestMainWindowCorners (#1936, the window's process
  killed at its deadline) and TestSetAnswersWhileDevinAndProvidersHang
  (#1375, 3 of 3 alone). The whole GUI suite, both engines: 10834
  tests, 237 red in 73 files, 184 of them a 180s browser launch. Those
  73 files run again at concurrency 2: 52 green, among them every
  plugin-* and agent-* file and plugin-actions; the 21 still red were
  run at origin/main f191d6423 and are red there too: codex-predictions
  (#2624), lightweight (#2638), segs-glide (#2683), usage-agents-hide
  (#2276), provider-advanced-fold (#2552), routing-bodies (#2559),
  routing-model-rest and rest-try-now (#2115, #2564), routing-keys-fold
  (#1612), routing-wb-restricted (#1905), routing-request-metrics
  (#2571), quota-count-wrap and quota-name-translated (#2228), s3-sync
  (#2448), usage-checkin (#2549), usage-ledger-abort (#2700),
  tencent-access-key (#2733), usage-range (#2734); side-toggle's WebKit
  motion red 1 of 3 on main, 0 of 3 here (#2732); usage-fold green alone.
  Rebased onto origin/main 717b69f78 (60725faa1, no conflicts): gofmt
  clean, vet darwin/linux nogui/windows ok; go test -timeout 45m ./...
  red in TestSetAnswersWhileDevinAndProvidersHang (#1375) and agent and
  gateway at the 45m alarm with tests still moving at load 400+, both ok
  alone (1173s, 1167s); 105 GUI files the series reaches (plugin*,
  sidebar*, side-*, settings*, title*, header*, agent-*): 1322 tests,
  23 red, run alone 214 of 218 ok, the 4 left in sidebar and
  sidebar-overlay-scrollbar (WebKit), red on 717b69f78 too (#2684,
  #1863). The whole GUI suite was not run again after the rebase.
- plugin-panels' tall panel (body{margin:0}) measured 220, not 180,
  after the look above gave an unstyled body 20px of padding; the
  fixture now sets padding:0 too, as a page that wants none would.
  plugin-panels ok in chromium and webkit after.
- gofmt -l clean; go vet darwin, linux (-tags nogui) and windows ok.
- GUI: plugin-page and plugin-panels in chromium and webkit, en zh zh-TW
  ja de, wide and narrow, ok.
- Broken by hand, each red then green: titled() in pluginpages.js
  (the "draws in its frame" test), the wails:// scheme in pagePolicy
  (the WKWebView test, before the rebase onto #2501), titles' parsing
  (TestWindowTitles).
- Real use: the published @magpie-community/page-usage 0.1.1 in a
  sandbox magpie window, its tiles styled.
2026-10-18 07:13:09 +08:00
yetone a61a6f9546 gui tests: menu-scroll's fixture answers /api/plugin-pages
menu-scroll has been failing 24 of 24 on main since 64b0f3a20 (10-15). That commit has the sidebar ask /api/plugin-pages for community plugins' pages. menu-scroll's route handler asserts on any API it doesn't serve, so it threw "Unexpected API: /api/plugin-pages" and closed the browser under every case. The fixture now answers with an empty list, meaning no plugin pages.

This changes the test only, not the app.

Run on b6533893a: menu-scroll failed 24 of 24 before the change. After it, the test passed 24 of 24, twice in a row, in chromium and webkit.
2026-10-16 02:01:29 +08:00
yetone 8dcb90873d gui tests: menu-scroll waits for the menu's opening to finish before it clicks its scrollbar
A click on the scrollbar's track while the menu was still opening landed
nowhere now and then, in both engines. It was red in 5 of 8 runs on
a75de4c21. scrollMenu now waits for the page's animations to finish
first.

Run: menu-scroll.test.cjs, 10/10 runs.
2026-10-13 20:39:39 +08:00
yetone 18e82adc62 gui: the window's pages down a sidebar in groups, the open page's tabs under it, and a button to have the header's tabs instead
From 1024 points wide (SIDE_AT) the window lays its pages down the left
as a Mac app's sidebar: Work (Agents, Sessions, Library), Models
(Providers, Routing, Gateway), Insights (Usage), Extend (Plugins), with
Settings and the gateway's address at the foot. The open page's own tabs
(Usage, Library, Plugins, Settings) are listed under it, opening and
folding on an iOS-like spring, and the page's strip is hidden. The header
becomes a breadcrumb, and pages whose head held only tools have them in
the title bar. Graphite: the open page is in the text's ink, not purple.
A pressed row darkens and never shrinks. The selection under the tabs
sets off as the row is pressed, on a 0.3s curve (it felt behind the
finger), and is the list's only shape: a sub-row hovered or pressed has
no ground of its own, which showed a block under the finger before the
selection slid there. The page's tab is clicked at once, so what is
typed next goes to it.

The title bar's button (or ⌃⌘S, Ctrl+Shift+S), there at every width,
picks the sidebar or the header's tabs. The choice is kept in
localStorage magpie.navLayout (side or top) at every width, so it is laid
out from the first frame; picked in a narrow window the sidebar is 184
points under 860. The two trade places in
a view transition: the sidebar slides, each tab flies to its place, and
the page slides as one. Without view transitions or under reduced
motion, the change is at once.

With nothing picked, narrower than 1024 the page beside a sidebar would
be narrower than Usage's requests table needs, so the header's tabs come
back. A resize
drops what a click held (heldWidth). Usage's KPI strip goes two to a line
by the room the page gives it (a container query), and Japanese counts
wrap there. Tests whose window is 1024+ were updated for the sidebar,
and docs/subsystems/gui-shell.md says how it works.

Run: sidebar.test.cjs and side-toggle.test.cjs 16/16 in chromium and
webkit, in en, zh, zh-TW, ja and de. Each was broken by hand (press
shrink, address cut, press glide, sub-row ground, view transition, kept
choice) and went red. Every page at 560 points with the sidebar picked,
zh and de, both engines: nothing scrolls sideways. session-identity's
ledger row sits under the footer beside the sidebar; WebKit's click
doesn't scroll to it, so the test wheels it up first. Animation frames were checked from a recorded video. The 105
affected GUI files in both engines; their reds were rerun alone and fixed
(filter-ime: the sub-row's click now at once; session-identity, above) or
fail the same on main (tray-logos). The full GUI suite in chromium, on
the rebase onto d5cae267a, was cut short at 352 tests on the owner's
"ship": 6 reds (account-alias, account-models, codex-auto-review,
codex-credits, context-text) each pass alone, here and on main d5cae267a,
so they are timing under the full run's load and are to be filed. After
rebasing onto e4e22b23e: sidebar, side-toggle, session-identity,
filter-ime, library-instr-busy, usage-speed-count and view-scrollbar,
50/50 in chromium and webkit. go build ./... passes.
2026-10-12 00:41:34 +08:00
yetone b2b72ea026 menu-scroll test: its fixture answers /api/upstream — the test failed 24/24 on main (Chromium and WebKit, every case "Target page, context or browser has been closed") since 2a990175 (#971), which has the Usage and Providers pages ask /api/upstream for the vendors' status pages. menu-scroll's route handler asserts on any API it doesn't serve; that assertion ("Unexpected API: /api/upstream") was an unhandled rejection, which ended the test, and its after hook closed the browser under the first gesture, so every later case failed on page.goto. The fixture now answers it with no vendor readings, as a page that couldn't be read marks nothing. No other GUI test throws on an unknown API without serving /api/upstream. No app change. menu-scroll passes 24/24 three runs in a row (it fails 12/12 Chromium at 2a990175 and passes 12/12 at its parent 62f9612b); click-scroll passes 18/18. 2026-10-06 14:25:14 +08:00
yetone 76dc5aed48 gui: Routing flies a request still under way when the page's first frame came before the trace, and the Requests table's sideways scrollbar goes once the table fits; GUI tests brought up to date with the app
Two app bugs, found where GUI tests failed on main in Chromium:
- Routing: the page's first frame looked for requests to fly before the first trace had come in, found none, and nothing flew them after it came, so a request still under way when Routing opened never reached its member's row (routing-try-fixed failed every run). The first trace now flies those under way when a frame has already been drawn, as coming back into sight does (underWay, shared with resume).
- Usage › Requests: a table that had come to fit its window (led tight) kept #ledHScroll's bar under it with nothing to scroll; ledGrow now redraws the bar on every resize, not only when it leaves columns out (usage-speed "no sideways scrollbar").

Stale or racy tests, the app right:
- library-own-folder, list-sort, shared-skills and nine other Library tests counted the loading skeleton's rows (the "5 vs 4 rows" and the empty lists were the skeleton, not the repo group headers); they wait for .lib-body:not(.lib-skel). library-own-folder's 61px scroll was Playwright's own retry on a button still sliding in, not the app (no scroll setter ran): it waits for the entrance to finish.
- sessions-overview measured the picked bar while the folder's overview redrew the bars; it measures once the overview is in.
- menu-scroll: its agent needs wired and a ref to show a model picker, and the page now asks plugins/updates, usage/quotas, agents/install and whatsnew.
- routing-sessions' large-history tests failed from local midnight until the UTC offset passed: the fixture's times were UTC while the gateway writes local times with their offset, which openRoute takes the day from.
- ledger-hscroll and view-scrollbar measured scrollbars in Chromium launched with --hide-scrollbars; they launch without it, as menu-scroll does.

routing-try-fixed and usage-speed fail without the app changes and pass with them (checked by putting origin/main's routing.js and app.js back). go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass (TestHostJSCancellation timed out once under the full run's load and passes on its own, 3 runs).
2026-10-06 03:20:34 +08:00
yetone 9d4f420d27 sessions: the search sits at the right of Latest sessions, the list it filters, and the indexing show waits for a real index run instead of replaying on every catch-up read (Image #14: 搜索会话的输入框不应该在这里吗; 会播放两次或甚至多次正在为你建立索引的那个百分比动画) — the search box moves from the filter bar into the Latest sessions heading's right, and it stays visible with an empty-state line when nothing matches, so the query can be cleared. Every reload or range change re-read the few session files agents had written to since the last read; each short read counted as indexing and replayed the percentage show. The show now appears only once indexing has run for 0.7s, and once it has shown it runs to the end. Tested in sessions-overview.test.cjs, Chromium and WebKit, en and zh: the search inside the heading at its right edge and centred on it, filtering, no-match and Escape; a 0.4s run shows no hero and a 2s one shows exactly one (fails with the delay at 0). menu-scroll's outside click now lands on the filter bar. menu-scroll, old-webkit, go build -tags nogui (and GOOS=linux, GOOS=windows) and go test -tags nogui ./... pass. 2026-09-30 01:15:58 +08:00
yetone 41841997d6 sessions: a fast index with an animated first run, searchable model and folder pickers, and the overview's session shape, tool use, top skills and heatmap by messages or output tokens (v: 感觉我们的Session可观测性页面也要做的这么的丰富、优雅、简洁…; 顶多第一次打开顶多需要个1分钟,然后之后都是靠索引能够极快的打开; 一定一定要特别炫酷的一个动画; Image #6/#7/#8)
The index: session files are read in parallel and each line told from its first bytes (a Claude line's type, message head and usage; a Codex line's type and payload), so tool results, attachments and compactions are never decoded; a cold index of this machine's sessions takes about 32 s, then the page opens from ~/.cache/magpie/sessions.json (version 4, which re-indexes once) and only changed files are read again. The page keeps showing the last answer while a fresh one is computed, and GET /api/sessions/progress says how far a first run is, which the page shows in an animated hero instead of a spinner (reduced motion respected).

All models and All folders are searchable combo boxes that draw only the rows in sight, so 13k folders open at once.

Each day now counts the prompts typed, replies, tool calls by name and skills called (a subagent's calls and tokens count, its messages don't). The overview adds:
- Session shape (会话形态): sessions by messages (1–5 … 121+), minutes at work, or autonomy (tool calls a prompt, <1 … 21+), toggled and remembered;
- Tool use (Tool 使用): calls and sessions, the top tools with their kind's dot, calls, sessions and share, the kinds (Bash, Edit, Read, Write, Grep, Glob, Task, MCP tools, other) as a stacked bar and by week;
- Top skills (常用 Skills): each skill's calls, sessions, last use, agents' share and projects;
- the activity heatmap by Output tokens (输出 Token) and Messages (消息) beside Tokens, Sessions, Cost and Active.
No border stripes; a toggle leaves the page where it was.

Tested with TestStatsToolsAndSkills (Claude reply blocks laid out both ways, a Skill call, an MCP tool, /clear, an interrupt, a subagent; a Codex rollout's function and custom tool calls) and the stats tests, and internal/gui/tests/sessions-overview.test.cjs in Chromium and WebKit, en and zh: the new metrics and their tips, the shape's buckets and toggles (the page not moved), the tools' rows, kinds and weeks, the skills' lines, nothing overflowing at 1100 and 560 px. go vet, go build -tags nogui (and GOOS=linux, GOOS=windows), go test -tags nogui ./... and the GUI suite pass (panel-fold flaked once in the parallel run, passes alone).
2026-09-29 23:17:43 +08:00
Liken Tan dc4363acb6 fix: a picker's own button closes it on a second click (#218) 2026-09-29 21:39:04 +08:00
yetone fe2269288c agents: each agent's CLI shows its version and updates in one click (#202 JoeyMa-zh: Agents 页面增加"更新 CLI"功能 — 检查各 agent CLI 的版本并一键更新) — the Agents page now puts each CLI's installed version after its name (read with <cli> --version, 10s timeout, no stdin) and, when a newer one is out and magpie can tell how it was installed, a small "Update to x.y.z" pill. How it was installed comes from the resolved binary: the vendor's own installer first (Claude Code's ~/.local/share/claude/versions → claude update, Codex standalone → codex update, ~/.opencode/bin → opencode upgrade), then a global node_modules (bun, pnpm, else npm, run as npm install -g --prefix <prefix> pkg@latest with that prefix's npm, and only where the prefix is writable), then a Homebrew formula or cask allowlisted per agent (brew upgrade [--cask]); anything else shows the version alone, with no button. The latest comes from the npm registry or brew info --json=v2 (no auto-update), cached 6h (15min after a failure); installed versions are cached by the binary's path, size and mtime. GET /api/agents/cli waits at most 3s and says pending, and the page asks again; POST /api/agents/cli/{id} runs the update (one at a time per agent, 10min cap), reads the version again and says so if it did not change, or gives the command's last lines when it fails. The pill goes busy in place and the page never scrolls; not in the tray panel. zh strings added. Tested with a new internal/agent/cliupdate_test.go (version order and parsing; npm/bun/pnpm/brew formula and cask/native installs, a read-only prefix, a local node_modules and unknown binaries in a fake PATH; an update against a fake registry and updater) and a new internal/gui/tests/cli-update.test.cjs in Chromium and WebKit (versions, pills only where magpie can update, row heights, an update with the view scrolled, a failing one, zh). No real update was run. go build (nogui, GOOS=windows, GOOS=linux), go test -tags nogui ./... and the GUI tests pass 2026-09-29 17:56:43 +08:00
SadWood 70f2153463 test: 修正跨平台测试路径并补充下拉菜单回归 (#145)
WorkBuddy 测试固定使用 macOS 登录文件路径,导致 Ubuntu 无法读取测试账号。按当前系统选择测试文件目录,保留账号读取、刷新和加密凭证的原有断言。

为已合并的下拉菜单修复补充浏览器回归,覆盖滚轮、滚动条、键盘选择和关闭行为,测试数据使用中性名称。
2026-09-28 18:00:38 +08:00