Commit Graph
640 Commits
Author SHA1 Message Date
yetone dbbb2f26b1 groups: free: takes the models a catalog marks free (#5903)
A routing group's pattern may now start with free: (provider.FreePrefix):
free:workbuddy/* is, of the models workbuddy/* matches, those whose
catalog entry says free (Entry.Free, the vendor's or plugin's own flag as
the catalog was last read). The rest after free: is a glob, a re: pattern
or an id, matched as on its own, so free:re:workbuddy/hy.* works too. It
is expanded where every pattern is (matchesIn, PatternHits) each time the
groups are read, from the catalog magpie already keeps: no request to a
vendor, and a model the next list marks free joins without a save.

Only the flag decides. A $0 price (PricedFree), a rate of 0, an account
named Free or "free" in an id never counts; the test holds a
deepseek-v4-free id with no flag, a rate-0 model and an or/y priced at $0
out. Existing patterns read as before: openrouter/*:free still means ids
ending in :free (that is why the rule is a prefix, not a :free suffix),
and a provider's AutoInclude takes no free: (isIDPattern).

GUI: the Routing editor's pattern box counts and lists a free: rule live
as it does any pattern (patternTest in plugins/routing/client.js, from
groups.models' free), refuses "free:" alone, and one hint line says the
flag is the last catalog's, not a promise of no charge, in en, zh, zh-TW,
ja and de. CLI help, docs/subsystems/providers-accounts.md and the site's
routing-groups page (en, zh, ja) say the same.

routing-levels.test.cjs: the Advanced hint line made the editor taller,
so the second group's Levels row opened under the editor's sticky foot
and the click landed on the foot (webkit en). The test already wheels to
that row for its first group; it now does for the second too.

Run:
- TestGroupFreeRule, TestFreeRuleSyntax and the existing pattern tests
  pass. Broken by hand: with groupmatch.go and autolist.go from
  origin/main both are red (no members for free:workbuddy/*, IsPattern);
  with takes() ignoring the flag, TestGroupFreeRule is red (all six
  WorkBuddy models matched).
- group-free-rule.test.cjs (new): chromium and webkit, en and zh,
  green; red with origin/main's client.js.
- go vet ./... (darwin, mica), GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...: clean. gofmt -l: nothing.
- Full suite go test -tags nogui -timeout 45m ./... on Linux (WSL
  magpie-desktop) at 1e180c630 (this change on ac4a4cf84): 102 ok, no
  FAIL. Not run whole on macOS: mote had another session's GUI suite
  and mica's disk was full (2 GB free; a run there failed on "no space
  left on device").
- At the pushed head 6801ae683 on Linux: internal/provider, cli,
  plugin, agent, gui packages; group-free-rule, group-patterns,
  routing-levels, gui-zh-tw, gui-ja, gui-de: all ok, 21 tests pass.
- GUI: the 182 files that reach the Routing page or i18n, on Linux at
  d55680755's tree: 2805 pass, 112 fail in 21 files. The same 21 run on
  origin/main cb4ad12bd: 102 fail in 18 of them. The three red only
  here (input-look, search-keys, routing-levels) were rerun at
  concurrency 2: input-look and search-keys green, routing-levels red
  from this change and fixed above (green 2 of 2). Reds on main, filed:
  group-editor-selected #5049, i18n-keys #6877, codex-memories-settings
  #6372, inner-scroll-contain #4689, grip-inset #6293, and the rest in
  #4120's class; form-align newly filed as #6894.

Not tried: a real WorkBuddy account's catalog (the flags come from the
plugin's list, as the test's fixture has them); the GUI files on macOS.
2026-11-17 02:19:48 +08:00
yetone b0674b9ec4 providers: a key's balance shows on its row, as Usage last read it
lyj1115 on X: magpie found the relay's balance (the probe), but the
Providers row showed only the API key; the figure was on Usage alone.

The row's quiet facts line (host · models) now ends in " · $10472.14",
in the line's own colour and size, with "Balance $…" as its tooltip.
Several keys' balances are added up as the Usage card's head adds them
(shared balances counted once), else the key in use's. A failed read, a
signed-in account (its windows are on Usage) and Usage turned off show
none. Opening Providers asks for Usage's own read (never ?asked=1, so
"read only when asked" holds) when it is over a minute old, as Routing
does (#1833); rows are marked after the list is drawn and after a read.

rowBalance, markBalances and keysSum/keysSumTip live in
plugins/usage/page.js (keysSum moved out of app.js) so app.js stays
under its code budget without a raise; app.js calls markBalances?.().
No new words, no CSS.

Run (mote, at this tree rebased on origin/main 6cc7402bd):
- provider-row-balance.test.cjs: 24/24 green, chromium and webkit,
  en zh zh-TW ja de at 900 and 420px, and Usage off.
- Broken by hand: against origin/main's assets (MAGPIE_ASSETS) it is
  22 of 24 red (no .pv-bal); only the Usage-off cases pass.
- go test ./internal/gui -run 'TestCoreScriptBudget|I18n|Words|Asset|Budget': ok.
- i18n-keys, i18n-en-no-cjk and 12 provider-*.test.cjs files: 329 pass,
  1 red: i18n-keys "a plugin's words are its own" (routing's ", with an
  image"), red the same on origin/main 6cc7402bd, filed as #6877.
- A 218-file GUI batch (provider, routing, balance, usage-keys,
  usage-shared-balance, i18n) was still running on mote at push time;
  new reds against origin/main get issues when it ends.
Not tried: the real app with a real relay's probed balance.
2026-11-16 23:11:36 +08:00
yetone 8608ce0243 gui: the sticky tab strips are drawn only under scrolled rows, rounded and evenly inset (CHENGJIAHEGOXIS on X)
Over a background picture the Library tab bar showed a square frosted box
around the rounded tabs, 16px out at the sides, 8 at the top and 4 at the
foot. The strip behind the tabs (Library, Plugins, Settings, the Add
sheet) is now drawn only once rows scroll under it (.stuck), fading in
with opacity, so at the top only the track shows: radius 7, an even 2px
around its 5px pills. When drawn, it sits 4px out from the tabs with
radius 11 at its foot (Library, Plugins), and 6px out with radius 13 in
Settings and the Add sheet.

Run: shots in Chromium and WebKit, light and dark, with and without a
wallpaper, at 1280 and 640, at rest and scrolled, before and after
(strip opacity 0 at rest, insets 4/4/4 when stuck). Full GUI suite at
18ec1674a on mote: 1041 fails across ~118 files; those files at
c4d64a70b (origin/main): 971 fails, same files. market-have, models-fold,
key-replace and plugin-card-update, red only in the head run, were rerun
alone: market-have 3 of 6 red at base, 0 of 6 at head; the others fail
the same at base. Not tried: a real Windows WebView2 window.
2026-11-16 21:16:36 +08:00
yetone 34606000da gui: the tray panel's Usage tab ends in a heatmap of recent weeks (eiyuuzaki2333 on X)
Asked for "a heatmap like GitHub's / Codex's, also in the tray". The
window already has one (Usage › Requests, 53 weeks, #1369), so no second
copy goes on the Overview, which counts gateway calls only while the
heatmap counts session-file calls too. The tray panel had none.

The panel's Usage tab now ends in a card of the recent weeks, one cell a
day, Monday on top, as many weeks as the card fits (8 to 53: about 25 at
the panel's 440, 17 at 320). It goes after the chart and ranking, so
nothing above it moves. Its shades are the existing monochrome accent
ramp (.l0 to .l4) and follow the tab's own Tokens / Cost / Requests
switch, with no new read; a provider or computer picked above narrows it.
A tooltip says the day and its tokens, requests and cost. Weeks with no
call show no card. No animation.

It reads the existing cached /api/usage/heatmap, at most once a minute
and again when a pick changes; the tab's own 10 s reads don't wait for
it, and no endpoint was added. The card, its reads and tooltip live in
plugins/usage/page.js, which shares its grid (heatGridOf, taken out of
drawLedHeat as it was) and tooltip (ledHeatTip, now told the metric and
provider) with the Requests tab. app.js keeps one guarded call in
renderPanelUse: the ledger read can come back before page.js has run, so
page.js draws the tab again when it loads. Both script budgets hold it
at this base with no raise. The card
is .pu-heat, not .pu-card, so the chart's card stays the tab's one
.pu-card. The panel's light pills are its card's white, so a quiet day
there is a 7% shade of the text over the card.

Run (rebased on origin/main 2896e82cc):
- panel-heatmap.test.cjs (new), Chromium and WebKit, en zh zh-TW ja de,
  440 light and 320 dark: 12 of 12, 3 runs on mote. Red 12 of 12 with
  MAGPIE_ASSETS at origin/main's assets.
- Affected files (usage-heatmap, panel-usage, panel-usage-models,
  panel-usage-first-account, panel-currency-provider, panel-units-follow,
  number-units, usage-chart-axis, usage-head-steady, usage-phone-head,
  i18n-keys, phone-no-sideways) and TestCoreScriptBudget: green but
  phone-no-sideways de 375, the same with origin/main's assets (#5869).
- At 2896e82cc again: panel-heatmap, panel-usage, panel-usage-models,
  usage-heatmap, panel-usage-first-account green; i18n-keys red on a
  routing-plugin phrase 2896e82cc's claude_image_budget_test.go added,
  red on origin/main alone (#6877).
- Whole GUI suite on mica at 91b3af847 (concurrency 4): not finished.
  The runner exited 7 with no message twice (after ~2231 and ~2371
  tests); the third part, grip-inset on, is still running, ~10,900
  tests in. None of the red files is touched by this change. Under the
  whole-suite load (#6709, #6782), with their issues:
  agent-details-ready #6369 #6373, agent-switch-accounts #5925,
  claude-quota-onboarding #6179, bark #6543, api-key-theme #6444,
  aside-native #6212, agent-menu-label #6371, allow-ips #4959,
  account-refresh-holds #6003, account-arrange #6010, desktop-tiers
  #6475, quota-refresh-order #6180, provider-max-output and
  provider-many-keys #6209, rest-try-now and key-switch #6232,
  provider-fetch-again, provider-typed, provider-picks-stay,
  provider-models-rest and menu-scroll #6532, omp-roles #6432,
  recovered-file #4320, quota-bars-alike #6700, login-export #6628,
  gateway-key-arrange #6268, first-untick #6660, editor-hints #6156,
  connect-address-kept #6755, recent-call-bodies #6665, quota-credits
  #6807, models-works-only #4391, codex-memories-settings #6372,
  panel-options-fold #6794, reset-providers #6196, quota-curve #6789,
  model-copy-id #4621, modal-backdrop #6663, loop-guard-setting #6662,
  lightweight #6340, keychain-retry #6661, key-replace #3476,
  key-balance-card #6414, gateway-pause #6684, duplicate-pause and
  key-box-once #6424, codex-async-compact #6658, name-suffix-remote
  #5147, menu-input-scroll #3402, rollup-short #6560, remote-magpie
  #6099, plugin-signin-no-url #5938, plugin-signed-out-account #5998,
  plugin-page-foreign-error #6117, plugin-option-placement #6559,
  phone-no-sideways #5869, partners #6664, panel-fold #5796, omarchy
  #4624, old-webkit #6030, model-api-preset #5838, mobile-web #6790,
  library-open-again #6751, key-import #6416, grip-inset #6293,
  fast-ultra and fast-pick #6201, ctx-session-line #5801, context-cap
  #6514, codex-auto-reset #6232, panel-usage-first-account #6181
  (green alone at this head), lan-join #6353, icon-tile #6759,
  model-chip-steady, header-centre, last-page, nav-timeout,
  plugin-card-update #6709. With no issue before, filed as #6876:
  data-folder, plugin-move-unserved, name-suffix-where-named,
  group-editor-selected, found-skill-pick-remove, quota-count-wrap,
  nav-sub-fold, model-suffix-own, account-models,
  account-models-available.
- Looked at screenshots of the panel at 440 and 320, light and dark, en
  zh de ja, with the tooltip shown.

Not tried: the real app's tray panel on macOS, Windows or Linux
webviews, real accounts' usage.
2026-11-16 20:58:35 +08:00
yetone 8707ea7757 gateway: Codex's prompt suggestions go on a model set for them (@0xcb198609 on X)
The Codex app's home-page prompt suggestions (thread_source
ambient_suggestions, and their safety check, ambient_suggestion_safety;
the Routing page's 提示词建议) are a background agentic turn that reads
the project and connected apps. The app asks for the model its server
config names (codex-app-model-routing's
codex_ambient_suggestions_model_slug, gpt-6-luna) with provider model
fallback on, so with magpie as Codex's provider they ran on the
provider's default model, often auto: @0xcb198609 saw 76.9k tokens in
113s on deepseek-v4-pro. Codex has no config.toml key for that model,
only an on/off switch in the app (store key ambient-suggestions-enabled,
Settings › Configuration › Homepage suggestions; read from the 26.1106
bundle).

magpie now has a setting for it, "Codex prompt suggestions" in Codex's
row on the Agents page (Settings, beside Codex composer predictions):
- Empty, the default, is Codex's own pick: nothing moves. A value the
  user set is never overridden.
- A model or group of magpie's puts both calls there: in serve as the
  codex-suggestions move (the Routing page says why), and on the ChatGPT
  backend's route before the split, carrying the asked model to serve so
  the trace and ledger keep it. codexOwnOffMagpie leaves a bare
  gpt-6-luna to magpie while the setting is on (codexSideSet).
- A target that is disabled, unserved or not allowed to the gateway key
  leaves the call as asked, with a log line (compactRefused).
- To fit app.js's script budget without raising it, the suggestions and
  auto-review pickers share codexPick with codexSidePick, and every
  Codex row's button comes from condButton. The new route is named for
  the CLI (settings_parity_test.go). agent-prefs and settings-general
  list the new row.
- The row's tooltip and the Routing page's Suggestions story say where
  Codex turns them off. magpie's old story said "Suggested prompts",
  which the current app no longer shows; corrected in all five languages
  from the app's own locale files.

Run (mote, at this head rebased on e25210b6e):
- go test -timeout 45m ./...: ok, every package (101). A first run
  at e97271f02 had cli and gui red on the CLI-parity guard and
  TestCoreScriptBudget; both fixed here, without raising the budget.
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
  ./...: clean. gofmt -l: clean.
- TestCodexSuggestionsMoved/Left/MovedOffChatGPT/ModelRefusesBareName,
  TestCodexSuggestionsSetting: ok.
- GUI: codex-suggestions (new), codex-predictions, codex-auto-review,
  routing-kind, i18n-keys: 58/58 ok before the rebase; at this head
  codex-suggestions, i18n-keys, agent-prefs, routing-kind 84/84 ok.
  Every GUI file that opens Codex's row or the Routing kind stories
  (26) ran too: red only in codex-async-compact (zh, zh-TW) and
  codex-memories-settings (chromium scroll), both red the same on
  origin/main e25210b6e and filed as #6658 and #6372.
- Rebased last onto 90d54a267 (internal/sessions and internal/usage
  only): internal/sessions, internal/usage, TestCoreScriptBudget, the
  route guards and the CodexSuggestions tests ok again there.

Broken by hand: codexSuggestionsTo returning "" and codexSideSet's new
case off: TestCodexSuggestionsMoved red (m1 sent, and a 404 "magpie
knows no model gpt-6-luna"), TestCodexSuggestionsMovedOffChatGPT red.

Not tried: a real Codex app's prompt suggestions against magpie (no
Codex.app here or on mote); the whole GUI suite (only the files that
open Codex's row, its settings or the Routing kind stories).
2026-11-16 18:59:40 +08:00
yetone 50f7a8e01f routing: a Smart row behind one renewing sooner says so; Smart says new conversations go there too
YsiCing on X: in Smart, every conversation went to one Codex account (pro,
74% of its week) while Business and team, both at 0%, said "已用 0% · 会话留在另一个账号" ("0% used · the conversation stays on another account").
That is what Smart is meant to do. It sends every request, new
conversations included, to the one account whose quota renews soonest, and
only Stays: Session or Strict spreads new conversations. But the row blamed
a kept conversation, and the Smart description said "one account at a time"
without saying that covers new conversations, plus "at 90%", which is wrong
for a week since d5d48f4f9.

- routing plugin client.js behindWhy: when the account in use also renews
  sooner, a row says "{n} used · one renewing sooner goes first" (and
  "renews in"/expires as before), not "kept"; "kept" is left for a row that
  would have gone first without the kept conversation. Four languages.
- The Smart description (app.js, i18n.js) now says every request, new
  conversations too, goes to the one account renewing soonest until it
  runs low. app.js is 4 bytes shorter; the budget is not raised.
- docs/reference.md: Smart is not load balancing; to spread conversations,
  set Stays to Session or pick Least used first.

Run:
- routing-behind-why.test.cjs on mote with the old client.js: 62 fail,
  40 pass (the "kept on the one renewing sooner" and "fresh" cases, both
  engines, all 5 languages). Green on the new code.
- mica-run go test -tags nogui ./internal/gui -run
  'TestCoreScriptBudget|I18n|Lang': ok. gofmt -l internal/: clean.
- GUI subset on mica at base c867a12c5: routing-*, i18n-*, account-arrange,
  account-weight, builtins, gateway-model-info, key-weight, rotate-figure
  and update-blocked (203 files). 3482 passed, 20 failed. I reran the 7
  red files at base c867a12c5 and with this change, one after the other:
  the same 17 are red at base (#6520 routing-signin, #6010 account-arrange,
  #6512 pin-away, #3799 row-swap, #3954 story-shrinks, #5647 pulse under
  load). routing-stage-routes 420px is red once in en and once in zh, on
  rows with no Smart account, a single read of the on class: #6830.

Not tried: real Codex accounts (fixtures only), and the Linux app's
WebKitGTK.
2026-11-16 14:40:53 +08:00
yetone c38753a7ee search: Settings can ask every search API at once, results merged (heyiwei5 on X)
The search APIs are asked in order: the next only when one fails or
finds nothing. Asking several together, with their pages merged and
repeats dropped, has existed since #2845 but only through
`magpie search mix`. Settings › Models › Web search now has an Advanced
fold, shown with two or more search APIs on, holding "Ask the search
APIs: In order | All at once". All at once marks every API on as mix
(POST /api/settings/search-api {"mix":[...]}, provider.MixSearchAPIs);
In order clears the marks. In order stays the default. A mix of some of
the APIs, set from the CLI, opens the fold with neither choice on and
names the APIs it asks.

Run (mote, at this tree):
- go test ./internal/gui -count=1: ok.
- TestSearchAPIsMixedFromSettings at origin/main's api.go: build fails
  (searchAPIJSON has no Mix), so it is red on the old code.
- node --test search-mix, search-count, search-api, i18n-keys:
  72/72 pass, chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 560px.
- search-mix.test.cjs at origin/main's assets: 0 of 30 pass (red).
- gofmt -l: clean.
- After rebasing on b010fba05 (GUI pages): the gui Budget/I18n/mix Go
  tests and search-mix + i18n-keys GUI (34/34) pass again.

Not tried: the whole GUI suite, and a real search through mixed APIs
with real keys (the merge itself is unchanged since #2845).
2026-11-16 14:12:48 +08:00
yetone b34243823e routing: accounts' resets stay in their column, and resizing over many accounts is smooth (lexrus on X)
lexrus on X: on Routing's Accounts and keys, at some widths "resets in
3h" ran over the next column and the right column's words were cut, and
with many accounts dragging the window's edge was janky.

Overlap: the window parts' widths (--wk/--wv/--wr) were taken from the
widest window of the whole list, so one provider's long reset pushed
every row past its column. They are now per provider, and CSS caps each
part to its row.

Jank: the list was CSS columns, and the browser balanced every row again
on each layout. packActs (plugins/routing/client.js) places each
provider's box (and a long box's rows) itself under .rt-acts.packed with
--px/--py: down a column and on into the next, ends as level as a binary
search on the cap allows, a heading never last in a column. It runs on
the window's resize, on render, and a frame after a box's height changes.
Side mode (min1150, beside the requests) is unchanged: one scrolled
column, nothing placed. Measured on mote with a 100-row fixture, per
resize step: WebKit layout 26.6ms -> 5.9ms, frame p90 35 -> 18ms;
Chromium layout 8.24ms -> 2.86ms.

Test: routing-account-windows-fit.test.cjs, 4 and 20 Codex accounts, en
and zh, Chromium and WebKit, widths 420-1600: no window part runs past
or is cut, a provider's lines start together, the list isn't CSS
columns, boxes sit inside the list in column order without overlapping,
2+ columns at 700-1099. Broken by hand: the old assets are red on the
overlap; packing turned off is red ("the list isn't CSS columns").
gui-shell.md says how the columns are placed.

Run on mote at this change on origin/main 7bdda0450 (pushed on
3b643f397, which changes internal/provider only):
- the 209 GUI files that open Routing or read its files, plus
  i18n-keys and builtins: 3736 pass, 42 fail. Every red is red the same
  on a clean origin/main 7bdda0450 copy, or is filed: quota-bars-alike
  (#6700), ctx-session-line (#5801), quota-credits (#6807, filed now),
  routing-pin-away (#6512), routing-row-swap (#3799),
  routing-story-shrinks (#3954), mobile-web (needs .git for its
  origin/main baseline; #3952, #5013). routing-idle-frame's one WebKit
  red came under load (#3773) and passed 2 of 2 alone at this head.
- go test ./internal/gui: ok. gofmt -l: clean (no Go changed).

Not tried: the real Wails app, Linux WebKitGTK, Windows WebView2, and
lexrus's own accounts.
2026-11-16 10:42:18 +08:00
yetone 64c4261582 sessions: search what was said in every agent's sessions, from the page and an MCP server
cryingLiu on X asked to search the chat history of every agent magpie
reads sessions from: prompts and replies, from one place.

What the user gets:
- The Sessions page's search also lists, under the agent's own list,
  the other agents' sessions whose conversation says the words, each
  with a snippet. A hit opens the conversation in the sheet at the
  message that said it (transcript?find=), with "N earlier messages
  not shown"; the page itself never scrolls. While the index is still
  being built the head says "Indexing sessions…" or "Indexing N of M
  sessions…", and the page asks again every 3s until it is done.
- Magpie Sessions, a built-in MCP server in Library → MCP (Discover),
  opt in per agent like the other magpie servers. Its tools are
  search_sessions(query, agent?, limit) and read_session(id, around?),
  both returning text. It runs as `magpie mcp sessions` over stdio and
  reaches the gateway's /mcp/magpie/sessions, which serves only local
  callers that are not browsers.

How it works:
- internal/sessions/said_index.go keeps said-v1.db beside sessions.json:
  a contentless SQLite FTS5 index (detail=none) of the words each
  session says. It is built from the sessions list sessions already
  caches and refreshed at most every 10s: a new or rewritten file is
  read once, a grown Claude Code or Codex file only from where it ended,
  and a gone one is forgotten. A query asks the index which sessions
  have every word, then reads only those files for the snippet, for at
  most 6s. A search waits up to 2s for a refresh. While the first
  listing is still running the answer says `listing`, so an empty first
  answer is not read as "no session says it".
- Privacy: only agents sessions.Reads allows are indexed or searched;
  nothing is read until the user has answered the sessions question,
  and in gateway mode no agent's own files are read (the page doesn't
  ask). Reset forgets the index.
- /api/sessions/said for the page; the CLI parity list names it.

Run, at this tree (rebased on origin/main 256910f17):
- gofmt -l clean; go vet on mote for darwin, GOOS=linux -tags nogui
  and GOOS=windows: ok.
- go test -tags nogui ./... -timeout 45m on the WSL Linux box:
  every package ok at c8e445c4b (the tree before the one-hit wording,
  whose gateway tests ran again on mote: ok).
- GUI: the whole suite on mica at this head was still running when
  this was pushed (owner: never hold a verified change behind a full
  suite). Under mica's load, beside another session's full suite, 90
  tests had failed so far, all in files this change doesn't touch
  (accounts, Details, keys, plugins, providers); none in sessions,
  library or i18n. The files this change reaches passed on their own
  (below).
- Focused, green: internal/sessions (Said*, TranscriptAt),
  internal/gateway (SessionsMCP*, own MCP, read-only, key slots),
  internal/library (market, opt in), internal/gui (Said, Sessions,
  gateway mode); GUI sessions-said, sessions-search, library-sessions-mcp,
  vision-mcp-library, library-browser-setup and i18n-keys in chromium
  and webkit, every language, wide and narrow.
- Broken by hand, one at a time, each red and green restored: the
  index's Listing left out (TestSearchSaidWhileTheSessionsAreFound red
  in 2.5s); the page ignoring `listing` (sessions-said 6 of 7 red); the
  MCP's local/browser guard (TestSessionsMCPOnlyForAgentsHere red); the
  server's opt in (TestSessionsServerInDiscover red); every Reads check
  on the search path, the index's and SearchSession's together
  (TestSearchSaidLeavesOutAgentsNotRead red). With those gone the
  gateway-mode GUI test stays green, because the sessions listing
  leaves an unread agent out before the index sees it.
- Real use, in a sandbox HOME with GOPATH, GOMODCACHE and GOCACHE
  pinned, over the real history through symlinks (29 GB Claude Code,
  60 GB Codex, 14,102 sessions), sessions reads set to all in the
  sandbox: first listing ~60s cold (answers say still being found),
  whole index built in 9m50s while queries answered in ~6s each, index
  38 MB, a common word 4.9s and a rare word 1.0s warm, read_session at
  the words of a huge session 1.8s, peak footprint 442 MB for the whole
  process with the sessions cache. Nothing was written under the real
  ~/.claude or ~/.codex.
- The real binary end to end on mote, in a sandbox HOME: `magpie serve`
  on a free port and `magpie mcp sessions` over stdio with
  MAGPIE_GATEWAY, against a Claude Code session written there:
  initialize, tools/list, search_sessions found it with its snippet,
  read_session at the words started 3 messages before them, a word
  nowhere said "No session says", and a POST with a web page's Origin
  was refused 403. That run is how "1 sessions say" was found and
  made "1 session says" (TestSessionsMCPSearch red before, green after).

Not tried: a real agent (Claude Code, Codex) calling the server it was
given from the Library, and the page against a real backend (the GUI
tests fake the API). The index on Windows and Linux ran only through
the Go suite.
2026-11-16 07:19:18 +08:00
yetone 103eff4d44 routing: a group's model is dragged by its row, not only by its number (NovaStudiosss on X)
NovaStudiosss on X: "the models added to a routing group should be
draggable with the mouse; I move them often and Up/Down each time is
not handy enough". A member could already be dragged since 4dab45e3f,
but only by its number, whose grip shows on hover; the number reads as
a label, so the reporter only found Up and Down.

Now the whole row picks the model up too: its logo, the room around
its words and the row's own background, through the same dragRows the
number uses (one commit to moveMember, the same order saved as before,
so the gateway routes in it: members/placed in /api/groups/save as
group-member-drag already checks). The row shows a grab cursor. A press
on the model's name still selects its words, as the accounts' rows do
(the editor keeps them selectable, jiabubu), and its switch, number,
effort, weight, Up/Down and remove stay controls. The row has
touch-action pan-y, so a finger on it still scrolls the page; the
number keeps touch-action none for a finger's drag. The grip still
shows on hover only. No new strings, no new motion (the drag's lift
and shifts are dragRows', reduced motion as before).

Run (pushed tree's assets = this commit on 65e3dfa95):
- group-member-row-drag.test.cjs (new): Chromium and WebKit, en, zh,
  zh-TW, ja, de, at 1100px and 420px, 20 of 20 on mote. With
  origin/main's assets (MAGPIE_ASSETS) it is red: the cursor check,
  and with that check taken out the logo drag moves nothing
  (["one","two","three"] for ["three","one","two"]), both engines.
- group-*, routing-*, rt-*, route*, i18n*, strings*, click-scroll and
  core-* GUI files (250 files, 4008 tests) on mica under load: 18 red
  in 6 files. Rerun alone at concurrency 1, here and on an origin/main
  65e3dfa95 worktree: the same 17 red in 5 files on both, all filed:
  group-editor-selected (#5049), routing-pin-away (#6512),
  routing-row-swap (#3799), routing-signin (#6520),
  routing-story-shrinks (#3954). group-member-weight's webkit de 420
  1px red (#2387) passed alone.
- go test -tags nogui ./internal/gui/ on mote: ok.

Not tried: a real touch screen (the touch-action values are checked,
not a finger), and the Linux WebKitGTK app.
2026-11-16 06:44:38 +08:00
yetone e47abdf468 usage: the allowances' trend takes any last N days; a curve's hover reads the exact numbers
shangyuan0818 on X asked for exact numbers on the Overview's quota
curves when hovered, and for the trend to take any "last N days".

- Usage → Overview, the allowances' "Trends: …" button: the menu now
  has 7 days and 30 days beside Off, 2 days and Cycle, and "Other number
  of days…", which turns the button into a field for 1 to 45 (the days
  of history magpie keeps). Enter or leaving the field keeps it; Escape
  leaves the range as it was; a number out of range says so and keeps
  the old one. A custom N stays in the menu, and is kept across a reload
  (magpie.quotaRange).
- Hovering a quota curve shows a small tip at the reading nearest the
  pointer: when it was read, then each window's left to two decimals
  (70.46%), with a hairline at that time. A balance curve shows the
  balance in the card's currency. The curve's own tooltip (what the
  dashes mean) waits while the tip shows. A touch still zooms, as before.
- The trend menu, the days field and the hover live in the usage
  plugin's page.js, so app.js stays inside its budget.
- No animation: the tip follows the pointer, which a movement would lag.

Run, at d597b4d01 + this change, on mote and mica:
- quota-trend-days.test.cjs (new), 5 languages x 2 engines: red on
  2d106b5c1 ("7 and 30 days are offered"), green 10/10.
- The 18 GUI files that draw or pick the allowances' curves, i18n-keys
  and i18n-en-no-cjk, plus usage-exact-cost and quota-holds: 201 pass. The 6 reds are red alike on origin/main 2d106b5c1, each filed:
  quota-curve's "quota cards draw what was left over time" (#6789) and
  usage-fold's "17 subscriptions and 29 accounts" (#3415, #6003).
- go test ./internal/gui: ok (app.js 228 bytes inside appScriptBudget)

Not tried: Windows (WebView2) and the panel's Allowances tab by hand, a
real account's history, a touch screen.
2026-11-16 04:45:45 +08:00
yetone d597b4d010 usage: a priced cost without "≈", at least two decimals; cache hit rate to two
shangyuan0818 on X: Usage → Requests showed every cost as "≈$…", and
the cache hit rate with one decimal.

- A cost from known prices is what magpie counted, so "≈" is gone from
  every priced cost: Requests' Cost card and tiles, the agent, model and
  account rows, the quick panel's Usage, Routing's live rows. An estimate
  keeps it (a window's whole on an account card, a session file's times).
- fmtCost gives at least two decimals ($1.00, $100.00, $2500.50), three
  under $1 as before, and a sub-mill amount to its first two digits
  ($0.00040, $0.000012) instead of $0.000.
- Requests' Cache hit rate card has two decimals (93.97%); hitPct still
  never rounds up to 100% or down to 0%.
- A whole-window estimate from $100 up stays whole ($1235): its cents
  would claim a precision it hasn't (wholeCost, moved to page.js to keep
  app.js inside its budget).

Run, at 2d106b5c1 + this change, on mote (rebased onto fc41381d6,
whose three commits touch nothing under internal/gui):
- usage-exact-cost.test.cjs (new): red on 2d106b5c1, green 12/12.
- The 91 GUI files that read a cost or a hit rate, both engines, every
  language. Reds beside this change's own (fixed: mobile-web,
  panel-currency-provider, ledger-cache-unknown, usage-ledger-chart) are
  red alike on a 2d106b5c1 checkout, each filed: grip-inset #6293,
  key-balance-card de #6414, usage-cards-hide #6294,
  usage-hidden-way-back #6295, quota-curve #6789, old-webkit #6030,
  tray-cell-click #5215, usage-ledger return-to-live #4078, usage-upload
  #6743, zero-priced-free #5262.
- After the test fixes: mobile-web, panel-currency-provider,
  ledger-cache-unknown, usage-ledger-chart, usage-exact-cost, quota-holds,
  usage-unpriced-sum, currency, i18n-keys: 112 pass. The 14 reds are red
  alike on a 2d106b5c1 checkout: usage-ledger-chart's "metric is
  remembered" (filed in #6790) and mobile-web's "desktop matches
  origin/main", which needs git in the copy (mote-run has none; #5013).
- go test -run Budget ./internal/gui: ok (app.js inside appScriptBudget)

Not tried: Windows (WebView2), the reporter's own data, a real account.
2026-11-16 04:38:36 +08:00
yetone 47ce008da8 gui: Settings asks for HTTPS only while its rows can show (#6709)
renderHTTPS sent GET /api/settings/https on every renderSettings,
and renderSettings has 35 callers, so each Settings draw cost a
request, LAN or not. GUI tests count a request under /api/settings/
as a write, so checkin-now-account and panel-shortcut have been red
in both engines and every language since 4623f5419 (11-10): that
commit's record ran chosen GUI files and called the reds the same at
base. Now it asks while the rows can show (sharing on the local
network, magpie answering other computers, or HTTPS saved on), and
again once the saved switch differs from what the last answer said.
Its own writes still update the rows from their answers.

Run (origin/main 139a6be2b plus this, GUI files on mote; at the pushed
head, rebased on 261f48226, checkin-now-account + panel-shortcut +
https-settings: pass 54 fail 0):
- checkin-now-account + panel-shortcut: pass 42 fail 0. Without the
  change: pass 2 fail 40 ('write', '/api/settings/https' counted).
- https-settings, browser-access, cors-origins, side-gateway-lan,
  settings-search, i18n-keys: all pass. allow-ips, lan-join and
  remote-magpie: 14 reds, the same 14 subtests without the change
  (on #6709's list).
- go test -tags nogui -run 'Budget|Size|Asset|Plugin.*Page'
  ./internal/gui: ok.

Not changed: renderWebPage and renderRemote ask /api/web-page and
/api/remote on every draw the same way. They aren't under
/api/settings/, so no test counts them; filed as their own issue.
Not tried: the real app's Settings with LAN on (the GUI fixtures
cover the rows).
2026-11-16 00:09:14 +08:00
yetone d7cda856ad library: MCP servers turned off fold away below the ones on (hzlxb on X)
hzlxb on X asked for Library -> MCP servers to keep the servers turned off
apart, folded, as Providers keeps the providers turned off. The list now
holds the servers on. The ones off sit below it, above "+ Add server",
under a "Servers turned off (N)" fold drawn with Providers' Turned off
markup (row-head off-head, .fold with the chevron, the count in .note).
It is folded at first and remembered in localStorage
magpie.offServersOpen, as magpie.offProvidersOpen is. A server switched
off moves under the fold, and one switched on comes back up. While
picking (Select) the fold is held open and disabled, so every server
picked is in sight, as Providers holds its fold open while searching.
The MCP tab has no filter of its own, so there is nothing else for it to
hide from. With every server off only the fold shows. With none off
there is no fold. Strings are in en, zh, zh-TW, ja and de.

Run:
- library-mcp-off-fold.test.cjs (new): Chromium and WebKit, 1100 and
  420 wide, en/zh/zh-TW/ja/de. It checks order, label, count, title,
  aria-expanded, that opening by a wheel-scrolled click leaves the head
  where it is and opens no editor, the reload memory, moving on a
  switch, picking, all off and none off. It is red on the old library
  files (no fold; checked on mica in chromium).
- Library/MCP/i18n/click-scroll/providers-off-fold GUI files (102 files,
  both engines) on mote at the pre-rebase head 29a5f10f9: 2304 of 2310 pass. The 6
  reds are library-open-again's 1100px cases, red the same alone on the
  old tree (filed as #6751).
- go test -count=1 ./internal/gui/ on mica at this head: ok (143s).
  gofmt clean.
- The whole GUI suite on mote at 29a5f10f9, in two parts (mote rebooted
  mid-run; the rest ran after it came back, under suite.lock). Part 1:
  411 not ok in 75 files. Part 2 (640 files): 11355 tests, 10911 pass,
  444 fail. No red is in the files this change touches except
  library-open-again (#6751). Every red file has an open issue saying it
  is red on main: skill-fold-all/skill-manual (#6667, #6668, the
  window's /api/update/using), skill-group-shared (#6687),
  view-open-wheel (#4723), view-trackpad-coast (#4724),
  view-wheel-unheard (#5158), usage-* (#6743, #4263), the rest in #6709
  or by name; icon-tile was unfiled and is now #6759 (dim-color from
  2649d5d72, not in app.css's tile rule).
- After rebasing on origin/main 923cc8747 (1f04ed219 touched
  library.css): Library/i18n/click-scroll/providers-off/gui-* files on
  mote: 1837 of 1847 pass. Reds: library-open-again's 1100px
  cases (#6751), library-env de (#6675, NO_PROXYlocalhost) and
  library-chip-fan de no-preference (#3072), both chromium only; those
  two pass 3 of 3 alone at this head and at origin/main 923cc8747; go test -count=1 ./internal/gui/ on mica: ok (154s).

Not tried: the real app, including WebKitGTK on Linux. The fold has no
motion of its own (it uses Providers' chevron rotation).
2026-11-15 21:22:45 +08:00
yetoneandliu-kan 923cc8747f routing: filtering groups reuses indexed lookups and cards (liu-kan, #6744)
Ported from liu-kan's routing_mod_filter branch at 5aca86598 (#6744).
Typing in the Routing groups filter re-ran every member's lookups as a
linear .find over all models, deciders, drawers and accounts, and redrew
the whole page each keystroke. Now a lazy index (Maps built first-match
like .find, splitMember and memberInfo cached, search text cached per
group and locale) is rebuilt whenever `groups` is reassigned (it never
is mutated in place) and dropped 5 minutes after both Routing pages are
hidden. The filter's input redraws only the group list from cached
cards, falling back to a full draw when groups or the locale changed.
No look, matching or saved config change; no new strings; app.js
untouched (client.js is outside the core budget).

Measured (mote, Playwright, 4000 models, 20 groups x 20 members, 16
keystrokes, ms per keystroke incl. layout):
  chromium: before mean 4767.6 / median 5086.3, after 0.37 / 0.2
  webkit:   before mean 4813 / median 5075,     after 0.88 / 1

Run:
- go test -count=1 ./internal/gui/ on 2bc25a2d6 (mote): ok 137.9s. Main since
  (1f04ed219) touches no routing file.
- New and touched GUI files (group-filter-render, group-index,
  group-search-cache, routing-group-plans) on 2bc25a2d6 on mote:
  54 pass, 0 fail.
- make test-ui (both engines) on mica before the rebase onto 2bc25a2d6
  (main's two routing commits since touch the stage only): the run
  stopped after 453 of 1542 files, 5788 results. Its 34 red files were
  each run on origin/main and on this branch: the same tests fail on
  both (main 2bc25a2d6: 378 pass / 204 fail; branch identical but one
  context-cap Settings flake, #6514). Each has an issue: #6010, #5814,
  #5982, #6369, #6371, #6365, #5925, #4959, #6444, #6212, #6543,
  #6029, #6179, #6658, #3293, #6372, #5972, #6514, #5801, #4870,
  #6475, #6424, #6156, #6201, #6660, #5013, #6268, #6293, #5049
  (group-editor-selected), #5594 (group-new-head), #3479, #6414, #4086.
- The other 1089 files: a run on mica went bad under another session's
  suite (load 117) and was stopped; a whole suite at 2bc25a2d6 is
  queued on mote behind the suite lock, followed up after push.

Not tried: the real app, a Linux WebKitGTK app, Windows.

Co-authored-by: liu-kan <liukan@126.com>
2026-11-15 20:25:50 +08:00
yetone 1f04ed2193 gui: a form's name and its control share a line in every editor
The owner (11-12, the second time): in a provider editor, Free for me and
Redaction sat 4-5px under their ticks. "这个事情发生过不止一次了,要彻底避免。"

Cause: each label carried a padding-top guessed for one control, 5px for
a 29px input. Any other kind of control, such as a tick, a switch, the
icon box, a row of options, a list or a JSON box, sat off its name.

Fix, at the shared row layout instead of per row:
- Every editor grid sets its rows on their first baseline: .editor, a
  dialog's .ebody, Advanced's .more .inner and Connect. The per-label
  padding and label.by-list are gone.
- Controls with no text of their own carry a text line at their middle:
  the icon box (line-height 30px) and the library switch (a ZWSP
  ::before).
- Exception: a row whose control starts with a text field is set at its
  top, its name padded to the field's line (--field-h, 44px on the narrow
  web). WebKit lays a baseline row out again on every layout and reveals
  a focused field each time, so the page jumped back to a new group's
  name (group-from-model-add). app.js's settleRows marks those rows
  .at-top (and a JSON box's name .by-json), only in grids a mutation
  touched. A CSS :has(+ ...) version held WebKit ~9s on Codex's editor
  (9209ms vs 249ms on base, provider-pass-errors).
- Connect's options wrap at <=520px instead of scrolling: WebKit grew a
  baseline row holding a scroller 6px each time its bar came and went
  (connect-snippet-shell).
- The rate-windows Add button sits at its row's top.
- provider-at-once compares the label's text height, not its padded box.
  The label is still one line; a name beside a 44px field is padded down
  to its line.

Guard: form-align.test.cjs opens the provider editors (a key's, Codex,
with Advanced open), the group editors and Connect. For every name and
control row it asserts the label's first text line and the control's
first line share a vertical centre within 2px. It runs in chromium and
webkit, en/zh/zh-TW/ja/de, at 1100, 420, a web 390 and a panel width.
LESSONS.md gets the rule.

Run (mica, through mica-run):
- At the pushed tree (49274f690, the same tree before this message): form-align, provider-pass-errors,
  provider-at-once, provider-count-free, provider-unmasked,
  provider-rate-windows, provider-proxy, connect-snippet-shell,
  group-from-model-add, icon-url, library-mcp-hub, settings-lines-wrap,
  settings-update-proxy, editor-roomy and i18n-keys: 499 pass, 3 fail at load 75. The 3: settings-lines-wrap chromium de 440 is red the same on origin/main 2bc25a2d6, 2 of 2 (#6353). connect-snippet-shell chromium en/de 390 passed when its file ran again alone (#4128 is its sibling).
- go test -run Budget ./internal/gui: ok.
- Earlier, at 648cd3fdb: the whole GUI suite (473 files). The new reds in
  it were the :has slowdown above (fixed). The 64 files it reached were
  then run again on mote, rebased on 343920464; the reds left are listed below.
- Broken by hand: every first baseline put back to start, form-align
  0/10. On the old CSS it was 0/10.

Reds that are the same on origin/main (343920464, 2bc25a2d6):
- connect-address-kept at 1100: #6755, filed now.
- provider-mask "Hide accounts": #5109.
- settings-groups warm-ups: #6597.
- editor-advanced-align webkit: #4615 / #6421.
- library-bili webkit: the tab click is lost about 1 run in 4, 2/8 on
  main, near #6015.

Not tried: the real app in WKWebView, WebKitGTK and WebView2, and Windows.
2026-11-15 19:53:10 +08:00
yetone 343920464f routing: Fast keeps the provider's extra-body Ultrafast; a relay's GPT model can go Ultrafast (KoiLx0 on X)
KoiLx0 on X: with Azure or another provider that takes service_tier
"ultrafast", the group's speed toggle stopped at Fast, and they asked
whether the group's Fast overwrites {"service_tier": "ultrafast"} put
in the provider's extra request body. Before this commit it did. A member
sent fast got service_tier "priority" in its body before the extra body
was merged. A non-forced extra-body field only fills in a missing value,
so "priority" went upstream. Only "!service_tier" survived.

Precedence now:
- Member not sent fast: as before. The agent's own tier is kept, and the
  extra body's service_tier fills in when the agent sends none.
- Member sent Fast: priority. If the provider's extra body asks for
  "ultrafast", it is sent ultrafast, so Fast is never sent slower than
  the user asked of the provider. A slower extra-body tier (flex) gives
  way to the toggle, which the user set on this member.
- Member sent Ultrafast: ultrafast.
- A forced "!service_tier" in the extra body still goes over all of
  these as written.
The same holds for an agent's fast pick (same member loop).

Ultrafast on a provider the user added by its address (OwnFast): the
toggle goes on to Ultrafast for a GPT model when OpenAI offers the tier
on that model. That is known when one of Codex's accounts lists it, or
when Codex's own entry in models_cache.json for the slug does
(codexcat.OwnOffers). Codex itself is already offered the tier on such a
provider from that same entry (ownTiers). Like its Fast, Ultrafast is
only asked for. A provider that turns the field away is asked again
without it. Other vendors and OpenAI's own API are unchanged. The
Ultrafast button's tooltip on such a provider says the tier is asked of
the provider (new string in zh, zh-TW, ja, de).

Tests, red on the old code:
- TestFastMemberOwnProviderExtraTier: the outgoing body for each
  combination of group speed and extra body, from Chat, Responses and
  Anthropic agents. Old code sent "priority" for "fast + extra ultrafast"
  and for "Ultrafast".
- TestCanUltraOwnProvider: old code returned false for a relay's
  gpt-6.1-sol that Codex's entry offers Ultrafast on.
- group-member-fast.test.cjs: an own provider's member steps usual,
  Fast, Ultrafast and saves ultra; one with no Ultrafast steps back to
  usual. en/zh, Chromium and WebKit.

Docs: gateway-routing.md (a group member's speed) and
providers-accounts.md (Extra body) say the precedence and the
Ultrafast rule.

Run on mote at df2652f63 (base b0d634b85), log kept whole:
- gofmt -l internal: nothing.
- go vet (darwin) provider, gateway, codexcat, gui, agent; GOOS=linux
  and GOOS=windows go vet provider, gateway, codexcat: clean.
- go test -timeout 45m -count=1 provider (176s), gateway (1017s),
  codexcat, agent (275s), settingsapi: ok. go test -tags nogui gui: ok.
- GUI on mica, Chromium and WebKit: group-member-fast, model-speed,
  routing-service-tier, i18n-keys, i18n-en-no-cjk pass. fast-ultra is
  red the same way on b0d634b85 (extra POST /api/update/using, #6201).
- Broken by hand: the new Go tests red on the old sources (above).
Rebased onto 338eae3c2 (provider/models.go, remote groups) after
4f40a1061 (sessions, agent/codex.go, app.js, i18n.js; none
of this change's files). At that head, on mica: TestLoopGuardLeavesOrdinaryRepliesAlone (reads
the two edited docs), TestFastMemberOwnProviderExtraTier,
TestGroupMemberUltrafast and TestCanUltraOwnProvider ok; at 338eae3c2
plus this, go vet and go test of provider (143s) and codexcat, and
gateway's fast, ultra, model-tier and loop-guard tests: ok.

Not tried: a real request to Azure or a relay that serves "ultrafast";
the whole GUI suite; a Linux or Windows run beyond cross-vet.
2026-11-15 19:06:45 +08:00
yetone b0d634b850 routing: Expand picks how far the stage opens, models or accounts (ipsikent on X)
ipsikent asked on X for a setting for how deep the Routing page opens:
often only which model a route uses matters, not which provider's account
it went to. Expand, at the end of the stage's top line, opens a menu
(openProtoMenu) with Automatic (as before: long lists folded, short ones
open), Models (two or more accounts or keys of one provider fold into the
row naming the model, and start folded) and Accounts (every fold starts
open). Models and Accounts open every group in the group. The pick is
kept in localStorage magpie.routingDepth; picking one forgets the stage's
remembered folds, so every row follows it at once, and a row clicked
after it is kept as before. Accounts and keys isn't changed. Display only:
the gateway's choice of seat is untouched.

It sits in the stage card's top line, not the page head: in the head it
pushed Hide accounts onto a second line at 420px in English. "Expand" is
in the core dictionary, since i18n-keys finds the word in plugged.go.

Run (mica, at this tree on 2649d5d72):
- node --test routing-depth.test.cjs: 20 of 20, Chromium and WebKit, en,
  zh, zh-TW, ja, de, at 1100 and 420. Red on origin/main's routing files
  (no #rtDepth).
- i18n-keys, i18n-en-no-cjk, routing-group-fold, routing-keys-fold,
  routing-fold-accounts-together: ok.
- Screenshots at 1100 (zh) and 420 (en, de): one-line page head, Expand
  at the card's right.
The whole GUI suite is queued on mote behind another session's (suite
lock); its reds get issues.

Not tried: the real app, WebKitGTK.
2026-11-15 17:49:41 +08:00
yetone 2e1c0a377b usage: a single-account card folds to its figures, and folded cards are one size (PILIHU2023 on X)
PILIHU2023 asked for a fold on each Usage → Overview card that leaves
only the usage, with the cards all one height and width.

- A card with one account (or one key) and figures to show (windows or a
  balance) now has a disclosure chevron at the end of its head, before
  its ⋯. It reuses the per-account fold (usageAcctFold, usageAccts in
  localStorage), so its state is kept across restarts and its titles
  are the existing ones. Folded, the card keeps its windows' names,
  bars and figures. It drops resets, curves, history, the reading line
  and the auto-reset and credits rows. A plan-only card (OpenCode Zen
  Free) has nothing to fold and gets no chevron.
- Cards with several accounts keep their own folds: each account's
  chevron, and the All N accounts strip's.
- Folded cards are packed to one height: the tallest folded single
  card. A card of several accounts, each in brief, takes whole rows of
  that height. A fully folded page is a grid of one width and one
  height. Open cards keep their natural height, so nothing is stretched
  or clipped (jen_celeus, #860).
- app.js was at its budget with no room. The Usage packing block
  (packUsage and its helpers, about 3.8KB of code) moved from app.js to
  plugins/usage/page.js, which already holds the Usage page's card
  menus. app.js code is now about 3.2KB under its budget. No budget was
  raised.
- The chevron's turn uses --ease-out (cubic-bezier(.23, 1, .32, 1)),
  .15s.

What was run:
- New usage-card-fold.test.cjs: Chromium and WebKit × en, zh, zh-TW,
  ja, de, at 1400, 900 and 400px and after a reload. It folds every
  card and checks they are one width and one height, sit on whole rows
  and don't overlap. It then unfolds two cards and checks they are
  their own height again. Red on origin/main 96d1b93b2 (0 of 1 in
  chromium-en), 10 of 10 on this change.
- usage-fold (one-account case updated), usage-pack, usage-card-fold,
  i18n-keys and go test -run Budget ./internal/gui, on mica after the
  rebase on 45185710e. Everything passed except four usage-fold
  subtests. Those four ('17 subscriptions and 29 accounts' in
  chromium and webkit, 'several accounts…' in webkit en and zh) fail
  the same way alone at origin/main 96d1b93b2. Noted on #6003.
- The first version gave a plan-only card a chevron. That wrapped Zen's
  head at 897px and turned usage-pack's "head's height" check red,
  which is why the windows-or-balance condition was added.
- A 175-file GUI run (the usage-related files and i18n-keys) on mica,
  before the plan-only fix. Only account-eye was red: "a Usage card's
  eye" in Chromium. Eight parallel runs on mote give 1–3 reds each at
  origin/main too, all at the same line. Noted on #5052.
- go test ./internal/gui: ok, before the rebase.

Not tried: the real app (WebKitGTK on Linux, WebView2 on Windows) and
real accounts. Only test fixtures were used.
2026-11-15 14:04:13 +08:00
yetone ec1a1a7a55 library: import the slash commands the agents already have
miantiao_me on X (after v0.1.4189): 「之前在 Pi 定义的可以导入吗?」. Library ›
Slash commands now has a "Find in agents" card at the top. It reads the
command files each agent already has, from the same places magpie writes
them (Pi prompts/*.md, Claude commands/*.md, OpenCode command/ and
commands/, Gemini and Qwen .toml, Qwen .md, Droid), and lists them to
import, the way Subagents' import does.

- Parsing: frontmatter description plus body; for TOML, description and
  prompt. Arguments go back to magpie's form: Claude's $ARGUMENTS[n] and
  $n (0-based) become $n+1, Gemini/Qwen {{args}} becomes $ARGUMENTS,
  Pi's $@ becomes $ARGUMENTS (${@:N} is left as written).
- Files magpie wrote itself are skipped. The same content in several
  agents is one command; a name with different bodies per agent shows
  "Differs by agent" and one of them is picked; a name the library has
  with other content is "Name taken" and can't be picked.
- An imported command keeps its source agents ticked, and magpie adopts
  each original file byte for byte (Command.Taken): sync writes the same
  bytes at the same path, so the file is never doubled or rewritten.
  After an edit the agent gets magpie's render at that path; a rename
  drops Taken. Taken never leaves the machine (Collect strips it, Put
  keeps the local one).
- API: POST /api/library/commands/probe, and commands/import through
  the library change route. internal/cli's parity test names the probe
  as stage 3, like subagents/probe.
- Docs: docs/subsystems/library.md has the new row.

Run at 039e25752 (on origin/main dd89f1255), on mote:
- go test ./internal/library/ ./internal/cli/: ok. ./internal/gui/: only
  TestCoreScriptBudget red (app.js 10 bytes over), red on main, #6733;
  this commit doesn't touch app.js.
- gofmt clean; GOOS=linux and GOOS=windows go vet -tags nogui ./...: ok
  (at fb01ae2bb, base 028b07b4b; the two later main commits are Windows
  hook code in internal/gui).
- GUI: library-commands-import (new: chromium + webkit, en/zh/zh-TW/ja/de,
  420 and 1100 wide, no sideways scroll, press stays in place),
  library-commands, library-subagents-import, i18n-keys, i18n-en-no-cjk:
  64 of 64.
Earlier, at 1a70f31b6 (base 6af327e2b):
- go test -timeout 45m ./...: every package ok except internal/cli's
  TestEveryRouteHasACommandOrIsNamed, which named the missing probe route;
  fixed here and green since.
- Whole GUI suite (--test-concurrency=8, mote at load 17 to 44 with
  another session's go suite and GUI runs): 26887 pass, 1005 fail in 109
  files, none of them library-commands. The 109 files run alone at
  99719df19 and at origin/main 5bd41301b: 1145/996 vs 1144/997, the
  same tests red apart from language/width variants that flip between
  runs. Recorded on #6709.
Tests use a sandbox HOME with real Pi prompt files from Pi's repo
(internal/library/testdata/pi-prompts). Broken by hand: with syncCommands'
Taken branch off, all four import tests go red ("has a slash command of
its own"); with Put's Taken keep off, TestCommandImportNotCarried goes red.
Not tried: a real Pi install on a live HOME (by rule), or Windows/Linux
runs of the Go tests.
2026-11-15 12:59:12 +08:00
yetone 028b07b4bd routing: a folded fold of accounts on one plan shows its bar in the app (Sdsi134a on X)
Sdsi134a on X: on the Routing stage, "Command Code Plan · 3 accounts" folded
said only "3 available", with no quota, though the accounts are on one plan.
foldQuota (ea1a8ae80, chen2652) was meant to show that figure and bar, but
it never could in the app: cardFor matched only cards whose kind is
"subscription", and /api/usage/quotas sends this computer's cards with no
kind (SubscriptionQuota.Kind is omitempty and set only on a remote magpie's
cards). The tests' fixtures carried kind: "subscription", so they passed.
cardFor now takes a card of this computer whose kind is subscription or
none. This also lets the accounts list's per-account windows (#1833) and
the failed-read line (dd9cd59a1) find their cards in the app.

The fold's figure now also says when its window starts again, the soonest
of the accounts' ("5 hours 40% used · renews in 2 h 10 min"), as an account
row does; no new strings. Hide plans on the groups page
(magpie.routingGroupPlans, f362d3b9a) folds the figure and bar away here
too (plansHidden). Mixed plans: nothing, as before.

Run (base 9cd5f3652; rebased onto 72e06980e, whose new commits touch no
routing or GUI file):
- routing-fold-accounts-together.test.cjs, its cards now in the API's shape
  (no kind), plus the reset and the Hide plans case: 22/22 on mote,
  chromium + webkit, en zh zh-TW ja de, 1100 and 420px. With the old
  client.js: 22/22 red (the figure never appears). With the plansHidden gate
  taken out by hand: 11/11 chromium red ("hidden plans").
- With it, on mica: routing-account-windows, -card-error, -group-plans,
  -free-seat, -groups-page, -pooled-card, -remote-windows, -read-allowances,
  -seat-windows, -wallet-lapse, -fold-all, -folder, i18n-keys,
  i18n-en-no-cjk: 306/306.
- go test -count=1 ./internal/gui/ on mote: ok.
Not tried: the real app with several real accounts on one plan (the owner
has none such); the whole GUI suite.

Reported-by: Sdsi134a
2026-11-15 12:35:22 +08:00
yetone f362d3b9af routing: Hide plans folds the groups' quota lines, kept across restarts
Sdsi134a on X: each routing group listed every provider's quota line
("WorkBuddy AI, 4 accounts: …"), so with many plans and accounts the
groups page grew long. The page's toolbar has Hide plans, before
Templates: it folds those lines under every group (name, id chip and the
members' line stay) and then reads Show plans. The choice is kept in
localStorage (magpie.routingGroupPlans), as the Routing page's other view
choices are, so it holds across restarts. Shown by default, as before;
the button is only there when a group has such a line.

Run at b694f760c (this commit on origin/main c12ca5e3b), on mote:
- routing-group-plans.test.cjs (new): 22/22, chromium and webkit, en zh
  zh-TW ja de, 1280 window and 420 web. It checks the button's place,
  the fold, that it holds across a quotas redraw and a reload, and no
  button without quota lines.
- With it, group-new-head, group-template, routing-by-key,
  routing-groups-off/back/page/wide, routing-group-fold, filter-ime,
  i18n-keys, i18n-en-no-cjk, account-arrange: 257/260. Reds:
  account-arrange x2 (#6010, red alone at base 705d67efc too), and
  routing-groups-back chromium ja 420 once, a 5s wait under load 39
  (#6729); alone 30/30 twice after.
- go test -count=1 ./internal/gui/: ok. app.js untouched (no budget).
Full GUI suite on mica at a0bf997a9 (the same change on 705d67efc), at
concurrency 6 beside two other sessions' suites, load ~50 on 12 cores:
still running at push, 6916 results through library-*, 217 reds in 45
files, none in the routing plugin. group-editor-selected x2 is red alone
at base 705d67efc on mote too (#5049, commented); account-arrange is
#6010, bark #6543, agent-details-ready #6369/#6373. The rest
(checkin-now-account, agent-switch-accounts, key-switch, login-export,
editor-hints, ...) don't load the Groups page; not each rerun alone.
Not tried: the real app.
2026-11-15 12:08:51 +08:00
yetone 5bd41301b9 warm-up: All accounts warms every account in use at one press (CoderMaurice on X)
CoderMaurice on X: with several Claude accounts, Warm up now had to be
pressed once per account. With two or more accounts, the Warm up… menu on
the Warm up now row (a Claude Code or Codex provider's editor, the warm-up
section) now starts with All accounts. It sends POST /api/warm-all, and
provider.WarmAll sends Warm up now to every account that is in use (the
one the agent is on, or one turned on beside it) and whose windows aren't
all running already, going by the cached readings the Usage page shares.
It runs three at a time. An account that is turned off or paused, or
already in its windows, is sent nothing. An account whose sign-in lapsed
is sent nothing and is listed as failed, as Warm up now treats it. The
row's line lists the accounts warmed, the ones already in a window, and
each refusal with its reason (in red).
Accounts that are turned off aren't listed. A gateway rest is not read
(the provider package can't see it). An account rested for a used-up
window is still inside that window, so it is skipped as running.

"All accounts" moves from the usage plugin's i18n.js into core i18n.js,
since the core uses it now. It and two new strings are in zh, zh-TW, ja
and de. app.js stays inside its budget: the single-account and
all-accounts results now go through one formatter.

Run at a1968a0b5 (rebased on origin/main aecf27efb), on mica:
- go test -run 'WarmAll|WarmNow|CoreScriptBudget|Budget' ./internal/provider
  ./internal/gui: ok. New: TestWarmAllWarmsEachIdleAccountInUse,
  TestWarmAllOnlyCodexAndClaude, warm-all cases in TestWarmNowAPISaysWhy.
- Broken by hand: with the "running" skip removed from warmAll,
  TestWarmAllWarmsEachIdleAccountInUse FAILs (busy@ and spent@ warmed).
  With the All accounts item removed from the menu, warm-now.test.cjs
  FAILs ("Warm up all warms every account at one press" and the menu
  list assertion).
- GUI, Chromium and WebKit, en/zh/zh-TW/ja/de, 900px and 440px:
  warm-now, i18n-keys, i18n-en-no-cjk, usage-accounts: 54/54 pass. Before
  the rebase, plan-name-fits, provider-prefs-layout and quota-warm also
  passed (54/54 with usage-accounts).
- gofmt -l: clean. go vet, GOOS=linux go vet -tags nogui and
  GOOS=windows go vet of internal/provider and internal/gui: ok.
  go build, GOOS=linux go build -tags nogui, GOOS=windows go build: ok.

Not run: the full go test ./... and the full GUI suite. Both mote and
mica had other sessions' GUI suites running throughout, and this ships
now per the owner's ship-immediately rule. Both will run when a machine
is free. Not tried: a real Warm up all against several real Claude
accounts (the send per account is the unchanged WarmNow).
2026-11-15 11:00:37 +08:00
yetone 6256d9956a gateway keys: a limit can follow a subscription account's own window (ljayic on X)
A key's limit gains the period "account": it names one subscription
account ("<provider>/<user>") and one of its windows (5h, Weekly, Monthly,
...), and starts and resets when that account's window does, at the reset
time in the account's last good reading (quotas.json), never asked of the
vendor on the request's path (provider.AccountWindow).

When the window can't be read (no reading yet, no such window, or its reset
has passed with no reading since), the limit is "reset unknown": it is
neither reset nor lifted. It counts from the latest time the window can't
have begun before (the reset that passed, else when the limit was set), so
it counts at least the window's calls; a refused call gets Retry-After 300
and a 429 saying the window can't be read now, and the accounts are read
again in the background at most once a minute.

GUI: Gateway keys -> a key's limit -> Window -> "An account's window", then
an app-menu picker of the accounts' windows as read (GET
/api/caller-keys/account-windows); the row reads "$x / $y · 5h of
codex/...", and an unknown reset reads "resets with the account's window".
CLI: magpie gateway-key limit <id> account --account codex/me@example.com
--window 5h --tokens 2m. i18n zh, zh-TW, ja, de. reference.md and
gateway-routing.md say it, with the fallback.

Run (at this tree, base ec8125e68, rebased onto 1ac137e10 which touches
none of these files):
- gofmt -l clean; go vet darwin, linux (-tags nogui), windows clean (mica).
- go test -count=1: internal/access, internal/budget, internal/provider,
  internal/cli, internal/gui ok (mica). TestEveryRouteHasACommandOrIsNamed
  was red until the new route was named (magpie quota).
- New: TestAccountWindowLimit (budget), TestAccountWindowFromLastReading and
  TestReadAccountWindowsOnceAMinute (provider), TestParseAccountWindowLimit
  (cli), TestCallerKeyAccountWindowsRoute (gui). Broken by hand: the unknown
  branch made to guess a 5h window from now -> TestAccountWindowLimit red
  ("let through on a window not read").
- GUI: gateway-key-account-window.test.cjs, chromium + webkit, en zh zh-TW
  ja de, 500px, no native select: 10 of 10 (red without the keys.js and
  i18n change). Every GUI file that loads the caller-keys fixture or the
  Gateway keys page, plus i18n*: 1064 tests, 1046 pass, 18 red, the same
  18 red on origin/main ec8125e68 alone: api-key-theme (6, #6444),
  gateway-key-arrange 420px (10, #6268), text-size webkit (a subtest and its test, #6561).
Not tried: a real Codex/Claude account's window through a live gateway;
the full GUI suite (mote and mica each had a full suite running).
2026-11-15 03:50:46 +08:00
yetone 93762f968a usage: small, idle clients fold into one Other row
WJaunita45604 on X: test runs leave dozens of randomly named clients of
~10K tokens each in the Usage page's Agents list, and the page crawls.
renderUsage draws every Agents row again at each refresh whose summary
changed, at ~0.1ms of DOM and layout a row: with 400 clients a redraw
took 30-54ms in Chromium and 45-66ms in WebKit, with 2000 136-178ms and
224-246ms (probe at 1200px, Bun/SiYuan/translate-web and N clients).

A client not hidden folds when it is past the 5 with the most tokens,
under 1% of the period's tokens, and either made no call in the last 3
days (the agent group's new `last`) or is past the top 20; two or more
fold, or none do. No setting. Other sits at the list's foot with the
folded groups' sums (usageSum), so totals stay exact, and opens with a
click, Enter or Space; open, it draws the folded rows with their own
actions 100 at a time (Show {n} more). Closed they aren't drawn at all:
with 400 or 2000 clients a redraw now fits one frame (~13-20ms in both
engines), as with none.

Run at 442964d70 + this change, on mote (then rebased clean onto
9afec644c, which touches sync/library/update only; go test -run
'Budget|Size|I18n|Css' ./internal/gui ./internal/usage ok there):
gofmt -l clean; go vet ./internal/usage ./internal/usageapi
./internal/gui on darwin, linux (-tags nogui) and windows: ok;
go test ./internal/usage (58s), ./internal/usageapi, ./internal/gui
(137s): ok.
GUI, both engines: usage-*, i18n-*, mobile-web, own-requests and
ledger-cache-unknown files: 1740 tests, 1663 pass, 77 fail. The reds:
usage-agents-hide #6003/#3414, mobile-web #3952, usage-cards-hide
#6294, usage-range-times #6499, usage-hidden-way-back #6295,
usage-fold #3415, usage-speed-all-models #5834 fail the same way at
base 442964d70 (those 7 files there: 152 pass, 70 fail, the same
usage-agents-hide error "536.7 -> 586.98"); usage-ledger's "newest
live route needs no return-to-live button" is #5048/#6003 (the
Requests tab, which this doesn't touch); usage-chart-dates (chromium)
timed out launching the browser (180s) under load.
The new usage-agents-other.test.cjs: 33/33 (chromium + webkit, en zh
zh-TW ja de, three widths).
Perf probe at 1200px, one redraw: 400 clients 30–54ms (Chromium) and
45–66ms (WebKit) before, 2000 clients 136–178ms and 224–246ms; after,
both fit one frame (~13–20ms), the same as no clients.
Broken by hand: USAGE_FOLD_TOP=0 turns the rule test red; dropping the
100-row cap turns the page test red ("151 !== 100").
Not run: the full GUI suite (mote and mica were both running other
sessions' suites).
2026-11-15 02:51:18 +08:00
yetone dd9cd59a17 routing: an account whose usage read failed says so, the reason on hover (X @iamforu_)
@iamforu_ on X: "antigravity-bridge在路由页面不显示额度". When a plugin's
usage read fails (the bridge's agy read timing out or erroring), its Usage
card holds an error and no windows. cardOf dropped such a card, so
Routing's accounts list and stage said "what's left not known yet", with
no reason, while the Usage page showed why. A row whose card says its
read failed now says "Allowance unavailable — hover for why" (the line
remote rows already use, translated in every language), with the card's
error on hover: the list's status line title, and the stage row's
tooltip. A card with windows keeps them; an account with no card at all
stays "not known yet".

A bridge-shaped probe plugin (two accounts through auth.set, aside
windows, 8s reads) gave matching, error-free cards from
fetchSubscriptionUsage, and the Routing page drew them in a group's
accounts and on its stage, so successful bridge reads already showed;
the gap was the failed read. The probe was not committed.

Run (mica; mote's load was over its cores), at e513cba54 + this change:
- routing-card-error.test.cjs (new; chromium + webkit, en/zh/zh-TW/ja/de,
  1100 and 420px): 22 of 22 pass; with client.js from e513cba54 it is
  22 of 22 red (the failed-read line never appears).
- every routing-*.test.cjs and i18n-*.test.cjs: 3306 of 3324 pass at
  load ~100. The reds' files run alone at load ~25: routing-fold-all,
  -stage-routes and -many-keys pass; routing-signin, -row-swap, -pin-away
  and -story-shrinks fail the same 15 with e513cba54's client.js, filed
  as #6520, #3799, #6512 and #3954.
Not tried: the reporter's real antigravity-bridge account; the failure
was built from the plugin's error-card shape.
2026-11-15 02:00:23 +08:00
yetone 91d27452b7 library: slash commands, written into each agent's own command folder
miantiao_me on X asked for custom slash commands (prompt templates) kept
once in the Library and given to agents as skills are. Library → Slash
commands keeps a name, a description and a prompt where $ARGUMENTS is
every word typed after /name and $1, $2… the first, second… word. Each
ticked agent gets its own command file, in its own folder and shape
(internal/library/commands.go, from each agent's docs and source):

- Claude Code: <claude dir>/commands/<name>.md; $n becomes $ARGUMENTS[n-1]
  (Claude counts from 0), a literal $0 is escaped.
- OpenCode: <config>/commands/<name>.md, as written.
- Pi: <agent dir>/prompts/<name>.md, as written.
- Gemini CLI: ~/.gemini/commands/<name>.toml, $ARGUMENTS is {{args}}.
- Qwen Code: <qwen home>/commands/<name>.md, {{args}}.
- Factory Droid: ~/.factory/commands/<name>.md, $ARGUMENTS.
- Gemini, Qwen and Droid have no $1…: a command using them is not written
  for those agents, and the row and editor say so.
- Codex is listed greyed: it reads ~/.codex/prompts no more, its skills
  took their place. WSL agents get none yet.

What magpie wrote is recorded per file with its hash (Applied.Commands),
through syncOwnFiles, now shared with subagents: a file the user changed,
or one by that name magpie didn't write, is never overwritten or removed;
one equal to magpie's bytes is adopted. Commands travel with backups and
WebDAV sync (Bundle.Commands; an older bundle keeps this computer's).
docs/subsystems/library.md has the row.

Run (mote was over its load, so mica, then mote at the end):
- At 4119054bb on origin/main 90efddaba: gofmt -l clean; GOOS=linux and
  GOOS=windows go vet -tags nogui ./... ok; go test -timeout 45m ./...
  every package ok but internal/cli's TestEveryRouteHasACommandOrIsNamed
  (POST /api/providers/delete, from 90efddaba, #6677).
- GUI at 5783bf8cb (on 49f49c41c): the 276 files this can reach (every
  library, i18n and sidebar-icon file, new library-commands included),
  both engines, 420 and 1100, en/zh/zh-TW/ja/de: 5218 of 5340 pass. The 15
  red files were run again at 49f49c41c itself and are red the same
  there, test for test.
- At this head (rebased on 217e933dd, which touches only core i18n.js of
  these files): internal/library, gui, davsync ok, cli red as above;
  the 81 library, i18n and nav-sub-icons GUI files pass but library-env
  (#6675).
- Final head (rebased on cd030691a): go test ./internal/library ok; GUI
  library-commands, -plugins, -hooks, -subagents, -groups and i18n-keys,
  both engines: 68 of 68 pass.
- Broken by hand: Claude's $n mapping left as written turns
  TestCommandsWordsByPlace red; the sidebar section missing turned
  library-groups red (my bug, fixed here).
- Real, sandbox HOME: Claude Code 2.1.316 `claude -p "/magpietry alpha
  beta"` expanded first=[alpha] second=[beta]; OpenCode 2.0.25 listed it
  (GET /api/command) and its session command expanded the same. Gemini
  got the $n problem and no file.

Red on origin/main too, not this change: found-skill-pick-remove (#5013),
library-env (#6675), skill-group-shared (#6687), old-webkit (#6030,
#5919), the /api/update/using posts (#6133, #6667, #6668), library-new-skill
(#6539), mobile-web (#5013), phone-no-sideways (#5869), view-no-sideways
(#6669), and skill-where, text-size, usage-ledger and
usage-speed-all-models, each with an open issue. Left alone: a Claude plugin's
commands becoming library commands (#6672).

Not tried: pi, Qwen Code and Droid binaries (their files checked by tests
only), Codex (greyed), a real run on Windows or Linux.
2026-11-15 00:48:52 +08:00
yetone 1cfa53b678 gui: a gateway key's management level is switched from its menu, under Advanced (#6307)
ljayic on X asked to give a key the management API without curl. A
key's … menu has Advanced (after Rotate key) for keys that can hold
the level: not the sharing key, a browser or read-only key, an issued
or expiring key (the same set access.Update and adminOf accept). It
opens the app's menu headed "Management API" with Off, From this
computer and From any computer, ticked at the key's level, and posts
/api/caller-keys/admin-key. A key that has a level says "Manages
magpie" in its row, its title saying from where. Strings in zh,
zh-TW, ja and de.

gateway-card's menu list now names Model names (on main since before
#6029) and Advanced, 8 items.

Run (GUI, Playwright 1.62.0, both engines, en/zh/zh-TW/ja/de, 1100
and 420px):
- gateway-key-admin (new), gateway-card, gateway-key-readonly,
  gateway-caller-keys: pass (mica).
- key-page, i18n-keys, i18n-en-no-cjk: pass (mote, repo root).
- gateway-key-admin with keys.js and i18n.js from HEAD: red 0/10
  (waits for .key-admin on ops).
- Whole gateway-*.test.cjs set, key-page, phone-connect-menu: the
  reds left are gateway-key-arrange at 420px, which is red without
  this change too (#6268), and gateway-card's 7 !== 6 on main (#6029),
  fixed here.

Not tried: the real app with a second computer calling the API.
2026-11-15 00:13:05 +08:00
yetone 221c91fae3 gui: the gateway card opens the chat page
The gateway card gets a "Chat page" button beside Restart gateway while
the gateway runs. It opens <gateway>/deepseek-chat/ in the browser, or,
in web mode, the public URL's chat page. Both buttons sit in one
.gw-acts group, so a narrow card wraps them together, and Restart keeps
its .gw-fix class (the takeover, pause and port-holder tests read the
first .gw-fix). The label is translated in zh, zh-TW, ja and de.

Run: gateway-chat-page.test.cjs in Chromium and WebKit, every language,
at 1100 and 420 wide, on mica: ok. It is red without this change (no
button). At 058119705 + this change, on mica, every gateway-*.test.cjs,
i18n-keys and i18n-en-no-cjk in both engines: 328 of 343 pass in
Chromium. The reds are gateway-card's "7 !== 6" (#6029) and
gateway-key-arrange at 420px (#6268), and in WebKit gateway-pause's
"click moved the row" in one language (#6684). All of them are red the
same on an origin/main 3f09b9ffc copy. go test ./internal/gui (budgets): ok.
Go vet (darwin, GOOS=linux -tags nogui, GOOS=windows) and gofmt: clean.
2026-11-14 23:56:19 +08:00
yetone 2a6ab83d8a usage: each account of a provider's card is a card of its own; the ⋯ keeps its room
normalcoder_ on X (v0.1.4079, Usage > Overview): accounts inside a provider
card were told apart by a hairline only, and the card's ⋯ was drawn over
the end of the head ("Show the other accounts in brief" was hidden).

- renderQuotas puts each account of a card with several into a
  .subscription-acct box (a provider's keys, a balance a line, stay
  lines); quotaCardMenu looks through the box for the account's head.
- The head keeps 18px for the ⋯ whether it shows or not; where nothing
  hovers, the ⋯ is always shown.
- Core budgets +57 (app.js) / +81 (core): renderQuotas draws every card,
  so there is no page to move it to.

Run (mote, both engines):
- usage-card-menu-room.test.cjs: 20/20 here; red 20/20 on origin/main
  0b8c4bfc3. usage-account-subcards.test.cjs (next commit) guards the
  sub-cards; red on origin/main too.
- go test ./internal/gui -run Budget: ok.
- ~110 usage/quota/i18n GUI files: every red is the same on origin/main
  0b8c4bfc3 and filed: usage-agents-hide (#3414), usage-cards-hide de 560
  (#6294), usage-fold webkit (#6003, #3415), usage-hidden-way-back (#6295),
  usage-ledger Requests (#5048), usage-range-times (#6499),
  usage-speed-all-models (#5834).
- usage-fold "most on one screen" is red on main (#4790, 12 chromium of
  15 wanted); with the boxes it is 11, one account fewer.

Not run: the whole GUI suite before the push; the real Linux app.
2026-11-14 23:49:01 +08:00
yetone 1106a33a89 routing: every account row in Accounts and keys shows all its windows
zwm_vincent on X: with two subscription accounts, Accounts and keys
showed one window per row, 5H on one and 7D on the other, so neither
row said what was left in the other window or when it reset.

A subscription account's row now has one line per window Usage read:
the short name (5h, 7d), a small bar, what is used or left, and when
it resets. Each part's column is as wide as the widest down the list
(in ch, CJK counted double), so the names, bars, values and resets
start at the same place on every row. Where a row is too narrow (the
list in columns at a phone's width, under 215px) the bar is left out
and the reset wraps under, alike on every row. The hover still has
each window in full with the day and time it resets and when it was
read. The single-figure status, the windows line and the bottom bar
are not drawn for such a row; wallets and accounts with no windows
keep their one line.

Tests: routing-account-windows.test.cjs adds a second account whose
binding window is the week and checks both rows show both windows with
their bars (40%/12%), the hover text, every column's left (and the
reset's right) equal across lines and rows, nothing cut, no sideways
scroll; en, zh, zh-TW, ja, de at 1100px and 420px, Chromium and WebKit.
routing-pooled-card and routing-read-allowances read the new lines.

Run at this head, rebased on origin/main aa358555f, on mote:
- The 7 routing GUI files (routing-answer-figures, routing-account-windows,
  routing-pooled-card, routing-read-allowances and the routing files they
  share helpers with): 108/108 ok, Chromium and WebKit, en/zh/zh-TW/ja/de,
  1100px and 420px.
- Both new tests on the old code: 86 fail, 2 pass.
- Every GUI file that loads routing or app.css (313 files): chromium 51
  and webkit 50 reds, each red on origin/main aa358555f too (#5872,
  #5262 zero-priced-free, #6561 text-size webkit, red 3 of 3 on main
  on mica). ctx-route-align was red here only, from a fractional
  min-height; fixed (54px) and green.
- go vet ./internal/gui, go test ./internal/gui: ok (160.8s).
Rebased on origin/main 171fce511 (app.js, i18n.js changed): ctx-route-align,
  i18n-keys, quota-credits and the 4 routing files above, 108/108 ok,
  Chromium and WebKit, on mote.
Broken by hand: the old client.js/routing.css under the new tests (above).
Not run: the whole GUI suite, the Go suite (no Go change), the real app
with a real account's windows (fixtures carry the reporters' figures).
2026-11-14 23:45:23 +08:00
yetone af62d3d646 routing: a try's answer in the caption is figures in fixed places
Puremilk_chun on X: the caption over the Routing stage told an answer
as one sentence ("Codex's own sign-in (gpt-6.1-sol) 以 high 推理强度
用 41 秒 完成回答 · 197.5k token · 35 秒 后出首字 · 40 token/秒 ·
请求缓存命中率 98%"). Its length and line breaks moved with every
value, so the reader had to find each one again.

The caption now lays the answer out as a grid: who answered, its model
and effort on top; under them the duration, tokens, first token, speed
and cache hit rate, each a value over its existing label ("Duration",
"Tokens", "First token", "Speed", "Cache"; no new strings). Five to a
line; three to a line where the stage is 720px or narrower (a byWidth
class, no container query, WebKit #1249). A figure the try doesn't tell
is a dash in its place, so the others keep theirs. The sentence stays
on hover and in the steps list below. The caption's min-height grew so
the next answer doesn't move the page.

Test: routing-answer-figures.test.cjs plays the reporter's request
(41 s, 197.5k, 35 s first token, 40 tok/s, 98%) then a shorter one
with no first token and no cache figure, and checks every part keeps
its x, its line and the caption its height, nothing is cut, the effort
sits on the account's line, no sideways scroll; en, zh, zh-TW, ja, de at
1100px and 420px, Chromium and WebKit.

Run at this head, rebased on origin/main aa358555f, on mote:
- The 7 routing GUI files (routing-answer-figures, routing-account-windows,
  routing-pooled-card, routing-read-allowances and the routing files they
  share helpers with): 108/108 ok, Chromium and WebKit, en/zh/zh-TW/ja/de,
  1100px and 420px.
- Both new tests on the old code: 86 fail, 2 pass.
- Every GUI file that loads routing or app.css (313 files): chromium 51
  and webkit 50 reds, each red on origin/main aa358555f too (#5872,
  #5262 zero-priced-free, #6561 text-size webkit, red 3 of 3 on main
  on mica). ctx-route-align was red here only, from a fractional
  min-height; fixed (54px) and green.
- go vet ./internal/gui, go test ./internal/gui: ok (160.8s).
Rebased on origin/main 171fce511 (app.js, i18n.js changed): ctx-route-align,
  i18n-keys, quota-credits and the 4 routing files above, 108/108 ok,
  Chromium and WebKit, on mote.
Broken by hand: the old client.js/routing.css under the new tests (above).
Not run: the whole GUI suite, the Go suite (no Go change), the real app
with a real account's windows (fixtures carry the reporters' figures).
2026-11-14 23:45:23 +08:00
yetone 90efddabae gui: providers can be picked and removed together (eiyuuzaki2333 on X)
Many API providers added meant removing them one at a time. Select, by
the Providers search box (shown with two or more), puts a box on every
row as Routing's groups and Library's lists have it: a click on a row
picks it rather than open its editor, Shift picks the rows shown
between, and the bar's box picks every row shown. Remove asks once, in
the app's own dialog, with the count and every name, then posts
POST /api/providers/delete {ids}. That runs provider.Delete for each
id, as the editor's Remove does, inside one agent.Reseat, so agents
move once, to where they end up. One it can't remove comes back in
`unremoved` with why, stays picked and is named in the status; the call
is refused only when nothing was removed. Done or Escape ends picking.

The rows, bar and removal are in pvpick.js, imported when Select is
first clicked. The core grows 270 bytes (pvSel, the button's click and
two lines in renderProviders), and coreScriptBudget is raised by that
with the reason. "{name} wasn't removed: {error}" moves from Library's
words into core i18n.js, since core code says it now.

Run (rebased on origin/main e6e0585bd, on mica; mote was over its 18
cores):
- go test -tags nogui ./internal/gui/ ./internal/provider/: ok
  (TestProvidersDeleteSeveral new; TestCoreScriptBudget ok after the raise).
- gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...: ok; go build: ok.
- GUI, chromium + webkit: provider-bulk-remove (new: en, zh, zh-TW, ja,
  de at 420 and 1100px), provider-remove, provider-find, provider-order,
  providers-off-fold, provider-search, provider-list-off,
  group-bulk-remove, library-pick-remove, i18n-keys, i18n-en-no-cjk: ok.
  found-skill-pick-remove's ja/de 420px subtests are red, and red the
  same at origin/main e6e0585bd in a clean worktree (#5013).
Broken by hand: the handler deleting only ids[:1] turns
TestProvidersDeleteSeveral red ("listed after: [b c d]"); the page
posting only the first id turns provider-bulk-remove red in every
language. Restored, green.
Not run: the full Go suite and the full GUI suite (mote overloaded,
mica running another session's GUI suite); not tried in the real app
with real providers.
2026-11-14 22:18:09 +08:00
yetone e6e0585bd3 antigravity: reword Hermes', OpenCode's, Codex CLI's and pi's identity lines, which Google refuses since 11-14 evening
Since about 18:43 on 11-14 Antigravity answers 429 "Resource has been
exhausted" to a system instruction holding "You are Hermes Agent"
(Hermes' current persona), "You are OpenCode", Codex CLI's "You are a
coding agent running in the Codex CLI" or pi's "a coding assistant
running inside pi", whatever quota is left (@ZhouYimingsjtu,
@Lmohn39 on X). Hermes' earlier persona is still refused as "You're …
created by", so it keeps its "built by". Tried on a real account
(gemini-3-flash), each alone: Codex GPT-6's prompt, Claude Code,
Gemini CLI, Qwen Code, Cline, Kilo, goose, Amp, Droid, Kimi, Aider and
Cursor pass as written.

agTurnedAway gains the four lines; agSaidAs rewords them "You're …" and
"running within pi", the smallest change that passed 5/5 on the real
account (gemini-3-flash: pi 1.5.0's full default prompt, both Hermes
personas, OpenCode's first lines, Codex CLI's prompt; claude-sonnet-4-6:
pi 5/5), through the antigravity plugin's cloak, which has the same
lines (plugins a617ecfd, antigravity 0.1.16, agy-cli 0.1.48,
antigravity-cloak 0.1.9). The refusal's hint names the agent: new
OpenCode, Codex CLI and pi hints, Hermes' covers both personas, word
for word the plugins' and the Routing page's (client.js HINTS, i18n
zh/zh-TW/ja/de).

Run (mica; mote was over its 18 cores):
- go test ./internal/gateway -run 'Antigravity|Cloak|CodeAssist': ok
- go test ./internal/gui: ok
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gateway
  ./internal/gui: ok
- node --test i18n-keys, i18n-en-no-cjk, routing-ag-turned-away
  (both engines): 38 pass
- gofmt -l: clean

Broken by hand: with the pi and OpenCode lines out of agTurnedAway,
TestAntigravityCloakRewordsEveryLineItTurnsAway and
TestAntigravityHermesHint go red.

Not run: the full go test ./... (mica had another session's full suite
running, mote over load) and the whole GUI suite; the change is
strings in four tables plus the hint switch.
2026-11-14 21:49:30 +08:00
yetone e0ed2c4d81 gateway: model ids without the provider can be listed alone, in place of provider/model
qQianye on X (v0.1.4094 in Docker, several WorkBuddy accounts): the
client on their computer lists every model as provider/model and they
want those hidden. The advice was the Agents page's model list, but
gateway mode (what the Docker image's web page runs as) has no Agents
page. Settings › Network and sharing › Model ids without the provider
was drawn there already, but only added bare ids beside the prefixed
ones, so the list got longer, not shorter.

The row is now Off / On / Only. Only (settings.BareModelIDsOnly,
POST /api/settings/bare-ids {"on":true,"only":true}) lists each bare id
in place of the first row it stands for (provider.OnlyBare) and leaves
the other rows it stands for out: the found group it reaches
(auto/glm-5.3) and every provider's row of that model it reaches. A row
the bare id doesn't reach (b/vendor/m9, whose bare id names provider
vendor), a held key's row whose bare id isn't listed for it, and other
groups keep their ids, so no model leaves the list. Requests by
provider/model are served as before; only /v1/models changes. Another
magpie's list is unchanged. Claude Code's discovery, which drops a bare
row it wouldn't keep because the full row is there, lists it by its
alias with Only (there is no full row). Off clears Only.

Run, at this commit (base 3dbbb173e, origin/main unchanged at push):
- go test -count=1 -timeout 45m ./... on mica: 101 packages ok, no FAIL
  (log kept whole at mica:~/runs/qq-sb/suite.log). gofmt -l clean;
  go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./... clean.
- GUI (Chromium + WebKit, 420 and 900, all five languages) on mica:
  bare-ids, i18n-keys, i18n-en-no-cjk, gateway-mode, settings-tabs-stick:
  66/66 pass. Not the whole GUI suite: mote was over its load and mica
  holds another session's GUI run.
- Broken by hand: with Only ignored in listModels, TestBareModelIDsOnly
  is red (every provider row listed); with Claude Code's bare rule left
  as before it is red (1 of 5 models listed to discovery).
- Docker-style run on mica: the built binary as `magpie serve
  --web` with the image's env (HOME/XDG under a sandbox, MAGPIE_ADDR,
  MAGPIE_WEB_KEY), two custom providers serving kimi-k3 and glm-5.3; the
  page boots with gateway:true and draws #bareIdsRow. /v1/models:
  Off  auto/kimi-k3 auto/glm-5.3 wb1/kimi-k3 wb1/glm-5.3 wb2/kimi-k3 wb2/glm-5.3
  On   the same, then kimi-k3 glm-5.3
  Only kimi-k3 glm-5.3
  kimi-k3 answered by wb1, wb2/kimi-k3 still by wb2.
Not tried: a real WorkBuddy plugin account, and a client reaching it
through another magpie (whose list never takes bare ids).
2026-11-14 21:05:50 +08:00
yetone 1ab2c39843 tray: the menu bar and panel leave out what Usage's Overview hides (onkashiko on X)
onkashiko on X: a quota hidden in the main window still showed from the
menu bar. 7ea1e6a4b made the tray panel and the TUI leave out Overview-hidden
cards and rows, but two gaps were left:

- The menu bar's cells, its tooltip and Windows' tray figure still showed a
  hidden card and its hidden rows. trayUsageCards now goes through
  trayShown: a cell naming an account takes the card the Overview still
  shows (its balance with its plan hidden), a cell following the account
  in use (`|*`) picks that account among every card as before and is left
  empty while its card is hidden, never moved to another account. Hidden
  rows are left out, a card never left with none. settings.TrayUsages is
  untouched, so the cell comes back with the card.
- POST /api/usage/arrange now wakes the menu bar (onTrayUsage) when
  cardsHidden or windowsHidden is sent, so a hide or unhide reaches it at
  once rather than at the next tick (3 minutes by default).
- The panel hid a card after keyCards had put a key's balance on its plan's
  card, so "Hide its balance from Overview" left the balance on the panel's
  plan card, and a hidden plan took its unhidden balance with it.
  panelPageCut now takes the quotas as read and leaves the hidden out before
  keyCards, as overviewCards does; gone counts a merged card hidden only
  when its plan and balance both are.

The Go hide rule (cardHideKey/usageShown) moved from internal/tui to
internal/provider (ShownQuotas, QuotaCardHidden, QuotaRowsShown,
QuotaHideKey), shared by the TUI and the menu bar. Not changed: Bark's
daily push still warns about a near-limit hidden card (an alert, not a
display). Docs: settings.go comments, docs/subsystems/gui-shell.md.

Run on mica (mote at load 117 on 18 cores), at base ee6352b63:
- go test -count=1 -timeout 45m ./internal/gui ./internal/tui
  ./internal/provider ./internal/settings: all ok.
- go vet of those packages; GOOS=linux go vet -tags nogui and GOOS=windows
  go vet of internal/gui, internal/tui, internal/provider: clean. gofmt -l
  clean.
- GUI (Chromium + WebKit, en/zh/zh-TW/ja/de): panel-hidden-balance (new),
  panel-page-hidden, panel-arrange: 28/28. panel-balance-order,
  usage-rows-hide pass. usage-cards-hide and usage-hidden-way-back are red
  at "de 560" (no sideways scroll), the same 8 on an origin/main
  ee6352b63 copy (#6294, #6295). tray-cell-click "chromium zh/en" is red
  1 run in 3 on origin/main as on this tree (#5215).
Broken by hand: panel-hidden-balance is red on origin/main's assets
(the plan card carries the hidden balance, MiniMax's balance gone);
TestTrayLeavesOutWhatTheOverviewHides is red with trayShown returning
trayPick, TestUsageArrangeWakesTheMenuBar red with the onTrayUsage call
removed.
At the pushed head (rebased on 534b1a334, which adds installdir_windows.go):
GOOS=windows go vet ./internal/gui ./internal/update and go test -run
"TestTray|TestUsageArrange|TestCoreScriptBudget" ./internal/gui: ok.
Not tried: the real menu bar on a Mac or Windows with a real account; no
full go test ./... (a full suite was running on mica).
2026-11-14 19:37:57 +08:00
yetone 106a24b95e library: skills from GitHub and git update by themselves when switched on
0xYaCo on X: "skill 能自动化升级吗?". magpie already checked for skill
updates by itself (every 12h, as the Skills tab opens), but each update
waited for a click on Update. A new switch, Update by themselves, sits
under the Skills list while a skill comes from GitHub or git
(POST /api/library/skills/auto-update; `magpie library skill auto-update
on|off`; library.json's autoUpdateSkills, this computer's own). It is off
by default. When it is on, KeepSkillsCurrent (a gateway.WhileServing loop)
runs AutoUpdateTick 2 minutes after start and then hourly. Every 12h that
runs CheckSkills, then UpdateSomeSkills on the skills found at "update".
So a skill changed here stays in Unupdated with its Update button, one
removed upstream is only marked, and a replaced edited version goes to the
backups, as with an update by hand. Updated names and a new error are
logged.

Run (WSL2 magpie-desktop, Go 1.26.8; mote was at load 167, mica's disk full),
at ab637d3c4 (this change on 14807bcf2):
- TestAutoUpdateSkills (local git repo fixture, no network) ok.
  Broken by hand (switch and due checks removed): FAIL
  "off: ... Updated:[pdf] ... notes "two"". Restored: ok.
- -race -count=5 TestAutoUpdateSkills|TestInstallFromGitRepo: ok
- gofmt -l: clean; go vet -tags nogui ./... ok; GOOS=windows go vet ./...
  ok; go build -tags nogui, GOOS=windows go build ok
- go test -tags nogui -timeout 45m ./... under a temp HOME: every
  package ok except two reds in untouched packages, each also red alone
  at origin/main 659ca3f02: internal/update
  TestSettleAsksAboutADownloadKeptElsewhere (filed #6648) and
  internal/usage TestRequestStateKeptAcrossACatalogFetchedAgain (#6572).
- GUI: skill-auto-update.test.cjs (en, zh, zh-TW, ja, de; 400px wide;
  Chromium and WebKit), i18n-keys, i18n-en-no-cjk, skill-update-feedback
  and skill-update-edited: 36/36 pass.
Not run: the whole GUI suite had started but not finished at push
(pushed at the coordinator's ask), and nothing was run at the rebased head
e0e8f34a7 (its parents touch lessons/update only). No darwin vet: the
cgo-off cross vet fails in gui's traywindows_darwin_test.go on main too.
Not tried with a real GitHub skill in a live magpie.
2026-11-14 19:09:55 +08:00
yetone a71aa25d22 routing: a session's Avg. speed says the wait for the first token is left out, and gives the speed with it counted
@verymoes on X (tweet 2121533934332985393): an opencode session over
the Command Code plugin read "平均速率 142 token/秒" on Routing's
By session row, while CC Switch read ≈77 tok/s for the same 26-27
requests and opencode's footer 76.7 tok/s, and asked whether magpie
counts wrong.

It doesn't; the three divide by different times. magpie's average is
Σ answer tokens over Σ (end − first token) of the timed replies
(decodeOf; for a reply that reasoned, its answer from its first text),
so the wait for the first token is left out. CC Switch's "≈" is its
estimate from the session log's timestamps, which it documents as
counting the wait for the first token (src/components/usage/format.ts,
docs/user-manual 4.4). opencode's footer is one turn, not the session,
and counted from the request until #63321 (11-11) moved it to the first
streamed token, with reasoning tokens added in. With a ~28K-token
prompt each and short agent replies, the wait is about half of a
request's time, which is the gap. Nothing in the measurement is wrong,
so it isn't changed; the tooltip now says what it measures:

- "the time from each reply's first token to its end; the wait for the
  first token, and replies without usable timing, are left out" in
  place of "total decode time; excludes waiting";
- a line with the same timed replies over their whole time, the wait
  and the reasoning counted ("Over each request's whole time ...:
  N tok/s"), the number a tool that times the whole request reads.
In zh, zh-TW, ja and de. The Usage page's speeds and a row's own speed
already say "from its first token to its end".

routing-request-metrics checks the tooltip's wording and its whole-time
number (4,000 tokens over 82 s, 49 tok/s, beside the 133 average) in
en and zh, both engines.

Run on mica at this tree (mote was over its 18 cores):
- node --test, Chromium then WebKit: routing-request-metrics,
  reasoning-speed, routing-burst-speed, routing-speed-first,
  routing-row-floor-speed, routing-sessions, routing-by-key,
  routing-session-title, i18n-keys, gui-ja, gui-de, gui-zh-tw.
  Chromium 191/191; WebKit 101/102, the one red reasoning-speed's
  cut-off fetch (#1350), fixed in the commit before this.
- Broken by hand: the test against the old client.js and i18n.js is red
  in all four (chromium/webkit × en/zh) at "the tooltip says the wait
  for the first token is left out".
No Go code changed. Not tried with the reporter's data: their session
isn't on this machine, and the owner's Command Code account answers
401.
2026-11-14 18:01:16 +08:00
yetone b592c1fde1 masking: the page counts each agent's requests looked over, nothing masked in them or not
eiyuuzaki2333 on X: the Gateway page showed Pi's calls, the Masking page
records from dsh alone, and nothing said whether Pi's requests were
masked. They were: a Pi turn goes through the same masking as every
agent's, on each API Pi uses (chat completions, responses, messages),
with no agent or protocol scoping. But a record is made only for a
request masking changed (noteMasked: hits or held values), and the
page's agents came from records alone, so an agent whose requests
carried nothing to mask didn't appear at all, the same as one never
masked.

Now, while masking is on for a request (redactionWantedFor, a key's own
switch included), the gateway counts it under its agent
(maskrec.Checked): looked over, and whether masking changed something,
or sent as written to a model the user set to go unmasked. The counts
hold no text: a small checked-<day>.json beside the day's records,
written over through temp and rename at most every 5 s, read back after
a restart, pruned at 30 days with the records and removed by Clear
records. /api/masking/summary returns them as checked.

Counted where a turn's masking is decided: serve (every routed chat
turn, plugins and groups included), Codex's own sign-in's /responses
turn, and the native API passthroughs (nativeArk, nativeAny). Not
counted: searches, images, video, embeddings, System One's decisions and
Codex's compactions, which are not an agent's turn; they keep their
records as before.

The Masking page's card lists each agent under the flow: "Pi · 128
checked · none to mask · 3 sent as written". A click narrows the list
to it; the agent picker lists checked agents too; and a list with no
records says "128 requests from Pi checked, and none carried anything to
mask" instead of "Nothing masked matches these filters". Strings in zh,
zh-TW, ja and de.

Run (code at this head; first at base c41fa8e47 on mica, then rebased
on origin/main d987cc7d5 on mote):
- c41fa8e47, mica: go test ./internal/maskrec ./internal/gateway
  (-timeout 45m, 986s) ./internal/gui: ok.
- d987cc7d5, mote: go test ./internal/maskrec ./internal/gui: ok;
  go test -run "Checked|Masked|Mask|Codex|Native" ./internal/gateway: ok.
- GUI on mote, Chromium + WebKit: masking-records 124/124 (every
  language at 640px, en at 1100px), i18n-keys 4/4, i18n-en-no-cjk 4/4,
  mask-actions, mask-alert, mask-emails, mask-value-menu, masking-demo,
  masking-demo-unblurred, routing-masking, gateway-key-redact,
  group-redact, redact-route, window-mask: all pass. Screenshots checked
  in WebKit, en 1100 and zh 640.
- GOOS=linux and GOOS=windows go vet ./internal/maskrec ./internal/gateway:
  ok (internal/gui's cross vet stops in wails' cgo, as on main); gofmt -l
  clean.

Broken by hand: without the noteChecked line in serve,
TestPiTurnsCountedAsChecked fails ("three turns with nothing to mask:
{Looked:0}"); without the one in codex_backend.go,
TestCodexOwnSignInKeepsItsMaskingTime fails (Looked 0).

Not tried: a real Pi binary against a built magpie (the test sends Pi's
own headers: magpie's token, User-Agent pi/…, X-Session-Affinity, on
each of its three protocols); the counts across a real restart of the
app (the unit test reads the day's file back after a reset).
2026-11-14 17:38:39 +08:00
yetone 01c3efc4f7 library: billion-context's compression markers can be switched off (@JamesYu32 on X)
@JamesYu32 asked for a switch that turns off the markers billion-context
adds after it folds: compress.visibilityMarkers. In bili 0.1.213
(CONFIGURATION.md, dist/index.js) it is a boolean, true by default; true
appends the 📦/❌ line after a compress, decompress, search_context or
acp_status call and re-injects it into the rebuilt history, false drops
both, and the tool calls still run. Some models imitate the markers.

The billion-context tab's Advanced fold gets "Show compression markers",
on unless the file says false. Off writes compress.visibilityMarkers:
false through edit.PatchJSON (comments and every other key kept); on
takes the key out, back to bili's default, rather than leaving a value
magpie chose. A provider's or model's own compress.visibilityMarkers is
the user's and is left as it is; a non-boolean value (which bili
rejects) is not read as off. The running bili is asked to reload, as
for the other settings. Under Advanced because it is rarely changed.

Run (mote, at this tree on origin/main df2b819c6):
- go test -count=1 ./internal/library/ ./internal/gui/: ok (117s, 136s)
- go vet ./internal/library/ ./internal/gui/; GOOS=linux go vet -tags
  nogui and GOOS=windows go vet of both: clean. gofmt -l: nothing.
- node --test of every library*.test.cjs and i18n*.test.cjs (81 files,
  Chromium and WebKit, every language, 1100 and 420 wide): 1753 of
  1754 pass. library-bili-settings now switches the markers off under
  Advanced and checks the post is {markers:false}. The one red is
  i18n-keys "a plugin's words are its own": third_party/yaml.v3/yamlh.go
  (0caa09b3d) says the usage plugin's "Error type"; red on origin/main
  without this change, fixed in the next commit.
- Real bili 0.1.213 (npm, sandbox HOME/XDG on mote): started with
  {"compress":{"visibilityMarkers":false}}, GET /__bili/config showed
  "compress": {"visibilityMarkers": false}; with the key taken out,
  POST /__bili/config/reload answered 200 and the config had no
  visibilityMarkers (default on).

Broken by hand: on writing true instead of taking the key out,
TestBiliMarkersSwitch fails ("turning markers back on left the key in").

Not tried: a real agent session through bili to watch the markers
disappear from the model's view; only the config bili loads was checked.
2026-11-14 15:33:24 +08:00
yetone 7ea1e6a4b3 usage: the tray panel and the TUI leave out what the Usage page hides
onkashiko on X: a provider whose allowance card was hidden in the main
window (Usage > Overview, "Hide from Overview") still showed in the menu
bar's panel. The panel's Allowances tab had only its own Arrange list
(panelUsageHidden) and read the full cards.

Now the panel leaves out a card whose cardHideKey is in usageCardsHidden
and the rows in usageWindowsHidden (withoutHiddenRows), as Overview does;
a menu bar cell's card still shows (panelPeek). A subscription whose
every card the page hides counts in the foot's "{n} hidden" and shows as
hidden in Arrange; Show there
also drops its keys from usageCardsHidden, since the panel follows the
page. All of it is panelPageCut in the Usage plugin's page.js, which every
window loads, so the core scripts get no bigger (TestCoreScriptBudget
unchanged). Hiding from the panel alone still leaves the page as it is. The
panel reads settings again each time it is shown (loadBack), so a hide or
unhide in the main window reaches it with no restart.

Siblings: magpie tui's Usage page leaves out the same cards and rows
(usageShown, read at every quota read). The menu bar's cells and tooltip
show only the cards picked in Settings, so they keep a hidden card as
before; routing, caps and counting are unchanged.

Run:
- panel-page-hidden.test.cjs (new): chromium + webkit, en/zh/zh-TW/ja/de,
  10/10 green; red on the old app.js/panelarrange.js (cards still drawn).
- TestUsagePageLeavesOutWhatTheAppHides (new): green; red on the old
  pages.go (balance, account and row still listed).
- GUI: the 128 files that read the panel, Usage or tray code, chromium +
  webkit, every language, on mote: 17 files red, rerun alone at
  concurrency 1 here 123/449 red and at origin/main 015860f2d 122/449,
  the same tests but tray-cell-click's chromium en, which is red alone on
  main too (#5215); the rest noted on #5475. tray-cell-click + panel-arrange +
  panel-page-hidden together before the last rebase (no GUI file changed
  in it): 21 of 22, the one red tray-cell-click's (#5215). At this head
  (after the move into page.js): panel-page-hidden, panel-arrange,
  panel-balance-order and i18n-keys green; the reds in key-balance-card
  (de), panel-fold, tray-cell-click (zh) and usage-cards-hide are each
  in the origin/main 015860f2d record above.
- Full suite (go test -tags nogui -count=1 -timeout 45m ./...) on mica
  under suite.lock at 734f06b64 (this change before the move into
  page.js): 97 packages ok; internal/gui red only on TestCoreScriptBudget
  (fixed by the move), internal/gateway red from "too many open files in
  system" at mica's load ~65. At this head on mote: internal/gateway,
  internal/gui, internal/tui, internal/settings and internal/redact (the
  one commit rebased over) ok; gofmt -l clean; go vet, GOOS=linux go vet
  -tags nogui and GOOS=windows go vet ./... clean; go build ok.
- Rebased onto origin/main 667ac8bd6 (5faed634d): internal/gui (budget
  included), internal/tui and internal/settings ok on mote;
  panel-page-hidden + panel-arrange 18 of 18.
Not tried: the real tray panel by hand on a live install.
2026-11-14 14:10:24 +08:00
yetone 27c998aba0 usage: the tray panel's and Requests' costs follow each provider's currency
onkashiko on X: with Currency set to By provider, the menu bar panel
still showed every cost in one currency; providers and models were not
each in their own. drawLedColumns and drawLedRank (shared by the tray
panel and the window's Requests tab) formatted every value with no
provider, so fmtCost fell back to the Totals in currency.

- usageapi.Ledger echoes the provider a page is filtered to
  (`provider`, omitempty).
- app.js: ledProv(l, split, id) names the provider of a value: the
  ledger's filter, the row's provider (provider split), the provider
  part of a modelAt id, or for a model split the provider(s) that served
  it when they all share a currency. ledFormat/ledFormatLong take it,
  so the rank's values and sub-lines, the tooltip's rows and the axis
  (when one provider is picked) are in that provider's currency. Sums
  (the panel total, the tooltip total, a model served in two currencies)
  stay in the Totals in currency.
- page.js: the Requests head and the cost head use the filter's
  provider; the heatmap tip too. Other fmtCost calls are sums or
  sessions with no provider and are unchanged.
- core script budget +491 (1,269,040 -> 1,269,531): drawLedColumns and
  drawLedRank are drawn by the panel, so there is no lazy page to move
  this to; packed to the shortest form.
- docs/subsystems/gui-shell.md says how By provider reaches the panel.

Run:
- At 065fb6a8b (rebased on 7d5475769), mote: gofmt clean;
  TestCoreScriptBudget and TestLedgerSaysItsOneProvider ok;
  panel-currency-provider.test.cjs 20/20 (chromium + webkit x en, zh,
  zh-TW, ja, de; panel 440/320px, window 1100/420px, no sideways
  scroll, no page errors).
- At ff3ab573d (same change on 90932ed1f), mica, under suite.lock:
  go vet darwin, linux nogui, windows ok; builds for all three ok;
  go test -tags nogui -count=1 -timeout 45m ./... : 99 packages ok,
  exit 0. mote: go test usageapi, gui, usage ok.
- GUI suite, the 155 files the change can reach, mote: 2581 tests, 105
  failures in 13 files; the same 13 files give 104 at 90932ed1f. The
  one extra is tray-cell-click webkit en, flaky on both trees run
  alone (head green twice, base red once). Filed: grip-inset,
  key-balance-card, panel-fold, tray-cell-click, usage-* (#6293,
  #6294, #6295, #6499, #6003, #5872, #6414, #5869, #5796, #5215,
  #4790); panel-shortcut's 20 reds newly filed as #6606.

Broken by hand:
- panel-currency-provider on the old assets (MAGPIE_ASSETS): 20/20 red,
  with the reporter's symptom (DeepSeek $1.00, SiliconFlow $0.500
  under By provider).
- TestLedgerSaysItsOneProvider red with `out.Provider = f.Provider`
  removed.

Not tried: the real app's tray panel with real yuan and dollar
providers.
2026-11-14 12:42:46 +08:00
yetone 71a806749d sessions: a paginated Codex rollout moves to a longer provider id by its row (@xMopf7RF on X)
@xMopf7RF on X (tweet 2121441393424113800): the Sessions page's Move
refused an old Codex session with "rollout-2026-03-09T09-25-….jsonl.zst
keeps its history by byte, and "magpie" is longer than the provider it
names: Codex couldn't open it moved", and offered nothing else.

Since 67b12956a a paginated rollout's session_meta is only rewritten at
its own length (Codex keeps places in it by byte), and MoveCodexProvider
refused a longer id outright. But Codex reads a paginated thread's
provider from its row in the state database, never from its file
(codex-rs read_thread; RetagPagedCodexThreads already moves such threads
by the row alone, tried with the real codex 0.166). So now
rewriteCodexProvider leaves such a line as it was and says so (kept),
and moveCodexPaths moves the thread by its row. Every caller gets it:
the Sessions page's Move, Resume's move first, and the sync's
MoveCodexThreads/MoveRecentCodexThreads, which met the same refusal for
a provider shorter than magpie.

With no row to move it by, it can't move at all: it is refused as
sessions.StuckError, every file put back and no trash copy left, and the
API says stuck with the provider it stays on. The page then says why,
that the session stays on that provider unchanged and shows in Codex when
Codex uses it again, and that Delete clears it into magpie's trash, where
it can be restored. New string in zh, zh-TW, ja and de.

Run, at 7951989c6 (on origin/main e0889719c):
- go test -count=1 -run 'TestMoveCodexProvider|TestRetagPaged|TestPortCodex'
  ./internal/sessions/ on mote: ok.
- Old code back (codex_provider.go from e0889719c, StuckError stubbed):
  TestMoveCodexProviderPagedByRow and TestMoveCodexProviderPagedNoRow
  FAIL with the reporter's exact error text; green with the change.
- node --test sessions-codex-provider-stuck, sessions-codex-provider,
  sessions-codex-provider-pick, i18n-keys, i18n-en-no-cjk on mote,
  Chromium and WebKit, five languages, 900px and 420px: 42 of 42 pass.
  The new GUI file with the old client.js: 0 of 20 pass.
- gofmt -l on the changed packages: nothing.
- Full suite (vet x3, builds x3, go test -tags nogui ./... -timeout 45m)
  queued on mote's suite lock; pushed before it ran, per the owner's
  ship-at-once rule. Its result goes in a follow-up.

Not tried: a real Codex resuming a thread moved this way. The row-only
move is the one RetagPagedCodexThreads makes, which was tried with codex
0.166.0 exec resume (docs/subsystems/agent-wiring.md). Not reproduced:
the no-row case with real Codex, where Codex 0.166 keeps a row for every
paginated thread; it is covered by a fixture only.
2026-11-14 11:42:17 +08:00
yetone a83fe23252 gui: a picked accent tints the chosen thumb too (CHENGJIAHEGOXIS on X)
「强调色是按照颜色走的,但是主题深色依然还是灰色」 and 「就是我截图的原来的
灰色,还是没变化」: after ed63a5be5 the chosen option's word took the
accent, but the thumb under it stayed the theme's grey. In the dark theme
that is what the eye reads (Settings › General: the Dark segment and the
Off/On switches, with a purple accent and a wallpaper), so it still looked
grey.

- accentVars adds --mark-fill: the accent over white at 12% (light), over
  the dark switch thumb #3a3a3f at 26% (dark). --mark is now made to read
  at 4.5:1 on that fill as well as on the old surfaces (inkOn takes
  several).
- The same "chosen" grounds use var(--mark-fill, <their own grey>): every
  segmented thumb (.thumb, .seg > .thumb, so .segs/.ptabs/.sse-views),
  #gatewayKeys .klf-tab.on, .am-seg, .day-chip, .warm-tabs,
  importapps .apptab, Sessions' .sm-agents .opt.on, and Context's
  .ctx-look-b.on (which also takes --mark for its icon).
- --mark-fill is never set without an accent, so magpie's own look and
  Omarchy are unchanged: the fallback is each rule's old value.
- Not tinted, on purpose: the side-nav's open-page row (its icon already
  takes --mark, as a Mac sidebar does), list selections, icon buttons.

Tests:
- TestAccentReadable reads --mark-fill, checks --mark on it in both themes
  for eleven picks, and that a purple's fill is not grey.
- appearance-look.test.cjs: the window test reads the thumbs of Theme,
  Loading bird and Reduce motion: the card's grey with no accent, the
  fill for #0d9488 and #db2777, and the grey again on Default, in
  Chromium and WebKit, light and dark.

Run (on mote, macOS; mica's and mote's suite slots were busy):
- gofmt clean; go vet -tags nogui ./internal/gui on darwin and
  GOOS=linux, GOOS=windows go vet ./internal/gui.
- go test -tags nogui ./internal/gui -run 'TestAccent|TestLook|TestWallpaper|Budget|CSS': ok.
- appearance-look 36/36.
- 21 GUI files the change reaches (seg-contrast, segs-glide,
  segs-press-redraw, sidebar, sidebar-glide, api-key-theme, checkbox-look,
  omarchy, context-map, sessions-manage, sessions-toolbar,
  gateway-key-limits, provider-rate-windows, editor-thumbs-batched,
  import-opencode, i18n-keys, settings-sections, settings-groups,
  strip-scrollbar, panel-options-fold, appearance-look), both engines,
  every language and width they cover: 330/364. The 34 reds are the same
  34 tests at origin/main e0889719c run alone: api-key-theme 6 (#6444),
  segs-press-redraw 24 (#4566, #3922), omarchy 2 (#6027), settings-groups
  2 (filed #6597).
- Broken by hand: with the old app.css the new thumb checks are red, 4 of
  4 window tests. Screenshots of Settings › General, Chromium, dark and
  light, default/teal/pink: default identical, the accent's thumbs tinted.

Not tried:
- The whole GUI suite and the Go suite (both machines' suite slots busy).
- The real macOS app, Windows WebView2, Linux WebKitGTK.
2026-11-14 11:30:34 +08:00
yetone 8ed2ae030c claudetui: an image goes into the interactive mode on Windows 10 as a long paste, not -p (ok123now on X, #5061)
ok123now (magpie v0.1.3901, Windows 10 LTSC 21H2, Claude Code 2.1.316,
Claude Desktop): text worked, one 64x64 PNG was a 502 every try, and the
client asked again without end.

Cause: the helper pastes an image as its file's path in bracketed-paste
marks. Windows 10's conhost (10.0.19041) drops the marks on the way in
(the reporter's lead; #5061 and #5205 measured it on 19044 and 19045),
so Claude Code got the path as typed words, the helper waited out
pasteWait and exited 1, and the gateway answered 502.

Fix:
- claudetui: Claude Code reads its console as VT input (mode 0x208, read
  from a real claude.exe 2.1.316) and takes one read of over 800
  characters as a paste with or without the marks ($X=800 in 2.1.316,
  q6=800 in 2.1.281), a path with spaces after it as the image alone. On
  Windows the path is sent padded with spaces to 900 characters, no
  marks: over 800, and under the 1024-byte blocks the same conhost loses
  of a longer write (#5205). Elsewhere it stays bracketed.
- If the interactive mode still doesn't take a message (an image, or a
  block it can't paste), the helper ends the turn with an error result
  beginning claudetui.Unpastable instead of exiting, the gateway asks it
  once as claude -p with the image itself, and remembers that for 12
  hours. A redo that can't run is a 400, not a 502, so no client loops.
- The reporter asked to keep images interactive: -p counts at about
  twice the plan quota and has none of the interactive run's cache. The
  -p reason (Routing chip, all four locales, and the log line) says so.

Run, at this head (rebased on 925bc7188):
- win-run (Windows 11 26200): ./internal/claudetui; every test passes
  but TestShimFirstMessageWaitsForTools, red on the old code too (#4810).
  TestShimPaddedImageTakenWithoutMarks 3 of 3, TestImagePasteWindowsLength.
- The helper on a real claude.exe 2.1.316 in a ConPTY (sandbox
  CLAUDE_CONFIG_DIR, ANTHROPIC_BASE_URL to a closed port): padded and
  bracketed, the image reached the transcript as an image. A direct
  probe: bracketed and padded paths shown as [Image #1], a bare path
  stays words.
- wsl-run: ./internal/claudetui ok; go vet of claudetui and gateway on
  Linux and Windows.
- GUI: routing-entry, routing-intent-entry, claude-mode,
  claude-tui-setting, i18n-keys, i18n-en-no-cjk in Chromium and WebKit
  (Linux), 112/112.
- Full suite, wsl-run (Linux), go test -tags nogui -timeout 45m ./...:
  every package ok (gateway 883s, claudetui 164s) but internal/usage's
  TestRequestStateKeptAcrossACatalogFetchedAgain, a catalog CacheKey red
  already filed as #6572 and untouched here. The mote suite stayed queued
  behind other sessions' runs, so the suite ran on Linux.

Broken by hand: TestShimPaddedImageTakenWithoutMarks on the old code
(bracketed paste, fake console dropping the marks) is red: the shim
wrote 1 line of 3 in 30s. Its bracketed half is the old behaviour and
ends in an Unpastable error result, not an exit.

Not tried: a real Windows 10 21H2 console (no such box here); the -p
redo with a real Claude subscription. Long pasted text on Windows 10
still loses 1 KB blocks (#5205); this doesn't change that.
2026-11-14 10:48:55 +08:00
yetone 925bc7188b usage: the Requests card's up arrow opens what the bytes sent upstream were made of
theforeveriris (X, 2121408745616162998) saw 8169 requests send 8.6 GB
up and 1.0 GB down and wanted to know why. About 1 MB a request is
normal: every request sends the whole conversation again, with the
system prompt and the tools' definitions. This shows it.

Gateway: promptOf, which already parses the body off the request path,
now also counts the bytes of the system prompt, the tool definitions
and images in the body it read. upParts scales those to the wire bytes
and puts them on Record.UpParts. Nothing new runs on the request path,
and a body that isn't parsed stays "Not measured".

Usage: a packed row keeps the mix in 255ths under flag rowUpParts
(32768); the row stays 152 bytes. Totals gain up_calls, up_measured,
up_system, up_tools and up_images, and Shares carry up_bytes and
up_calls by agent and by model. settledCountVersion goes 4 -> 5, so
settled days are counted again once on the next start.

GUI (Usage -> Requests): the "↑ 8.6 GB" on the Requests card is a
button that opens a "Sent upstream" card: the average per request, one
sentence on why, a bar and legend for Conversation / Tool definitions /
System prompt / Images / Not measured, and the top 8 agents and models
with bytes sent and per request. The open state is kept; × closes it.
A request's details get a "Made of" line. zh, zh-TW, ja, de strings.
Entrance is 200ms ease-out, no movement under reduced motion.

Run (mote, at this head on 27e43ed26):
- go test ./internal/usage ./internal/usageapi: ok
- go test -run 'Prompt|UpParts|UpBytes|DownBytes|Traffic|Ledger|
  CodexOwnTurn' ./internal/gateway: ok
- go test -run Budget ./internal/gui: ok (after the rebase)
- go vet -tags nogui for darwin, linux, windows on usage, gateway,
  usageapi, gui: ok; gofmt -l clean
- GUI: usage-upload.test.cjs 32/32 (chromium + webkit, 1180 and 420,
  en zh zh-TW ja de); with i18n-keys, i18n-en-no-cjk,
  usage-ledger-bytes, usage-traffic, usage-ledger-detail: 144 pass,
  0 fail
- GUI subset i18n*, usage*, ledger* at f1f34d624: the only reds are
  usage-agents-hide, usage-cards-hide, usage-fold,
  usage-hidden-way-back, usage-ledger, usage-range-times and
  usage-speed-all-models. They are red the same way on origin/main
  f1f34d624 without this change and are already filed (#3414, #3415,
  #6003, #6294, #6295, #6499, #5834).
- Screenshots of the card: chromium en 1180 light, webkit zh 1180
  dark, chromium zh 420 light.
- Benchmark: promptOf on a 1.17 MB body, 2.8-3.9 ms/op with counting
  vs 3.2-3.7 without, same allocations (noise).
- Broken by hand: without the b.again guard,
  TestPromptKnowsWhatItsBytesWere goes red.

Not run: the full go test ./... and the full GUI suite. mote and mica
were loaded, with a suite already queued under suite.lock.
2026-11-14 10:22:25 +08:00
yetone ed63a5be5e gui: a picked accent colours what is chosen (CHENGJIAHEGOXIS on X)
「选中任意强调色没反应」: picking an accent in Settings › General seemed
to do nothing. The token did apply. With the real server, in Chromium
and WebKit, under light, dark and system, with and without a background
image, --accent was set by lookCSS and kept. Neither the theme nor the
wallpaper overrode it. But nothing on Settings, the sidebar, the header
tabs or the panel's tabs used --accent: every chosen option is graphite,
var(--fg), by design. So the colour only showed in a few buttons
elsewhere.

The fix is a --mark token, the ink of what is chosen.
- It is var(--fg) by default, so magpie's own look is unchanged, like a
  Mac's Graphite.
- accentVars sets it once the user picks an accent. It is moved toward
  black (light) or white (dark) until it reads at 4.5:1 on the surfaces a
  chosen option sits on: --pill-hover #e9e9ee, and the dark switch thumb
  #4c4c52.
- It is used by .seg/.opt/.ptabs/.warm-tabs/.am-seg/.klf-tab/.day-chip/
  .apptab .on, the header nav's chosen tab, the side-nav's open-page icon
  and Settings icon, and Library's switches and radios. Each is the same
  "chosen" role, so all of them follow the accent, not just one.

Tests:
- appearance_test.go's TestAccentReadable checks --mark's contrast on
  each surface, in both themes.
- appearance-look.test.cjs adds 8 tests, in Chromium and WebKit, light
  and dark:
  - Settings' theme and bird options and the side-nav icon at 1200 with a
    wallpaper set: graphite by default, the mark for #0d9488 and #db2777,
    and back to graphite on Default.
  - The header tabs at 900 and the panel's tabs at 380.

Run:
- gofmt clean. go vet ok on darwin, GOOS=linux -tags nogui and
  GOOS=windows (at 75bdc85fe, the same change on an older main).
- At 6f5549b1f (this change on 08f77528f), on Linux (WSL magpie-desktop),
  since mote's suite queue was hours deep:
  - The whole GUI suite, Chromium and WebKit, every language and the
    panel widths: 27231 tests, 1258 red in 183 files. The same 183 files
    at the parent were 1226 red. The 70 tests red only with the change
    were rerun with their 43 files at concurrency 2: 80 red with it, 89
    at the parent 783b69b8c. Every one left has a language or width
    sibling red at the parent too. None is about colour. They are the
    Linux reds #5559 and #4388 track.
  - go test -tags nogui ./... -timeout 45m: every package ok except
    internal/usage's TestRequestStateKeptAcrossACatalogFetchedAgain,
    red the same at the parent (#6572).
- At the pushed head, on mote (macOS):
  - TestAccent*, TestWallpaper*, TestLook* ok.
  - appearance-look 36/36, i18n-keys 4/4, library-all 26/26.
  - segs-press-redraw 16 red and api-key-theme 6/6 red, the same counts
    at the parent 6c88d61f0 (#4566, #3922, #6444).
  - TestCoreScriptBudget is red (1269382 > 1268961), the same at the
    parent. 92e760f3d took it over (#6518, taken). This change adds no
    script.
- Broken by hand:
  - With the old app.css and library.css, the 8 new GUI tests are red,
    8 of 8.
  - accentVars without --mark: TestAccentReadable fails ("…;--sel:#efefef",
    no mark).

Not tried:
- The whole GUI suite and the Go suite on macOS at the pushed head. mote's
  suite.lock queue was hours deep, so they ran on Linux instead.
- The real macOS app.
- Windows WebView2, and Linux WebKitGTK.
- Charts' --c1 series colour still does not follow the accent; that is
  left as it was.
2026-11-14 09:58:38 +08:00
yetone 57dc64ba12 usage: the Overview's lists rank by tokens, cost, calls or name (onducoder on X)
onducoder asked for a ranking of Usage › Overview's Agents, Models,
Gateway keys and Accounts by what each used. Each list's heading now
ends in a quiet pick (the order's name and a chevron) that opens the app
menu: Tokens (the default, the server's order), Cost, Calls or Name.
By tokens the list stays in the server's order (most tokens first,
the cache left out) unless "with cache" is on, when the cache counts
too; other orders fall back to tokens, then calls. By cost, a row
with no price goes last; by name, a row with no name goes last. Each
list keeps its own order in localStorage (magpie.usageSort), and a
folded list hides its pick. The code is in the
Usage plugin (page.js, its i18n.js); "Calls" is a core word, since other
files say it. The core script doesn't grow (TestCoreScriptBudget passes).

gateway-caller-keys and usage-accounts read the heading's .label, since
the heading's text now includes the pick; mobile-web takes the picks out
until BASE_REF has them.

Run: usage-sort.test.cjs (new; chromium and webkit, en zh zh-TW ja de,
1100 and 420 wide). On mica, with the next two commits, these files at
this head and at origin/main 783b69b8c: gui-de gui-ja gui-zh-tw i18n-keys
mobile-web phone-no-sideways usage-agents-hide usage-cards-hide
usage-count-client usage-fold usage-hidden-way-back usage-hit-rate
usage-ledger usage-range-times usage-speed-all-models, plus usage-sort,
gateway-caller-keys, usage-accounts and usage-overview-fold at this head
(333 tests). Red at both, and filed: phone-no-sideways (#5869),
usage-agents-hide (#3414), usage-cards-hide (#6294), usage-fold
(#3415), usage-hidden-way-back (#6295), usage-ledger (#5048),
usage-range-times (#6499), usage-speed-all-models (#5834). Everything
else passes. A first version re-sorted the server's list on the default
order too, which moved rows in usage-hit-rate and usage-count-client's
fixtures; the default keeps the server's order now, and both pass.
usage-*, panel-usage*, phone-* and gui-* ran on mote earlier;
TestCoreScriptBudget ok on mote at 783b69b8c. Rebased on 92e760f3d:
gui-de gui-ja gui-zh-tw i18n-keys mobile-web usage-sort
usage-overview-fold gateway-caller-keys usage-accounts usage-hit-rate
usage-count-client model-key-tag library-subagents-import, 187/187 on
mica; TestCoreScriptBudget is red there on main's own app.js (#6518,
1269382 > 1268961), the same without this change, which adds nothing to
the core.
Broken by hand: against origin/main's assets usage-sort is red (22
cases); with usageSorted returning the list unchanged, 11/11 order cases
fail.
Not tried: the real app, Linux WebKitGTK. The full GUI suite run on
mote was stopped part-way (its copy was replaced by a second run of
mine); its reds outside these files are main's (e.g. #6543, #5869).
2026-11-14 09:31:24 +08:00
yetone 0b64846bf7 gateway: Antigravity's cloak says omp's RFC 2119 line as "key words", and finds every turned-away line in any white space
eric_li8983 (X, 11-14): oh-my-pi (omp) on Windows with an Antigravity
account got "Antigravity answered 429 to this system prompt" for omp's
first line, "RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY,
OPTIONAL." (omp 18.20.0's system-prompt.md, advisor/system.md and
live-instructions.md all start with it, byte for byte).

The built-in Antigravity path didn't know the line at all, and matched
the other turned-away lines only with single spaces. On a real account
on 11-14, Google's check turned omp's line away wrapped with LF or CRLF,
indented, with a tab, two spaces or a no-break space, so a literal match
misses copies that are refused. Now:

- agTurnedAway has omp's line, and each line is matched in any case with
  any run of white space between its words (agLineRe, agSpace: JavaScript's
  \s, as the plugin matches), Codex's and Hermes' lines too.
- omp's line goes as "RFC 2119 key words: …" (RFC 2119's own term), its
  white space as it was, rather than broken up by zero-width spaces: a
  broken-up copy was still refused 1 to 3 times in 10 (U+200B, U+2060 or
  a soft hyphen alike), "key words" 0 in 30 (plugin numbers below).
- A refusal of it gets its own hint (antigravityRFCHint, word for word the
  plugin's RFC_HINT), shown on the Routing page (AG_RFC) in en, zh, zh-TW,
  ja and de.

The plugin half is magpie-community/plugins 4170d0e8 (antigravity 0.1.11,
agy-cli 0.1.40, antigravity-cloak 0.1.6); the next commit raises the
mover min to it.

Real account (sandbox HOME, copy of the live Antigravity account,
gemini-3.8-flash, sequential, through the plugin's same rewrite): omp's
literal prompt 10/10, the full template 10/10, the line wrapped after
"REQUIRED," 10/10. Zero-width before it: 3, 1 and 5 bare 429s in 12 each.

Run at this tree (rebased on eb1b83000), on WSL magpie-desktop (mote's
suite lock was held by another session's full run, mica's disk is full):
go test -tags nogui -count=1 -timeout 45m ./...: 98 packages ok, one red,
internal/usage TestRequestStateKeptAcrossACatalogFetchedAgain ("a catalog
that changed kept the price key"), red 3 of 3 alone on Linux: that is
#6572 (catalog CacheKey and a same-mtime write), not this change.
gofmt -l clean; GOOS=windows go vet ./internal/gateway ./internal/gui on
xiaomi-gpu, exit 0; go vet ./... on Linux, with -tags nogui, exit 0 (without it the GUI package needs
webkitgtk, which the distro lacks).
GUI: routing-ag-turned-away (now 3 agents x 5 languages, chromium and
webkit) and i18n-keys, i18n-en-no-cjk: 38 pass, 0 fail.
Broken by hand: TestAntigravityCloakOmpLine and
TestAntigravityCloakLineWrappedOrWidened against origin/main's
codeassist.go: both red (line went whole, 9 copies not taken for turned
away, hint wrong).

Not tried: omp itself end to end on Windows; the gateway's built-in path
against the real account (the plugin's identical rewrite was). Seen in
the same probe: Claude Code's, Codex's and Hermes' broken-up lines were
each refused 1-2 times in 10 (magpie-community/plugins#1118).
2026-11-14 09:25:46 +08:00
yetone 4e770f733a library: subagents imported from a repository
CHENGJIAHEGOXIS on X asked for an easy way to install a repository of
subagents such as msitarzewski/agency-agents. Library → Subagents now
has a find line. It takes what the skill installer takes: owner/repo, a
GitHub or GitLab link to a repository, folder or file, any git address,
or a folder on this computer. It lists the subagents found, lets the
user tick all or some, and imports them as Library subagents for the
agents ticked.

- Fetching is the skill importer's: resolvePluginRoot's source handling
  moved into fetchSourceRoot, which both use. tooBig still refuses a
  whole repository that is too big and asks for the folder's link.
- A subagent is a Markdown file whose front matter has a description.
  - Its name is the slug of `name`. In an `agents` or `droids` folder
    with no `name`, it is the file's own name.
  - The description is folded to one line of at most 1000 characters.
  - The body is the prompt.
- Dropped: every other front-matter key (agency-agents' color, emoji
  and vibe, and tools, model, author or anything else). A Codex TOML
  role is not read. A skill's folder (one with SKILL.md) and .git,
  .github and node_modules are skipped.
- Two files with one name: the shallower is taken, and the other is
  listed as left out, with why. So is a file Subagent.check refuses.
- An imported subagent records its source and file (From) and a hash
  of its description and prompt as imported (FromHash). Imported again,
  a subagent from the same file is:
  - have, when it is unchanged;
  - update, when upstream changed and the library's copy still matches
    FromHash (description and prompt replaced; agents, skills, servers
    and model kept);
  - edited, when the user changed it in magpie (left as it is).
- A name the library already uses for another subagent is never written
  over: the import takes the next free name-N.
- A carried library carries From.
- The page has Select all, a filter past eight, a tag per state, the
  files left out, and a summary of what was imported and updated.
  i18n: zh, zh-TW, ja, de.
- The fixture is agency-agents' own files in
  internal/library/testdata/agency-agents. No test reaches the network.

Run on 80ae5ba24, which is this change on e730a14dc:
- gofmt -l is clean. GOOS=linux and GOOS=windows go vet -tags nogui
  ./... are clean (mote).
- go test -tags nogui -count=1 -timeout 45m ./... on mica: 98 packages
  ok. internal/cli's TestEveryRouteHasACommandOrIsNamed was red because
  the new POST /api/library/subagents/probe wasn't named. It is now in
  notYet beside skills/probe and plugins/probe, and the test passes.
- GUI files run in chromium and webkit, in every language:
  - The new library-subagents-import.test.cjs and the doc's Library
    list: 117 of 118 passed. The red was i18n-keys: "{n} subagents" is
    the sessions plugin's key. The keys now use {count}.
  - A second run of the doc's Library list, i18n*, project-subagents,
    skill-install-* and plugin-*: 1652 of 1768 passed. The 116 reds are
    in 7 files that fail the same way alone on a fresh origin/main
    (e730a14dc): 116 there, 114 at this head. Each has an open issue:
    - found-skill-pick-remove: #4097 and #5013
    - plugin-option-placement: #6559
    - plugin-signin-no-url: #5938
    - plugin-signed-out-account: #5998
    - plugin-move-unserved: #4392 and #4410
    - plugin-page-foreign-error: #6117
    - plugin-card-update: #3079

Run at the pushed head, rebased on eb1b83000, on mica:
- gofmt -l is clean.
- go test ./internal/library ./internal/gui ./internal/cli: ok.
- library-subagents-import, library-subagents and i18n-keys: 38 of 38
  passed.

Broken by hand, each red, then reverted:
- Clash renaming off (`false && taken[name]`):
  TestSubagentImportLeavesTheUsersOwn red.
- The edited check made `case true:`: TestSubagentImportAgainUpdates
  red (paid-media-auditor read as update).

Real import, in a sandbox HOME magpie web on mote (built from this
change), with Claude Code and
Codex detected:
- The probe of https://github.com/msitarzewski/agency-agents found 283
  subagents. One was left out: the mcp-memory copy of
  backend-architect.
- Importing all 283 wrote 283 files to ~/.claude/agents (only name and
  description in the front matter) and 283 TOML roles to ~/.codex/agents.
- A probe of .../tree/main/engineering then showed 66, all have.

Not tried: the Windows and Linux runtime, GitLab and plain git sources
against real repositories, an agent in WSL, a repository over tooBig's
limit.
2026-11-14 09:11:31 +08:00