Commit Graph
682 Commits
Author SHA1 Message Date
yetone c01988e439 routing: a group's Small context first sends a request to the smallest window that holds it
yg6888 on X (tweet 2123308968848379920): in a group routed Smart, Cursor
Plus's Composer and Grok 4.7 were never used. Not a bug: Smart orders by
allowance tier, then soonest renewal, then listed order, and never weighs
the context window, so the 1M members listed ahead always answered. The
small ones were only ever reached as a fallback.

Smart itself is unchanged; changing its order would move every Smart
user's traffic. A group gets a new routing instead, `fit` (Small context
first; 小上下文优先, 小上下文優先, 小さいコンテキスト優先, Kleiner
Kontext zuerst):

- routes.SmallFirst takes Smart's order and sorts it stably by band (a
  provider set to be used first, the rest with room, the all but used up)
  and then by window, the smaller known first, an unknown one last.
- Its strategy sets ByWindow, so weighRouted fills Seat.Window from
  windowIn (the provider's own Contexts, else the catalog's).
- roomy already leaves out every member the request is estimated past, so
  the first left is the smallest that holds it: a small model is never
  asked for a request too long for it, and keeps its last-resort place as
  under every routing.
- The trace's rows carry `context`; the Routing page says "its 200K
  context window is the smallest that holds this request".
- A group's only: provider.normalize already drops it from a provider and
  the CLI refuses it there. GUI menu, hint, why-lines, TUI and CLI
  (`routing=fit`, small-first) carry it; docs/reference.md, the
  gateway-routing and plugin-runtime pages and the en/zh/ja start pages
  say it, with the search index rebuilt (via docs-index.mjs; #7065).

Run first at the tree rebased on origin/main 6e5882109, then at this
head's (on 856423806; search index rebuilt; gateway/routes vet, routes, rotation, ./internal/gui,
the gateway's new tests and routing-small-first, routing-group-strategy
and i18n-keys 42/42 again), mote over its
cores with another session's full suite on it and mica's disk full, so on
the Linux box (wsl-run) and the Windows box:
- go test -tags nogui ./internal/routes ./internal/cli ./internal/tui
  ./plugins/rotation ./internal/gateway -count=1 -timeout 45m: all ok but
  gateway, whose one red was this commit's own new test asserting a single
  group while an auto group for the shared model exists; fixed (FindGroup
  "group/g") and the window/strategy tests rerun ok, both new ones pass.
  ./internal/provider ok (its only FAIL was the stale search index, since
  rebuilt). ./internal/gui -run Budget ok.
- Broken by hand: SmallFirst returning Smart's order makes
  TestSmallFirstOrdersByWindow and the gateway test red ("a short request
  went to big first"); dropping fit from SaveGroup's whitelist makes the
  gateway test red ("the group didn't keep Small context first").
- GUI (Chromium + WebKit, en zh zh-TW ja de): routing-small-first,
  routing-group-strategy, i18n-keys, routing-cheapest-first,
  routing-free-expiring 112/112 before and after the rebase;
  every routing*, group* and builtins* file (253): 4139 of 4198, the 59
  reds in 11 files that fail the same at origin/main 239da9991 run alone
  (57; routing-many-keys moves between languages each run), all filed:
  #7016, #7097, #6520, #5049, #6512, #4711, #3954, #3799, #4082.
- Windows: CGO_ENABLED=0 go vet -tags nogui ./internal/... ./plugins/...
  ok. gofmt -l clean.

Not tried: the full `go test ./...` and darwin vet (mote busy, mica out
of disk); a real Cursor/Grok account in a group (the window comes from
the same windowIn roomy already trusts). Seen on the way: a recovered
"close of closed channel" in continuation_test.go's doneHold fake, no
test failed from it.
2026-11-19 17:34:30 +08:00
yetone 6a46bad344 gui: Settings' search finds settings on every page, ⌘K opens it (canlee886 on X)
canlee886 asked for a search that reaches a setting by keyword even
when it lives outside Settings, such as routing group strategy and
members. Settings' search now lists, under its own results, hits from
the other pages, each under that page's name: Routing groups (a group
by name, its strategy, its members), Providers (the editor's fields,
e.g. Proxy, per provider), Agents, Library and Usage. Open goes to that
page and row (a group's editor at the field, a provider's editor with
the field lit) without scrolling anything the user didn't ask for.
⌘K / Ctrl+K, or the header's new magnifier, opens the search from any
page.

- The finder is a lazy module, finder.js (like provlinks.js), loaded on
  the first search. app.js only calls it, so TestCoreScriptBudget's
  budget is unchanged: core 1272271 (310 under), app 1087580 (668
  under), at fe038cfac rebased on 7f11dfc77.
- The routing plugin exposes routingFind and routingOpenGroup for its
  groups.
- The magnifier is the header's first thing to go when room runs short
  (a new "spare" stage before "tight"), so the brand still shows at 860px
  in the Windows window (brand.test.cjs went red without it). ⌘K and
  Settings' own box still reach the search there.
- No native select, no accents. Rows reuse the settings-search look.

Guard: find-anywhere.test.cjs, in Chromium and WebKit, in en, zh, zh-TW,
ja and de at 560x420 (with the magnifier at 1100), and on magpie web
at phone width. It types a group's name, "strategy" and Proxy, checks
the pages listed, opens each, and checks the landing row is in view
with no overflow. Red on the base (an archive of 88b65d758 plus the
test): both engines time out, with no results from other pages.

What was run, and where:
- WSL magpie-desktop (xiaomi-gpu), at fe038cfac (rebased on 7f11dfc77):
  gofmt -l clean; go vet -tags gtk3, GOOS=linux go vet -tags nogui and
  GOOS=windows go vet for ./internal/gui/... ok. go test -tags gtk3
  ./internal/gui: only TestClipboardReadBack red, the same on the base
  (#7073, #7074). GUI files find-anywhere, brand, settings-search,
  settings-search-reach, header-zoom-fit, header-centre, header-presets,
  header-relang, click-scroll, text-size, group-editor-fits,
  group-editor-align, i18n-keys and menu-scroll: 181 pass, 29 fail.
  The reds are webkit click-scroll (#4385), webkit header-centre
  (#3479), menu-scroll in both engines (#1550) and webkit text-size
  (#1866), all red the same on the base run.
- WSL magpie-desktop, before the rebase (on 88b65d758): the whole GUI
  suite, 29497 tests, 28180 pass, 1317 fail. find-anywhere was green in
  both engines. Comparing by name against a base run over the 418 tests
  both covered: 13 ok to red and 13 red to ok, all noise except brand's
  "the logo and name in the header", fixed by the spare stage above. A
  near-file run then had the same reds on mine and the base, plus
  group-editor-selected (#5049, #6876), and the guard red only on the
  base.
- mica: go vet before the rebase was ok. go test and the GUI suite there
  hit ENOSPC (disk full from other runs); the 8 tests it broke passed
  alone. That's why the suites moved to WSL.

Not tried: the real desktop app (only the GUI suite's pages), and
Windows' own webview.
2026-11-19 15:05:57 +08:00
yetone 2926b7beff usage, routing: the model id a request went out under is kept and shown
daoche_wuzui on X asked how magpie serves Antigravity and whether a
request goes out under a suffixed model: nothing showed the id actually
sent. Antigravity's plugin turns gemini-3.7-flash at high effort into
gemini-3.7-flash-high, and a relay's upstream name (ModelWires) renames
a model too; the ledger and Routing showed only the routed model.

- A plugin's reply may carry X-Magpie-Sent-Model
  (provider.SentModelHeader). forward() reads it from plugin providers
  only (a non-plugin's header is ignored) and deletes it, so it never
  reaches the agent. Without it, provider.SentNameOnIn (the upstream
  name, or Antigravity's variant) is used.
- wireName keeps the id only when it differs from the model. It goes in
  usage.Record.Wire (`wire`, omitempty), the trace's Try.Wire, the
  ledger cache and a last CSV column, sent_model (docs/reference.md).
- Usage › Requests: the Sent cell and the detail show the sent id when
  there is one, with "model → sent id" on hover. Routing: a try sent
  under another id gets one aside line, "Sent to the vendor as {model}"
  (zh, zh-TW, ja, de).
- Antigravity's mover min is 0.2.4: plugins 67fb1258 sets the header on
  every reply (stream, whole and errors); its tgz is on the plugins
  repo's dist branch.

Run at this head (ef997d186 + this), on mote:
- gofmt -l: nothing. go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...: ok.
- go test -tags nogui -count=1 -timeout 45m ./...: every package ok but
  internal/gateway, red only in TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes,
  red 5 of 5 alone at origin/main ef997d186 too (#7117, taken).
- GUI: the 46 files that reach the Usage ledger, Routing's tries and
  i18n (i18n-*, ledger-*, usage-ledger-*, routing-try-fixed, sent-model
  and the files that read the Sent cell or an aside): 230 ok; red only
  aside-native (#6212) and usage-ledger-chart's remembered metric
  (#6790), both red the same way at origin/main ef997d186. The whole
  GUI suite (1609 files) was still running at push; its reds so far are
  in account-arrange and the Codex lone-capped-account files.
- sent-model.test.cjs: 10/10, Chromium and WebKit, en zh zh-TW ja de.
- Plugin: bun test packages/antigravity 136 pass, check.mjs ok.

Rebased onto 593ea437d (three gateway/routing commits) before the push,
then again: gofmt; vet of gateway, usage and provider for darwin, linux
and windows; the new tests with the gateway's Wire, Ultrafast and Prefix
tests; sent-model and i18n-keys (14 pass): ok.

Broken by hand, each red:
- no noteWireModel call: TestPluginSentModelIsKept;
- the IsPlugin check removed: the spoofed-header case;
- no SentNameOnIn fallback: TestUpstreamNameSentIsKept;
- an id equal to the model kept: both tests;
- the old GUI assets: every sent-model case; the old usage page.js
  alone: the Sent cell assertion;
- the plugin's old index.mjs: its new test (31 pass, 1 fail).

Not tried: a real Antigravity account (the plugin's header was tested
with its fake vendor only).
2026-11-19 14:45:14 +08:00
yetoneandggbdpq c1934262ab routing: a group member sent Ultrafast says Ultrafast, not fast
OoopsHh on X: with Ultrafast picked on a routing group's member, the
group list's card still said "· fast". The Routing page's summaries
(the card's member line, the member menus' notes and the route view's
tag) read Group.Fast alone. They now say Ultrafast where the group sends
the member so and an account offers it (memberJSON.Ultra), as the
editor's speed button and `magpie group` already did. The TUI's group
view did the same and now says Ultrafast too. The route trace's Weighed
gains Ultra so the route view's tag can tell the two apart (#7095).

Fixes #6881 and #7095 (paul-tian). ggbdpq took #6881 and posted a
patch on it; its TUI test and the Codex GPT-6-Astra fixture are ported
here with credit.

Siblings checked: `magpie group` (groups_cli.go) and the Agents page
(agentspeed.js) and search tags (fastTag) already said Ultrafast; the
tray has no group speed summary.

Tests:
- group-member-fast.test.cjs: a group "Astra" with an Ultrafast member;
  its card says "gpt-6.2-sol · Ultrafast" / "· 极速" (en, zh; Chromium,
  WebKit). Red on 7d5db0f29 (4 of 4: "Relay gpt-6.2-sol · fast").
  The same card now also holds #6881's Codex gpt-6-astra member
  (ggbdpq's fixture) and checks it reads Ultrafast, not fast.
- routing-ultra-row.test.cjs (new, #7095): the route view tags a member
  sent Ultrafast "Ultrafast" with its own title, and one sent fast
  "fast"; every language, Chromium and WebKit. Red on 7d5db0f29 (10 of
  10: both tagged "fast").
- TestGroupMemberUltrafastShown (tui) and ggbdpq's
  TestGroupMemberUltraShown (a Codex gpt-6-astra member; a member set
  fast alone still says fast): both red on 7d5db0f29.
- routing-service-tier.test.cjs: 20 of 20 green.
- GUI run of the group-*, routing-*, panel-routing, fast-*,
  codex-service-tier, picker-speeds, agent-speed, i18n-*, gui-de/ja/zh-tw
  and header-relang files on mote: 4295 tests, 84 red in 10 files. The
  10 files then run at this head and at origin/main 3869aee3b on mote:
  the same 84 reds on both, each filed: fast-pick/fast-ultra #6201,
  group-editor-selected #5049, gui-ja #7144, routing-pin-away #6512,
  routing-provider-off and routing-rows-fit #7016, routing-row-swap
  #3799, routing-signin #6520, routing-story-shrinks #3954.

Co-authored-by: ggbdpq <ggbdpq@gmail.com>
2026-11-19 13:51:20 +08:00
yetone 1c9c359f9d gui: Usage cards keep their place as they come in (liuzhengdong99 on X)
liuzhengdong99 on X: 用量界面每张卡片取数的时间不一致,导致卡片渲染时高度一直
跳动——滑到上面看某张卡片,视图会被拽回下面. The allowance cards come in
at different times: each vendor's read (the page asks again every 1.5s
while X-Magpie-Reading says a read is under way), then the curves'
history. Every answer redraws the cards (renderQuotas), and packUsage
grows the ones above the card being read. Nothing kept that card in
place: the view's scroll guard (keepInView) only knew elements by node,
and the cards are new nodes on each draw, so the browser's anchoring was
the only thing holding them. It anchored on nodes that were being
replaced, and the reader ended up dragged down.

Fix:
- The Overview keeps the card being read in place: the highest card (or
  part of the page under the cards) that starts in sight, found again by
  its data-key after a redraw (keepInView's new `only` mode with pinnedAt),
  and followed after every packUsage (followPin). The browser's own
  anchoring stays on while nothing is kept: at the page's top, on
  another tab, and while the cards are dragged or moved by keys (unpin,
  so a dropped card lands where its slot showed).
- Placeholders from the last known height: each card's height drawn in
  full is kept by its key (localStorage magpie.usageCardTall, 1s
  debounce, 200 keys at most). A card still waiting on its read or its
  curve (usageWaiting: quotasReading, the new flag loadQuotas sets, or
  no history answer yet) is packed and held at least that tall, in the
  column count the cards were last whole in at that width. On the next
  start, no card in sight moves.
- loadQuotaHist counts its first answer even when it is empty, so a
  user with no history isn't left waiting (found by usage-pack: the
  cards held their first packing at 560px).

No new animation, nothing scrolls the page on its own (click-scroll
passes), and the layout is unchanged once the cards are in.

Run (mica, Playwright 1.62.0, Chromium + WebKit):
- usage-cards-steady.test.cjs (new): 20 tests, all 5 languages, 1100px
  and 420px. On the old assets (MAGPIE_ASSETS) it was red 8 of 8 in en
  and ja. With the hold disabled, the second visit goes red.
- At ee079814b + this change (then rebased onto 1c29e2c7d, which changes
  only app.css, redact.css and a new contrast test; script budgets
  measured again, unchanged): go test ./internal/gui/ (budgets included),
  gofmt, and usage-pack, usage-cards-steady, usage-drag, usage-arrange,
  click-scroll and i18n-keys: go ok (300s), 64 of 64 GUI tests pass.
- Every usage-*, quota-*, view-*, account-arrange, click-scroll,
  i18n-keys and gui-de/ja/zh-TW file (151 files), run before the empty-history fix and the last
  rebase, head vs origin/main.
  No red at head is new. The reds that are also on base: account-arrange
  (#6010), quota-count-wrap (#3404), quota-curve (#6789),
  quota-refresh-order (#6180), quota-credits (#6807), usage-ledger
  (#5048, #6003), routing-* (#7016), gui-ja (#7144),
  view-trackpad-coast (#4724), view-wheel-unheard (#5158), plus the
  whole-suite reds in #6975 and #6934. usage-pack and usage-drag went
  red at head along the way and are fixed here.

Not tried: the real app (WebKitGTK on Linux, WebView2 on Windows,
WKWebView on macOS) and the full GUI suite.
2026-11-19 13:01:23 +08:00
yetone 1c29e2c7dd gui: dark quiet text at 4.5:1, the masking count in the app's own numbers (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS on X: the masking card's big number was a thin, tall
face ("瘦长的比较别扭"), and some text in dark mode was very dark: Library
› MCP's project help under 项目服务器.

The masking count (.msk-num, redact.css) drops its own SF Pro Display at
weight 100 for the interface's font at 600 and -.035em, as .si-pct b and
.kpi b have; its 52px and line-height stay, so the card's layout doesn't
move.

The help is .lib-aside, drawn in --faint. The dark theme's --faint was
#56565f: 2.39:1 on --bg, 2.16:1 on --card. It and --muted are raised in
both dark blocks and the dark panel's:
  --faint #56565f -> #90909a (panel #7c7c87 -> #90909a)
    on --bg 2.39 -> 5.49, --card 2.16 -> 4.95, --card-2 2.26 -> 5.19,
    menu (--pop-bg) 2.07 -> 4.76, panel bg 2.34 -> 5.38, panel card
    2.08 -> 4.77
  --muted #8b8b94 -> #9c9ca6 (the panel's own value already)
    on --bg 5.14 -> 6.38, --card 4.64 -> 5.76, menu 4.46 -> 5.54,
    --pill 4.05 -> 5.03
fg-2 > muted > faint is kept. With a picture behind the page (84% veil,
appearance.go), --faint holds 4.5:1 up to a mid-grey #808080 picture
(4.52); a picture brighter than that under the words can't keep 4.5:1
for any grey quieter than --fg-2 without a heavier veil, which is left
as it is. .effort-ends loses its .8 opacity over --muted. The light
theme's --faint (1.95:1 on white) needs both light steps moved
together: #7153.

New test dim-text-contrast.test.cjs, Chromium and WebKit: the dark
--faint and --muted at 4.5:1 on every dark ground in the window and the
panel, with the steps kept; Library › MCP's two .lib-aside lines at
4.5:1 on the dark page, with no picture, #262626 and #808080 behind it,
in zh/en/zh-TW/ja/de at 1100 and 420 (web), no sideways scroll; the
masking count's weight and family the same as .si-pct b's and .kpi b's,
its tracking no tighter, fitting its card in dark and light, every
language, 1100 and 420.

Run (mote, through mote-run):
- old code: dim-text-contrast red 6 of 6 (--faint rgb(86,86,95) on
  --bg reads at 2.39:1; weight 100, the app's big numbers 600).
- this commit's tree (on ee079814b): dim-text-contrast,
  quota-caption-contrast, i18n-keys: 12 of 12 ok; go test ./internal/gui
  -run 'Budget|Appearance|Scheme' ok; gofmt -l clean. go test
  ./internal/gui (whole package) ok at the pre-rebase head.
- whole GUI suite (make test-ui, concurrency 4) at the pre-rebase head:
  31 files red besides this one, the same files red alone at
  origin/main ee079814b (526 pass / 210 fail there vs 537 / 205 here),
  recorded on #6975. dim-text-contrast's one red there read the help
  mid-fade-in (2.19:1 through an ancestor's opacity); it now waits for
  every box over the words to be opaque, and is green after.
- screenshots before/after in Chromium and WebKit (Library › MCP dark,
  plain and with a picture; masking dark and light).

Not tried: the real app and WebKitGTK; a picture brighter than #808080;
the light theme (#7153).
2026-11-19 13:00:39 +08:00
yetone 426a707a19 library: each subagent is kept in a Markdown file to edit, or one of the user's own in a git repo (JonahFu on X)
JonahFu asked on X (tweet 2123236872940073039) for each subagent's
local path in Library > Subagents, to edit it with an LLM, or to keep a
subagent in a git repository.

Each subagent of the library (not a plugin's) is now kept on this
computer in <library>/subagents/<name>.md as well, in Claude Code's
shape (name, description, model, skills, mcpServers, the prompt), or in
a file of the user's own set under the editor's Advanced (folded unless
one is set), in a repository say:

- FileHash is what the file said when magpie last wrote or took it in.
  An edit there (by hand, by an agent, a git pull) is taken in at the
  next sync and before a change made on the page, and every ticked
  agent gets it. While magpie runs, KeepLinked's loop syncs when a
  file's hash differs, once per edit.
- An edit that can't be read as a subagent (no front matter, another
  name, no prompt) is left as it is, the agents keep what it said
  before, and the editor says why. magpie writes a file only when it is
  missing, or still as magpie left it; never the user's edit.
- A file of the user's own that is there already is what the subagent
  says (a bad one refuses the save). It must be an absolute .md path,
  not a folder, not inside the library, not one another subagent uses,
  and not a file magpie writes for an agent.
- Rename and remove take the library's own file only while it is as
  magpie wrote it; the user's own file always stays.
- File and FileHash are this computer's: Collect leaves them out, Put
  keeps this computer's.

The editor shows the path (click reveals it, Copy copies it), a line
that edits there reach the agents, and the error when one wasn't taken
in. i18n in zh, zh-TW, ja and de.

docs/subsystems/library.md: a row for the subagent's own file and its
tests.

Run at the tree before 2051dfc23 (a Pi market change in
pimarket.go and plugin/market.go only) came onto origin/main:
- mote-run: gofmt -l none; GOOS=linux and GOOS=windows go vet -tags
  nogui ./... and go vet ./...: ok. go test -timeout 45m ./...: every
  package ok, internal/library 504s, except known reds not touched here:
  internal/cli TestHealthcheckFindsTheRunningGatewayWithoutMagpieAddr,
  TestUpdateRestartsTheGatewayItFindsWithoutMagpieAddr and
  TestUpdateFindsAMagpieThatWroteNoRecord (#6471, #6223: a real gateway
  on mote's 127.0.0.1:3425), internal/gateway
  TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes (#7117).
  mote and mica were both over their cores; the suite went to mote.
- mica-run: node --test library-subagents, library-rules,
  library-commands, i18n-keys, i18n-en-no-cjk (Chromium and WebKit,
  420 and 1100 wide, en zh zh-TW ja de): 44 of 44. Before that, every
  library-*, lib-*, nav-* and i18n* file (95 files, 2071 tests): red
  only in library-commands (its tab-order assert, fixed in the previous
  commit) and library-open-again's 1100px cases, red the same alone at
  base 14b6b9555 (#6751).
- Red on the old code: TestSubagentFileFollowed and
  TestSubagentFileUnreadable went red with the follow step skipped and
  the hash check dropped; library-subagents.test.cjs is red against the
  previous commit's client.js.
- Real use: a sandbox HOME magpie on mica (fake claude on PATH) wrote
  ~/.config/magpie/library/subagents/reviewer.md; an edit there with a
  new description and prompt reached ~/.claude/agents/reviewer.md and
  library.json on the next `library sync`; an edit with no front matter
  was left as written and Claude Code's file kept the old text.
- After rebasing on 2051dfc23, mica-run: go vet ./internal/library
  ./internal/plugin and go test -timeout 45m ./internal/library: ok.
Not tried: a real Claude Code or other agent editing the file, a real
git pull into a repository file while magpie runs (KeepLinked's loop is
covered by TestSubagentOwnFile only), Windows and Linux.
2026-11-19 12:20:02 +08:00
yetone 3132fa1cd9 library: Rules, a folder of rules given to Claude Code, Cline and Kiro CLI (JonahFu on X)
JonahFu asked on X (tweet 2123237371739316685) for Claude's rules
folder in the Library. A new Rules tab keeps rules once and gives each
to the agents ticked for it, in the folder each reads by itself:

- Claude Code: <claude dir>/rules/<name>.md. `paths` is the only
  front matter key it reads (code.claude.com/docs/en/memory). Checked
  on real 2.1.327 in a sandbox: it reads every .md under the folder,
  loads one without paths at launch, and one with paths when
  Read/Write/Edit touches a matching file.
- Cline: <cline dir>/rules (CLINE_DIR, else ~/.cline). Cline 3.0.70
  reads every rule always and has no paths key, so a rule with paths
  isn't written for it; the agent gets a problem and the editor says
  why under the paths.
- Kiro CLI: ~/.kiro/steering, `inclusion: fileMatch` +
  `fileMatchPattern` for paths, else always. A rule named "agents" is
  refused there (it would be AGENTS.md on a disk that ignores case).
- Not listed: Cursor (user rules live in its settings; .cursor/rules is
  per project), Codex (its rules are execpolicy), Droid (command
  permissions), Gemini CLI, Qwen Code and OpenCode (no rules folder).

A body starting with --- gets an empty front matter first. Files are
recorded with their hash in Applied.Rules through the same
syncOwnFiles as subagents and slash commands: a file of the user's own
by that name, or one magpie wrote that the user edited, is never
written over or taken away. Bundles (backup, WebDAV) carry rules; a
bundle from an older magpie leaves this computer's alone. The editor
lists each agent's file to reveal. No CLI yet.

docs/subsystems/library.md: a Rules row and its tests.

Run (mica-run, at this tree):
- go vet -tags nogui ./internal/library ./internal/gui ./internal/davsync
  ./internal/cli: ok. gofmt -l: none.
- go test -tags nogui -timeout 45m ./internal/library ./internal/davsync:
  ok (TestRulesEachAgentsFile, TestRulesKeptToTheirPaths,
  TestRulesLeaveTheUsersFiles, TestRuleCheck, TestRulesCarried).
- node --test library-rules, library-subagents, library-commands,
  library-hooks, library-loading, library-groups, i18n-keys,
  i18n-en-no-cjk (Chromium and WebKit, 420 and 1100 wide, en zh zh-TW
  ja de): 78 of 78.
- The full suite and cross-OS vet ran at the next commit, which this
  one is under.
- Real use: Claude Code 2.1.327 in a sandbox HOME loaded a rule without
  paths at launch and one with paths only on touching a match; a
  sandbox magpie on mica wrote ~/.claude/rules/go-style.md with
  paths: ["**/*.go"].
Not tried: Cline and Kiro CLI loading the files for real, project-level
rules (.claude/rules in a repository), Copilot and CodeBuddy (not
verified, not listed), Windows and Linux.
2026-11-19 12:20:02 +08:00
yetone a18ed4995f memory: a memory of several lines keeps them, folded to its first line (_meouwu on X)
_meouwu on X: a memory added by hand in several lines showed as one line
with its breaks gone; it should keep its format and, folded, show the
first line and an ellipsis.

Cause: the store never lost the breaks. A memory file's body is
m.Text as written (encode/apply trim only the ends). They were lost
where it was shown: the Library row clamped the name to two lines with
white-space normal, the digest given to agents went through oneLine
(strings.Fields), and so did memory_search / memory_list in the memory
MCP.

Now:
- Library: a folded row and a suggestion show firstLine(text) (first
  line, " …" when more follow); an open row shows the whole text
  pre-wrap. The editor already kept "\n".
- Digest and memory MCP: memory.Indented keeps each line, the lines
  after the first indented two spaces so the memory stays one list
  item.
- Dream and distill listings stay one line on purpose: the model's
  reply is read line by line, and a user's memory is Fixed, never
  rewritten by them. Written in docs/subsystems/memory.md.

Memories saved before: their files already hold the breaks, so after
updating they show, edit and reach agents in their own lines. Nothing
to redo, no migration.

Run at 3fabaf8f2 (on origin/main b332ef7ef, the pushed head),
f6452d777 (on 1622484a8) and ee84e288a (on 54117164c), on the WSL VM magpie-desktop: mote and mica were over
their cores with other sessions' suites for ~2h.
- go vet -tags gtk3 ./... ok; gofmt -l clean.
- go test -tags gtk3 -count=1 -timeout 45m ./... at ee84e288a: 101 ok,
  2 FAIL, both red at origin/main 2416beed6 on the same VM:
  internal/gui TestClipboardReadBack (#7074, #7073), internal/usage
  TestRequestStateKeptAcrossACatalogFetchedAgain (#6572).
- Whole GUI suite (concurrency 8): 1355 of 29368 red in 221 files under
  load. Those 221 again at concurrency 3: 71 red; 66 of them red at
  base 54117164c too. Of the other 5, 3 pass alone;
  codex-auto-reset-settings (#6108) and copilot-ghe (#1949) are red at
  base alone too (2 of 3 and 3 of 3 rounds), commented there.
- After the rebase (f6452d777): internal/memory, internal/memdistill
  and -run "Memory|Budget|I18n" in gateway, gui, library ok. All 84
  library-*.test.cjs: 1920 of 1950 pass; each red file alone, beside
  1622484a8: commands-import, group-steady, mcp-copy-config,
  mcp-off-fold, open-again and all are red at base too (#7097; all 3 of
  3 at base); memory-suggest, mcp-json and bili pass alone.
- At 3fabaf8f2 (b332ef7ef brought flying_crp's digest header and
  memory_save note; conflicts were only both sides adding tests and
  doc text): go vet memory, gateway, memdistill; go test memory,
  memdistill, access, and -run "Memory|Budget|I18n|Digest" in gateway,
  gui, library ok; library-memory*.test.cjs 112 of 112.
- library-memory-lines.test.cjs: 5 langs x 980/420 x chromium/webkit.

Broken by hand (old code, new tests): TestMultiLineMemoryKeepsItsLines
red at the digest step only (save, edit and the file passed: the store
kept the breaks), TestIndented and TestMemorySearchKeepsTheLines red,
library-memory-lines red ("Release steps: …" expected).

Not tried: a macOS run (mote, mica busy), Windows, the real app.
2026-11-19 06:32:40 +08:00
yetone 4e24994a6e gateway: a key let use Magpie Memory reaches it from another computer
Niapyaya on X reaches their own MCP servers through the MCP hub from a
remote machine, but not magpie-memory: memory answered the agents on
this computer alone, on /mcp/magpie/memory (547585cd9) and in the hub
(HereOnly), whatever key came. That was on purpose: a friend's key
could read every memory or plant a global rule the digest writes into
every agent's instructions here.

So it stays off for every key, and the user can let one key of their
own use it:

- access.Key.Memory, set by "memory-key" (`magpie gateway-key memory
  <id> on|off`, or the key's ... > Advanced > Magpie Memory). As Admin,
  only a key the user made can have it (memoryOf): never the sharing
  key, a read-only or Browser key, nor an issued or expiring one.
  Read-only takes it away; the management API can't set it.
- memoryMCP lets a caller from elsewhere in only while magpie is
  shared, by such a key, and never from a page by hubFromPage (Origin,
  Sec-Fetch-Site, a Mozilla/ agent; Node's fetch sends Sec-Fetch-Mode,
  #5522). This computer's check is unchanged.
- The hub gives magpie-memory (HubServer.Memory, from isMemory) to an
  Away visitor only by such a key (HubVisitor.Memory), listed and run,
  in the gateway and again in the library's Call.
- Advanced in the key's menu now opens Management API and Magpie
  Memory, each its own pick; a key with it says so in its row. Strings
  in zh, zh-TW, ja, de. Docs: memory.md, mcp-router.md, and the site's
  remote page (en, zh, ja) with its index rebuilt.

Image already answers a key directly (/mcp/magpie/image, held to the
key); sessions stays this computer's. There is no skills MCP server.

Tests: TestMemoryMCPToAKeyGivenIt, TestHubGivesMemoryToAKeyLetUseIt,
TestMemoryKey, the hubServerOf Memory column, and gateway-key-admin's
GUI file now goes through Advanced > Management API and covers Memory.

Run (mote unless said; base d01e0a465, rebased onto c4bae0724, which
only touches the Settings keep guard):
- Red on the old code (mica): TestMemoryMCPToAKeyGivenIt (403 to the
  key) and TestHubGivesMemoryToAKeyLetUseIt (hub listed [docs] only).
- go test -count=1 -timeout 45m ./internal/access ./internal/gateway
  ./internal/library ./internal/cli ./internal/gui: access, library ok.
  Reds, each the same at a clean origin/main c4bae0724 and filed:
  gateway TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes (#7117) and
  the doneHold panic log (#6505); cli TestHealthcheck…/TestUpdate…
  WithoutMagpieAddr, TestUpdateFindsAMagpieThatWroteNoRecord (#6471,
  #6223); gui TestSettingsSaveKeepsWhatItDoesNotSend (fixed by
  c4bae0724).
- GUI, both engines, every language, at this head: 64 files (every
  caller-keys / gateway-plugin file and i18n-*): 1008 of 1024 pass;
  api-key-theme (#6444) and connect-address-kept (#6755) fail the same
  at clean origin/main c4bae0724.
- gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./... ok; builds for all three OSes ok.
- Broken by hand: drop !hubFromPage -> the Sec-Fetch-Site case gets 200,
  red; drop the key's Memory check -> another key gets 200, red. Drop
  sharedWith -> still green: serveMCP's share guard refuses first, so
  memoryReaches' check is a second line, not the only one.

Not tried: a real remote agent against a real shared magpie (tests use
httptest with 192.0.2.7 as the remote address); the full suite runs
after the push.
2026-11-19 02:31:18 +08:00
yetone 88b65d7584 library: the skills sheet says why an agent gets copies (4kT1FohCTP97031 on X)
The report (X, tweet 2123056163587780891): "Claude Code can only copy
skills, never link them; every other agent can use paths." Claude Code
already takes links: real claude 2.1.327 in a sandbox HOME and
CLAUDE_CONFIG_DIR loads a symlinked skill folder and a symlinked
SKILL.md, and reads the files beside it. The row that said 只能用副本
with no reason and no switch was Claude Desktop's (Cowork), which
really does skip a linked skill (Claude Desktop 2.7032; see
desktop_skills.go), so it keeps copies.

- AgentView gains CopyWhy and CopyWith (copyWhy in skill_how.go):
  desktop, liveagent, wsl (a WSL agent on a Windows drive), junction
  (agy/antigravity/crush on Windows), and shared, for an agent that reads
  the same folder as one given copies. A shared agent was shown as
  "Gets links" while syncSkills gave it copies (l.copies with sharers);
  its How is now copy and the row names whose copies they are.
- The How sheet's row says the reason ("Only ever takes copies: Cowork
  skips a linked skill"), in en, zh, zh-TW, ja and de. Without a known
  reason it still says "Only ever takes copies".
- docs/subsystems/library.md says so.

Not changed: agy/crush on Windows take copies even where a symlink
could be made (#5107, #6610 decided that); not part of this report.

Tests:
- TestSkillHowSaysWhyCopies: Claude Code link, Claude Desktop
  desktop, Codex reading Claude Code's folder as copies -> Claude Code
  how copy, shared, ["Codex"], a copy on disk, and links again after.
  Red on the old behaviour (fields kept, copyWhy and the How override
  dropped): "Claude Desktop: why """ and "Claude Code: how "link"".
- skill-how.test.cjs: the desktop row's reason, a shared row, a bare
  must-copy row, and a new all-languages test (en zh zh-TW ja de) at a
  phone width. Red on origin/main's plugins/library client.js and
  i18n.js in every language (expected the reason, got the bare words).

Run:
- gofmt -l clean. go vet internal/library and (-tags nogui)
  internal/gui on Linux, GOOS=windows, GOOS=darwin (wsl-run): ok.
- go test ./internal/library -count=1 at this head (rebased on
  origin/main 1e2287758, on mote): ok.
  go test -tags nogui -run 'Budget|I18n|Doc' ./internal/gui: ok.
- GUI at this head on mote, chromium and webkit: library-wsl-asleep +
  skill-how 53/53 each. On magpie-desktop at load ~78 (another session's
  full suite and GUI suite) many files timed out together; skill-how and
  skill-name-many-agents alone there: 15/15.
- Before the rebase on magpie-desktop, both engines: skill-how,
  library-wsl-asleep, i18n-keys, i18n-en-no-cjk, library-desktop-skills,
  library-desktop-twin, skill-router, library-items pass. click-scroll,
  library-all and skill-where (webkit) red, and the same red on a clean
  origin/main 454f9d023 alone: #4385, #4967, #5154 (commented).

Not run before the push: the full go test ./... and the whole GUI
suite (the coordinator asked to ship on the targeted runs); they run
after on a free machine.
2026-11-19 00:13:47 +08:00
yetone b400566f96 library: a resize no longer works out every agent chip's style again (lexrus on X)
lexrus's Skills page (196 skills, By source, about 24 agent chips a row,
dark) crawled while the window was resized. Each row's chip strip was a
size container, and the chips' gap used cqw. Chromium invalidates every
style with container units on each change of the viewport width
(ViewportUnits), so every chip was recalculated on each resize step.

Now handGap works the gap out in whole pixels from each row's
content-box width, which a ResizeObserver on the .lib-row hands over, so
there is no forced layout and no container query. The CSS clamps
--lib-gap as before, and the gap is set only when it changes. While the
window is resized, .lib-resizing (held 600ms after the last step) turns
the chips' translate transitions off, which WebKit was paying to start
on every step.

Measured with a Playwright probe at the reporter's scale (259 rows,
6425 chips, every group open), 30 resize steps between 1200px and up,
CDP Performance.getMetrics and tracing, on mote:
- Chromium: resize wall 24.4-29.3s -> 2.7s; style recalc 18.2-22.1s ->
  1.3s; layout 0.47-0.71s -> 0.17s; long tasks 53-65 (6.8-8.0s) -> 15
  (1.7s).
- WebKit: resize wall 25.9-31.6s -> 9.2s; average frame 235-277ms ->
  48ms (hiding every chip gives 1.8s, the floor).
- Scroll is unchanged (about 31ms frames in Chromium, 20ms in WebKit).
  content-visibility was tried and dropped: it made scroll worse.

skill-name-many-agents.test.cjs now resizes 866px -> 560px and checks the
strips match a fresh 560px render, and a guard fails if library.css uses
container units again. Broken by hand (handGap run only once): 3 pass, 3
fail. Restored: green.

Run on mote at this head (rebased on 1b360f08c):
- The 180 library GUI files, Chromium and WebKit, --test-concurrency=4:
  1870/47 and 1872/45. Every red file run again alone on origin/main
  1b360f08c and on this head, both engines: the same reds on both, none
  new here (main 95/46 and 98/43, this head 99/43 and 99/43). They are
  filed: #5982 (update/using in strict recorders: skill-fold-all,
  skill-manual), #6667, #6751 (library-open-again), #3403/#6570
  (old-webkit), #3952/#5013 (mobile-web, found-skill-pick-remove),
  #5859 (skill-where), #6687 (skill-group-shared), #4620 (market-have),
  #7097 (win-caption, text-size, search-mcp-library).
- go test ./internal/gui/ ./internal/library/ (they read these assets):
  library ok; gui red once in TestLaneLimitRoutes, which read a running
  gateway's real volcengine lane (#5150); -count=3 of it alone is ok at
  this head and on origin/main.
- Rebased on 454f9d023, which changed client.js's MCP router row: at that
  head skill-name-many-agents, library-mcp-router-tools and i18n-keys
  pass 21/0 in Chromium and in WebKit, and go test ./internal/gui/ is ok.
Not run before the push: the full Go suite (mote at load 34-50, mica's
disk full); it runs after the tag. No Go file changed.
2026-11-18 23:00:33 +08:00
yetone 454f9d023a library: the Tools on demand row names the agents the gateway gives every tool
The row under the MCP router said "Claude Code, Claude Desktop, Codex and
Pi find tools themselves and are given every one", but hubOnDemand gives
every tool to Droid and omp too (hubSearchesItself). The words now come
from the code: gateway.HubFindsItself (the ordered list hubSearchesItself
is built from) and gateway.HubOnDemandOver reach the library's view as
hubFindsItself (each agent by its name, its id when none is found) and
hubOnDemandOver, and the row joins them with the language's list
separator. Two keys replace the old sentence in zh, zh-TW, ja and de; the
CJK sentences follow each other with no space.

Tests:
- TestHubFindsItselfIsWhoGetsEveryTool: every named agent (and its WSL
  id) is given every tool, every agent given every tool is named, and
  other agents get theirs on demand.
- TestHubFindsItselfInTheView: /api/library carries the gateway's list
  and threshold, each agent by its name.
- library-mcp-router-tools.test.cjs: the row's text is built from the
  view's list and count (fixture: 12, six agents), names each one, never
  says 10, and has no "。 ".

Run (wsl-run, magpie-desktop; mote was at load 46-49 of 18, mica's disk
full), at this tree on 35a03fee0:
- gofmt -l internal/gateway internal/library internal/gui: clean
- go vet -tags nogui, and GOOS=windows go vet -tags nogui, of
  ./internal/gateway ./internal/library ./internal/gui: ok
- go test -count=1 ./internal/gateway -run 'Hub|MCP': ok
- go test -count=1 ./internal/gui ./internal/testenv: ok (134s)
- go test -count=1 ./internal/library: ok (183s)
- node --test i18n-keys, library-mcp-router-tools,
  library-mcp-router-note, library-mcp-hub (chromium and webkit; 1100
  and 420 wide; en, zh, zh-TW, ja, de): 70 of 70 ok

Broken by hand (a copy of this tree): dropping omp from the list while
omp still gets every tool, TestHubFindsItselfIsWhoGetsEveryTool fails
"omp is given every tool but not named"; putting the old hardcoded "10"
and four names back into the row, library-mcp-router-tools fails in
every language. That run also showed "。 " in zh, fixed here.

Not run: the full go test ./... and the whole GUI suite; the real app.
2026-11-18 22:39:19 +08:00
yetone 4d79bebfa7 usage: speed counts all output, reasoning and tool calls too, from the first output (Archivemylife on X)
Archivemylife on X: speed should be the upstream's usage over the local
time, with no split into reasoning, tools and answer, since reasoning and
tool calls are tokens too.

Speed is now every output token the vendor's usage counts (reasoning and
tool-call arguments included) over the time from the first output of any
kind to the end of the reply. The first output is the earlier of the first
content (TTFT) and the first sign of reasoning, firstToken.reasoningMs in
ttft.go, which works the same in every protocol:
- a Responses reasoning item's start;
- an Anthropic thinking or redacted_thinking block's start;
- sealed (hidden) thinking;
- reasoning deltas spread over 100 ms or more. Deltas that came at once
  are a buffered burst and tell none.

A summary is no sign (summaryPart: a Responses reasoning summary, a Gemini
thought, or a summary translated from another protocol via
firstToken.summarized), because it is written after some of the reasoning
it sums up (#1463). A reply that reasoned with no sign of when it began
counts only its answer, its output less the reasoning, from its first text,
and none with no text. Before this, a reply that reasoned always counted
only its answer, and a reply that wrote tool calls after reasoning told no
speed. Burst and held-content checks judge the answer's part.

The same definition holds everywhere:
- gateway: speed.go, trace.go, codex_backend.go;
- usage.DecodeOf, for the Usage cards, rows and `magpie usage`;
- the Usage page's ledDecode;
- the Routing page's decodeOf and its ranking (fast routing reads
  noteTrySpeed, which uses DecodeOf).

settledCountVersion goes to 8, so settled heat totals are counted again.
The rule text is in en, zh, zh-TW, ja and de. Docs: reference.md, and
gui-shell.md under "Streamed output speed".

Red on the old code (scratch worktree at 589e4ba6d):
- TestCodexPreambleThenReasoningTellsSpeed: "reasoning seen from 0 ms;
  want 3166".
- TestVisibleReasoningSpeed: 100/1000 and 0/0 where 1500/14000 was
  wanted.

Run at this head (rebased on dc507aefd), on mote:
- go test -tags nogui -count=1 -timeout 45m ./...
  - gateway ok (1132s), usage ok, routes ok.
  - Red, filed, and caused by mote's own gateway on 127.0.0.1:3425:
    internal/cli TestHealthcheckFindsTheRunningGatewayWithoutMagpieAddr,
    TestUpdateRestartsTheGatewayItFindsWithoutMagpieAddr and
    TestUpdateFindsAMagpieThatWroteNoRecord (#6223, #6471); internal/gui
    TestLaneLimitRoutes (#5150).
- go vet for gateway and usage on darwin, GOOS=linux -tags nogui and
  GOOS=windows: ok. gofmt -l: clean.
- GUI, 18 files in Chromium and WebKit (reasoning-speed, usage-speed-*,
  usage-ledger, routing and the i18n files): 242 of 270 pass. The rest are
  usage-ledger "newest live route needs no return-to-live button" (#6003)
  and usage-speed-all-models "asked for 7d" (#5834). Both are red the same
  way on origin/main dc507aefd, in a run of its own.

Rebased again on 70ad7cf30, which touches gateway.go and usage/page.js.
At that head, on mote: go vet for gateway and usage; go test -run
"Reasoning|Speed|Decode|Ultra|Uncounted" for gateway and usage, ok;
reasoning-speed, usage-reads-note, usage-speed-every-row and i18n-keys in
both engines, 66 of 66.

Not tried: a real account per vendor. The timing is taken from recorded
stream shapes in the tests: Responses, Anthropic, Chat and Gemini, native
and translated.
2026-11-18 21:30:25 +08:00
yetone 1c0ecec0f6 library: a magpie in Docker keeps skills and prompts for its clients
fenglian980510 on X: in the Docker gateway the Library had MCP and no
Skills. Since f285426ac a page that shows no agent (no agents found, as
in a container, or gateway mode) drew the MCP tab alone. 5a9b5720d then
let another computer's magpie take a remote's skills and prompts (Use its
skills and prompts, GET /v1/magpie/library), but a Docker magpie had no
way to hold any, and anything it held was ticked for no agent, so Borrow
gave it to none on the client. The borrow change didn't re-derive the
agentless page.

- client.js: with no agent shown, the Library has Instructions, MCP
  servers and Skills (AGENTLESS_TABS), with nothing of agents (no chips,
  agents' own skills, projects or Agents list) and a line saying a
  magpie that adds this one as a provider takes them. It opens on MCP
  unless the reader picked one of the three. Strings in zh, zh-TW, ja, de.
- library: Shared says NoAgents when the page shows none (NoAgentsShown,
  set by gui.gatewayMode). Borrow gives such a new skill or set ticked
  for none to the agents here that take skills or instructions and
  aren't hidden (givenHere); one ticked for agents keeps them.
- docs: docker.html en/zh/ja (zh and ja still said there is no Library
  at all), reference.md, library, gui-shell and mcp-router pages; the
  search index rebuilt.

Rebased on origin/main 5cf1d3846 (runs below at 589e4ba6d; the five
commits since touch none of these files but gui-shell.md, which
rebased clean, and docs-index.mjs writeAll left the index unchanged).
The search index was rebuilt through
docs-index.mjs's writeAll after the rebase). What was run:
- At this head, on Linux (WSL magpie-desktop): gofmt -l (0 files),
  GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...: ok
  (mote and mica were over their load bars).
- At this head, on WSL: go test -tags nogui ./internal/library
  ./internal/gui ./internal/gateway ./internal/provider
  ./internal/testenv -count=1 -timeout 45m: all ok.
- At this head, on WSL: library-agentless-skills, library-mcp-agentless,
  i18n-keys, gateway-mode*, library-* and i18n-* (both engines, every
  language the files run): 1975 of 2010 ok. The 35 reds are in 11
  tests, all red on main too: library-all, library-commands-import,
  library-group-steady, library-mcp-copy-config, library-mcp-off-fold,
  library-open-again (#7097), library-bili (#6015: 82/2 alone, with and
  without this change), gateway-model-chip-height (#7108: red 2 of 3
  alone at main). library-bili-settings and library-mcp-json pass alone
  at both (22/22, 32/32).
- At 998e40c85 (the same change on origin/main 48fffb60c), on mica
  (load 25-35 on 12 cores): go test ./... -timeout 45m, 100 packages ok
  and 3 red, each also red or passing alone at the base 534b85bf9:
  internal/dirent (4 tests, red alone at both, #7031), internal/gui
  TestGatewayModeListsNoOwnSessions (passes alone 3/3, #7064),
  internal/sessions TestWSLStoppedDistroKept (passes alone, #7071).
  gofmt and darwin/linux/windows vet ok there too.
- At 998e40c85, on WSL: 239 GUI files that reach the Library (library-*,
  i18n-*, gateway-mode*, web-page*, any file naming the Library):
  4530 of 4688 ok. The 24 red files rerun at concurrency 2: 151 red at
  998e40c85, 155 at 48fffb60c, the same files (#7097, with #6990,
  #4566, #3922, #6570, #4716 for segs-press-redraw, old-webkit and
  title-bar-tools).
- Not on macOS this round: mote and mica each had another session's full
  GUI suite running all the while.

Broken by hand:
- Borrow's two NoAgents branches set to false:
  TestBorrowFromAMagpieWithNoAgents red ("a skill ticked for none there
  went to [] here, not [claude gemini]").
- origin/main's client.js and i18n.js: library-agentless-skills and
  library-mcp-agentless red at "the tabs", 44 of 44.

Not tried: a real Docker magpie with a second magpie borrowing from it
across two machines. site/search-index.mjs run as a script hangs on its
circular import of docs-index.mjs (as on main); the index was written
through docs-index.mjs's writeAll.
2026-11-18 21:29:39 +08:00
yetone 5cf1d3846a sessions: an agent left off in the first "allow selected" is asked about once more, on Sessions and Usage › Requests
baysonfox on X: with magpie installed after Antigravity 2.0, the app's
sessions and calls made without magpie never showed in Usage, while agy
CLI's did. The first consent named the app off beside agy, and a named
agent was never "new" again, so nothing asked about it and nothing on
Usage said why. The reader is fine: the app's calls come from its own
SQLite steps (antigravityRead), read once allowed.

Nothing is turned on by magpie: the gate is the user's privacy choice.
Instead:
- settings.SessionReads gets Kept: agents turned off on their own (a
  sessions/reads post without `all`: Keep off, a Settings › Privacy row,
  `magpie sessions read off <agent>`). A post setting it on takes it out.
- readsNow's New: off, found here and not Kept (was: never named). So an
  agent left off in the first choice's list is asked about once more,
  as one found later already was.
- Usage › Requests shows a line above its rows for those agents
  (readsLater in the usage plugin): Count {names} / Don't count, the
  same {agents} posts as the Sessions page's laterCard. Gone after
  either answer; sessions/reads read at most once a minute.
- Old data: an agent turned off in Settings before Kept existed has no
  entry and is asked once more, for every user with such an agent.

Tests:
- TestSessionReadsUncheckedAgentAskedAgain (count, keep off): sandbox
  HOME with testdata/agy-sessions and the real Antigravity 2.30
  conversation (antigravity-2.30-tools); after the first choice the app
  is off and New, has no rows in /api/usage/requests; Count brings its
  rows in, Keep off keeps none, and neither is asked again. Red on the
  old code (New false after the first choice).
- TestSessionReadsTurnedOffNotAskedAgain: off on its own, under all true
  and all false, is neither on nor New.
- usage-reads-note.test.cjs: the Requests line in Chromium and WebKit,
  en/zh/zh-TW/ja/de at 900/420/390px, both answers, buttons inside the
  line, no sideways scroll; red on the old code (no #ledReads).

Run on mica (mote was full: load 40+, another GUI suite on it), rebased
on 389169f76:
- gofmt -l clean
- go vet on gui, sessions, settings, cli and tui; GOOS=linux -tags nogui
  and GOOS=windows vet on gui, sessions, settings and cli; go build ./...
- go test -count=1 -timeout 45m on internal/gui, sessions, settings, cli
  and tui: all ok except gui's TestGatewayModeListsNoOwnSessions, red
  the same on an untouched 389169f76 copy (#7064)
- GUI, both engines: usage-reads-note, sessions-reads, i18n-keys,
  i18n-en-no-cjk, usage-ledger, usage-request-page, usage-no-reading,
  usage-ledger-fit, ledger-hscroll, usage-phone-head, sessions-usage-off.
  Only usage-ledger's "newest live route needs no return-to-live button"
  was red (en, zh, both engines), red the same on the untouched
  389169f76 copy (#3104). i18n-keys first caught "Leave off" as otel's
  word; renamed to "Don't count".
- After rebasing on dc507aefd: gofmt, vet, the TestSessionReads tests
  and usage-reads-note, i18n-keys, i18n-en-no-cjk and sessions-reads
  again: all ok, 98 of 98 GUI tests.

Broken by hand: recording Kept on every off post (all sent too) turns
TestSessionReadsNewAgent, ...UncheckedAgentAskedAgain and
...TurnedOffNotAskedAgain red.

Not tried: the whole GUI suite (both machines had another GUI suite
running), the full go test ./..., and a real Antigravity 2.0 install
in the GUI; the live Antigravity data was not touched.
2026-11-18 20:59:55 +08:00
yetone 8634c4ad08 library: a repository's card counts the skills its sheet lists once the repository is read
bdefdc319's repository card counted the skills skills.sh lists, while
its sheet, once Find skills' probe had read the repository, listed what
the repository holds: mattpocock/skills read 55 on the card and 39 in
the sheet, a number that changed on click.

A repository's read is now kept for the session (repoRead). Once it is
read, the card behind the sheet says the sheet's count at once, keeps
it when drawn again, and takes its Added from the read too; reopened,
the sheet lists the read repository straight away, the skills just
installed greyed, while it is read again. A later read that fails keeps
the one before; one with no SKILL.md drops it.

Run (mote, at origin/main e199eb9c7 + this):
- market-repo.test.cjs: 20 of 20, chromium and WebKit, five languages,
  420px. It now checks the card's count after the read, after the
  install's redraw, and the reopened sheet. With the card counting
  skills.sh's list again by hand, all 5 chromium first cases red.
- Every market-* file and i18n-keys: 132 of 132.
The whole GUI suite runs after the push, with bdefdc319's.
2026-11-18 18:33:34 +08:00
yetone bfddc9cfba routing: DimCode's requests read as DimCode, with its mark, by key too
Yayoi_no_yume on X, a Docker magpie (v0.1.4350): DimCode (dimcode.dev)
on another computer, calling with a gateway key named "Magpie", drew
the Routing page's client node as the cube and "Magpie", and the
request's story said "DimAgent asked for the routing group Step 5
Preview".

Two causes:
- DimCode was no client magpie knew, so usage.AgentOf named it by its
  product name: npm's dimagent 0.5.29 sends "DimAgent/<version>" to a
  provider set to send its identity (resolveDimOAuthIdentityHeaders)
  and "DimCode/<version>" otherwise (read from the published binary).
  A client "dimcode" (DimCode, UA dimagent/dimcode) now names it,
  apart from the Dim alpha magpie starts ("dima"/"dimcode-alpha" stay
  Dim's, by name first). Its icon is dim-color: dimcode.dev's favicon
  (dimagent-favicon.svg, "Official DimAgent mark") is the same artwork.
  Routes and ledger records kept before are named again through
  AgentOf (Route.routedAgain), so old "DimAgent" rows read as DimCode.
- A keyed request's node read the key's name alone (eadc6cdb9, for a
  script's key behind "Python-urllib"). An agent magpie knows now
  reads "agent · key", as Usage's ledger rows already do; a script's
  key keeps the key's name alone. The tooltip names the agent once.
  The tray panel's stage and rows share callerName and read the same.

The icon comes from the embedded assets, which the web (Docker) build
serves the same way; the GUI test checks the image loads.

Run on mote:
- go vet ./internal/agent, GOOS=linux -tags nogui and GOOS=windows:
  ok. go test -count=1 ./internal/agent ./internal/usage: ok (agent 463s, usage 124s)
- TestDimCodeByUserAgent is red with the dimcode entry taken out
  (AgentOf("DimAgent/0.5.29") = "DimAgent").
- GUI, chromium and webkit, every language, 1100 and 420:
  routing-agent-with-key.test.cjs (new), i18n-keys, i18n-en-no-cjk:
  30 of 30 pass. Earlier, on mica, with the same client.js: the 28 other
  files that read callerKey, .rt-src, .ps-name/.ps-ag or .pr-who pass
  but api-key-usage (#7083) and usage-ledger's return-to-live case
  (#5048), both red on origin/main 2416beed6 too.
  routing-agent-with-key is red on the old client.js ('Magpie' for
  'DimCode · Magpie').

Not tried: a real DimCode against a real Docker magpie; the
User-Agents come from the published binary and the reporter's log.
2026-11-18 18:03:16 +08:00
yetone bdefdc3191 library: a repository's skills on skills.sh are one card, opened to install all or a few (Ethereal499 on X)
skills.sh lists a repository's skills one by one, so mattpocock/skills
showed as 55 cards side by side in Library > Skills > Discover. Two or
more listed from one repository are now one card, the repository, where
its first skill comes in the list: its name, how many skills the list
has, their names and their installs summed. magpie's own featured skills
and a repository with one skill listed keep their own cards. Only a
skill's own card asks for its about.

Opened (the card or its Choose...), the sheet shows the list's skills at
once, ticked, and reads the whole repository through Find skills' probe
(library/skills/probe): once it answers, every skill the repository holds
is listed, the list's still ticked, the ones the library has greyed, with
Select all and a filter past 8. Install takes the picked paths in one
skills/install. A repository too big to read whole (#2794) keeps the
list's skills, with the reason, and installs each as its card's Add does
(market/skill). The "in the library" list already groups skills by
repository (skillGroups), so it is unchanged.

Strings in zh, zh-TW, ja and de. No backend change.

Run (mote, at base 54117164c, which has the library plugin and GUI
tests as origin/main 2416beed6 has them):
- market-repo.test.cjs (new): 20 of 20, chromium and WebKit, five
  languages, 420px. With entriesOf's grouping turned off by hand, all
  10 chromium cases red.
- Every market-*, library-*, skill-* and i18n-* file (--test-concurrency=4,
  mote at load 40 to 67 with another session's GUI suite): 2434 of 2494.
  The reds' files, run again at base without this change: library-open-
  again (#6751), skill-fold-all (#6667), skill-group-shared (#6687) and
  skill-manual (#6668) red the same there. skill-where's "the switch
  scrolls nothing" (#5859) was red at base too, 2 of 4 runs interleaved
  with this change's. library-bili-settings (webkit zh-TW timeout) and
  market-have (chromium zh mcp mark, #4620) passed run again with it.
- go test -count=1 -timeout 45m ./internal/gui: ok.
- Real use: library.MarketSkills("mattpocock") in a sandbox HOME lists
  55 from mattpocock/skills and 39 from devcxl/mattpocock-skills-zh, and
  ProbeSkills("mattpocock/skills") reads 39 skills.

Not run: the whole GUI suite (mote had another session's running, mica
at load 63 on 12 cores); it runs after the push. Not tried in the real
app window or on Linux WebKitGTK; no motion was added.
2026-11-18 18:01:37 +08:00
yetone 67f24d7422 usage: every cache hit rate to two decimals, its exact share on hover; a speed's dash says why
shangyuan0818 on X: in Usage › Requests the ranking's model hit rates
had no decimals or one ("98%" beside "99.6%"), the request table mixed
them too, and hovering showed no exact value.

- hitPct gives every hit rate two decimals (98.00%, 99.60%), the same
  in the ranking, the request table and its details, the Cache hit
  rate card, the cache-read tiles, the model and agent rows, Sessions,
  the tray panel, Routing's rows, figures and group averages, and the
  context window's Prompt cache. It still never says 100.00% or 0.00%
  of a prompt not all or none cached (99.99%, 0.01%).
- Each of them has the exact share on hover, in its title (hitTip):
  "9,800 of 10,000 prompt tokens read from the cache: 98%", the share
  to six places with no trailing zeros. One new string, translated in
  zh, zh-TW, ja and de.

ohblue on X: 速度 shows "—" for many 200 requests (491 in, 93 out,
first token 6.3s, total 6.4s), "≥133 token/秒" for others.

- That speed can't honestly be counted: 93 tokens in the 120ms after a
  6.3s wait would read ~775 tok/s, which is a reply written during the
  wait and let go at once (ledHeldShort_). The dash already had its
  reason as a title, but nothing showed it was there. It now has the
  help cursor (the cache column's dash too), the Speed column's head
  says what a speed is on hover, and a request's details say "— " and
  the reason in words, for a reader who can't hover.

Budget: app.js and the core grew by my hitTip, cacheHitTip and the
titles. To stay inside both budgets with no raise, setQuotaRange moved
to plugins/usage/page.js and PLACEHOLDER to plugins/redact/page.js (each
read by that page alone), cacheHitOf and cacheHitTip share cachePrompt,
and hitPct is one expression. Core 1,272,578 of 1,272,581; app.js
1,087,887 of 1,088,248.

Run on mote/mica, this change on origin/main, both engines, every
language, at the widths each file covers:
- usage-hit-exact.test.cjs (new): green. Red with the old hitPct
  ('hit rate 98%') and red with the help cursor and the details' line
  taken out ('pointer' !== 'help').
- 85 GUI files (every test that reads a hit rate, quota range or
  masking, Usage, Routing, i18n-keys, gui-ja/de/zh-tw): 1318 pass, 30
  fail. All 30 are red alike without this change, and all are filed:
  agent-menu-label webkit panel (#6371), zcode-models webkit de
  (#6566), quota-credits (#6807), quota-curve (#6789), usage-fold's
  17 subscriptions (#3415, #6003), usage-ledger (#4078, #3104, #4626),
  usage-ledger-chart (#6790). usage-fold's 'several accounts' went red
  only under the 85-file run and passes alone on this tree (#3415,
  commented).
- go test ./internal/gui on mica: ok (TestCoreScriptBudget included).
- Red alike on a HEAD checkout without this change, already filed:
  usage-ledger "newest live route needs no return-to-live button"
  (#4078, #3104, #4626), usage-ledger-chart "the metric is remembered"
  (#6790).

Not run before the push: the whole GUI suite and go test ./... (both
machines had other sessions' full suites running); they run after it
and their result goes on record. Not tried: Windows WebView2, the
reporters' own ledgers, the real app.
2026-11-18 16:14:52 +08:00
yetone 42c43c0020 sessions: an agent found after Allow selected is asked about once (Antigravity 2.0)
baysonfox on X: Antigravity 2.0 desktop sessions showed on the Sessions
page only while the app was connected to magpie; agy CLI's always showed.

Cause: not the file reader. Real Antigravity 2.30 (signed out, no model,
sandbox HOME on the Windows box) writes ~/.gemini/antigravity/
conversations/<id>.db, conversation_summaries.db and brain/, and
internal/sessions parses them. The gate is settings.SessionReads:
"Allow selected" (and the Usage readsNote's "Count …") saves all:false,
so an agent installed after that choice is never read and never asked
about again. Gateway-recorded sessions skip the gate, hence "only when
connected".

Fix: /api/sessions/reads marks a found agent `new` when the choice was
made, it isn't read, isn't named in Agents and is on disk (Found(), which
checks every OS's path). The Sessions page shows one quiet card for those
(laterCard): "Show their sessions" names each on, "Keep off" names each
off, so it isn't asked again. No new endpoint; the card posts the
existing sessions/reads.

Tests: TestSessionReadsNewAgent copies the real 2.30 files
(internal/sessions/testdata/antigravity-2.30, sandbox paths only, no
tokens) beside agy-sessions, with agy allowed by name: antigravity is
off and new, nothing listed; after the answer it is not new, settings
keep all:false/agy:true, and its one session is listed only when shown.
TestSessionReadsNewOnlyWhenNamed: not asked, allow all, all with agy off
mark nothing new. sessions-reads.test.cjs: the card, both answers, posts
and no card after reload, Chromium and WebKit, 5 languages, 900/390px.

Run at d7d62d889, on mote, then rebased onto 48fffb60c (app.js and
settings-groups only, no file in common):
- gofmt -l, node --check client.js/i18n.js: clean
- go vet ./internal/gui ./internal/sessions; GOOS=linux -tags nogui and
  GOOS=windows go vet of the same: ok; go build .: ok
- go test -count=1 ./internal/sessions: ok (282s)
- go test -run 'TestSessionReads|TestCoreScript|TestI18n|TestCSS'
  ./internal/gui: ok
- GUI: sessions*.test.cjs (45 files), usage-reads-note,
  gateway-mode-sessions, i18n-keys, window-back-once: 711/711 pass
Broken by hand: New forced false, TestSessionReadsNewAgent red in both
subtests ("want off and new"). An earlier "Allow" button label was red
in i18n-keys (core word, internal/agent/reach.go), hence the label.
Not run: the whole GUI suite and the full go test ./... (mote and mica
were overloaded, mica's disk full). Not tried: a real Antigravity 2.0
on macOS/Linux; Found() paths for those come from the existing reader.
Not changed: the Usage page's readsNote still shows only before the
choice; Found() doesn't look into WSL distros.
2026-11-18 16:04:10 +08:00
yetone 61c714ed01 sessions: By tokens selects the small sessions, to delete them at once
A user asked for a way to delete every session under 10K or 20K tokens
(yansheng1003 on X). Selecting sessions on the Sessions page now has a
"By tokens" button beside Delete. It opens the app menu (openProtoMenu,
no native select) with 10K, 20K, 50K and 100K, each showing how many of
the sessions on screen it would select. A pick replaces the selection
with the deletable rows on screen (search and filters apply) that used
fewer tokens than that. Tokens are counted with sessTokens, the number
each row shows.

A session that is streaming now (speedOf().live) or was written in the
last minute is never picked. The server already refuses one written in
the last minute (sessions.Delete's ErrActive). Delete is the existing
path: each agent's own delete, gateway-only and forgotten sessions
handled as before, files moved to magpie's trash. The existing
confirmation names how many sessions go and that Trash puts them back.
When the selection is still the By tokens pick, it adds "Each used
fewer than 20K tokens". A selection changed by hand drops that line.

Only the Sessions plugin changes (client.js, i18n.js in en, zh, zh-TW,
ja and de, sessions.css). No server change.

New test: sessions-small-delete.test.cjs, in Chromium and WebKit, every
language, against a faked API. It covers the menu's head and counts,
the pick (running, live, read-only and larger sessions left out, cache
counted as the row counts it), a smaller size replacing the pick, a
search narrowing it, the dialog's size line, Cancel posting nothing,
Delete posting the 4 ids, a 420px bar, and no native select.

Run:
- At the pushed tree (on origin/main 31575f71a), mote: i18n-*, nav-timeout
  and sessions-small-delete: 19 of 19 pass.
- At this tree (c3e0a6bb5, on origin/main 31575f71a), mote, load ~40:
  - sessions-*, i18n-*, proto-menu-overflow, checkbox-look and
    library-sessions-mcp: 661 of 661 pass.
  - go test ./internal/gui -run
    'TestCoreScriptBudget|TestI18n|TestCSS|TestPlugin|TestAsset|TestBudget':
    ok.
- Before the rebase (on 7707ba9ad), mica: the new file 10 of 10, and
  the touched set 670 of 670.
- Whole GUI suite before the rebase (mote, --test-concurrency=4):
  the ssh session dropped about two-thirds through. 934 of 1586 files ran
  (to r*), 11193 ok and 397 not ok in 78 files, and no Sessions file was
  among them. Each red file ran again alone, at this change and at
  origin/main 32a181868, and the same tests failed on both:
  - 5 files: 68 of 82 red on both trees (#6709).
  - The 9 files not in #6709: 16 of 224 red on both trees, flaky WebKit
    subtests (#6807, #4784, #4071, #6038, #4210, #3951, #5109).
    provider-base-as-typed and provider-env-paste are #6038's class and
    were added to it.

Broken by hand, then put back: with the running and live exclusion
removed from smallOf, the chromium en case went red.

Not tried: the remaining 652 GUI files after the drop (both machines
were over their cores with other sessions' suites), and the real app
window with real sessions.
2026-11-18 14:36:31 +08:00
yetone 87af7281e2 gui: Connected means an agent goes through magpie; the Library's list says Using the library
"Connected" meant two things: an agent routed through magpie, and an
agent that uses the Library's servers and skills (item 18). The second
is now "Using the library"; Connected keeps the first.

Own tests: agent-app-restart, library-mcp-hub.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone 6facdb2461 gui: a provider's limit is Requests at once, as on gateway keys and accounts
The provider editor called it Concurrency while gateway keys and
accounts said Requests at once (item 18). One name now, in every
language; the old key is gone from i18n.js.

Own tests: provider-concurrency, provider-rpm, lane-limit,
gateway-key-concurrency; Go: internal/access.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone 28430c9b90 gui: magpie's own paths are written with ›
A path through magpie's own screens was written with › in some places
and → in others (11-17 scan, item 18). Every one the user reads is now
›: Settings › Network and sharing, Settings › Privacy, Library › MCP
servers, Providers › … › Use it anyway, Settings › Usage, in the GUI and
in the Go errors and notices that reach it, in every language. The GUI
matches errNotAsked by its prefix, so it still finds it.

Left as they are: gateway errors written for agents, AiHubMix's and
Claude Desktop's own menu paths (their apps' words), the image MCP tool
description (it goes to agents), and comments.

Own tests: chatgpt-usage-why, websearch-places, library-mcp-hub,
i18n-keys; Go: internal/library (TestPrivateRepoInstallsWithToken, red
on the first try because skills.go still had →), internal/plugin
(notplugin_test), internal/pii, internal/provider.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone 039719491c gui: Sessions' Settings › names the session terminal too, beside history
The Sessions page's head had one Settings › link, and it went to
Privacy's Agents' session history. The other setting the page uses, the
terminal a session opens in (General's Session terminal), had no way
there from Sessions. Where that row exists (a Mac, or a terminal found
on Windows or Linux), Settings › now opens the app's menu with both,
each noting its tab (Settings › Privacy, Settings › General), and each
opens Settings at its row, lit, with Back to Sessions. Without a
terminal row it goes straight to Privacy as before; gateway mode still
has no link. When the row shows is one rule now
(window.sessionTerminalShows in sessions/settings.js), asked by both.
No new strings; the core is unchanged.

Run (mote, at this tree):
- sessions-to-settings (now also on a Mac: the menu, both items, each
  reaching its row, nothing moved, the menu inside the window at 420),
  sessions-reads, gateway-mode-sessions, settings-search, i18n-keys,
  Chromium and WebKit, every language: 104 of 104 pass.
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok.

Broken by hand, each red, then put back:
- Settings › going straight to Privacy always: sessions-to-settings 20
  of 20 red.
- the terminal item aimed at the history rows: 20 of 20 red.

Not tried: the real app window.
2026-11-18 14:07:19 +08:00
yetone 2957d16e5e gui: every alert row says when notifications won't show, in sight; Bark says it gets them all
The scan's item 9. When the system blocks magpie's notifications, or
can't show them, Settings › Usage's four alerts said so after their
description, but the Masking alert in Settings › Privacy didn't. Both
take the line from one helper now (notifyWarn in app.js), and the
Masking alert appends it as the others do.

On a computer with a pointer that warning was never in sight anyway:
Settings holds a row's explaining line out of sight for the hover card
(app.css, 11-02), and the warning sat inside that line. The comment
there says a warning stays; the rule didn't. A line holding a .warn now
stays in place, so the warning is read without hovering.

Bark gets every notification magpie shows (sendAs → barkPush), even
while the system's are turned off. Its row now says so, in every
language, rather than following a separate set of choices.

New test notify-warn-places.test.cjs: denied and unavailable, the
Masking alert's and the usage alert's warning on screen (wider than the
1px a held line gets, no clip-path), none when nothing is wrong, Bark's
line, nothing past the edge; every language, 900 and 380, both engines.

Run (mote, at this tree; mote at load ~50 and mica at ~160, mote the
lighter):
- notify-warn-places, mask-alert, builtin-places, i18n-keys, bark,
  settings-hints, usage-alert, reset-reminder, turn-done, settings-search,
  settings-search-reach, settings-groups, gui-de, editor-hints,
  privacy-hides-accounts, Chromium and WebKit: reds only these, each red
  on an origin/main 888d4eba5 copy too and filed: bark's "Bark is set…"
  at 900px, the click moves the page 2px (#6543), editor-hints WebKit
  (#6156), settings-groups "warm-ups and check-in" (#6597).
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS':
  ok, no budget raised.

Broken by hand, each red, then put back:
- the :has(> .warn) exemption removed: notify-warn-places 30 of 30 red.
- the Masking alert's warning not appended: 30 of 30 red.
- Bark's line removed from index.html: 30 of 30 red.

Not tried: the real app with notifications turned off in System
Settings, and a real Bark push.
2026-11-18 13:53:15 +08:00
yetone 93fa1d661c library: a Claude plugin's parts keep their own agents through sync, and each says which plugin it came with
givePlugin gives every part of a Claude plugin (skills, MCP servers,
hooks, subagents) the plugin's agents. putPlugins' settle ran it on every
sync put, even when the plugin's own agents and switch hadn't changed.
So an agent ticked or unticked on a part's own row was put back on the
next sync without a word. Now settle gives the parts the plugin's agents
only when those agents or the switch change. A part's own edit stays
until then.

The Library never showed `bundle`, so nothing on a part's row said it
belonged to a plugin. Each such row (Skills, MCP, Hooks, Subagents) now
carries an "In {plugin}" tag. Its tooltip says that changing the
plugin's agents, or turning the plugin off and on, gives the part to the
plugin's agents again. The tag is in en, zh, zh-TW, ja and de.

Tests:
- TestPluginPartOwnAgentsKeptBySync: tdd set to claude alone survives a
  sync of the same plugin, and changing the plugin's agents gives tdd
  the plugin's agents again.
- library-plugin-parts.test.cjs (new): one bundled part and one own part
  on every tab. Each bundled part has the tag, with its text and tooltip
  in each language, and the own part has none. Nothing is wider than the
  window at 1100 and 420. Chromium and WebKit.

Run (mica, at this tree on 32a181868):
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok.
- go test ./internal/library: ok.
- every library-*.test.cjs plus i18n-keys, both engines: 1900 pass,
  10 red.
  - library-open-again's 1100px cases are red on origin/main 98355866f
    too, run alone (#6751).
  - library-commands' WebKit de case (#7035) and library-pi-market's
    Chromium case (#7036) were red under load 110. Run again alone,
    they pass on this tree and on origin/main.

Broken by hand, each red, then put back:
- settle giving the parts on every put (`if moved || true`):
  TestPluginPartOwnAgentsKeptBySync red ("tdd's agents: claude,codex,
  want its own claude").
- withPlugin never tagging (`if (false && x.bundle)`):
  library-plugin-parts 82 red of 82.

Not tried: the real app window, or a real Claude plugin's sync between
two computers.

Run again after a rebase on 888d4eba5 (mica): the go test guards and ./internal/library ok; library-plugin-parts, library-plugins, agent-disconnect, agent-bulk-visibility, agent-visibility-saving, plugin-tools, i18n-keys, gui-de, gui-ja and gui-zh-tw, both engines: 155 pass, 0 fail.

At the pushed head, on cb1fe6d5d (mica): the go test guards, ./internal/library -run TestPlugin, i18n-keys and agent-disconnect ok.
2026-11-18 13:52:12 +08:00
yetone 888d4eba52 library: the MCP market puts the most used servers first, counted from the day's report
gugediyige666 and freedomf26 on X asked for an MCP list ranked by
downloads, searchable and installable. Search and install from the list
were already there; skills were already ranked by skills.sh's install
counts. What was missing was a count of who uses each MCP server.

- internal/library/market_public.go: PublicServers names the Library's
  servers that an agent is given and that the market lists from what
  ships with magpie (featured, or the registry snapshot), by market id
  only, matched by serverKey. A bare command names no package and is
  never matched; a server of the user's own, one found only by a
  search, and its address, command or keys never go.
- internal/stats/plugins.go: the day's plugin report carries them as
  "servers" (at most 50), and goes when either list has something.
  PluginCounts returns a Board with plugins and servers.
- site/pluginstats.js: servers are kept as mcp:<id> beside the plugins,
  pruned apart (D1 binds at most 100 values a statement; the test's
  stand-in now enforces that), never liked, and /api/plugins/stats
  returns them under servers.
- GUI: with nothing searched, a server with 20 or more users comes
  first, most used first, with a person chip of its count; the rest
  keep the curated order. Counts are waited for at most a second, so a
  drawn list never reorders; a search keeps the registry's ranking; a
  failed ask is tried again after a minute, not with every search.
- Privacy text: READMEs (en, zh), site privacy and start pages (en, zh,
  ja), reference.md, the Settings privacy row (zh, zh-TW, ja, de),
  llms-full.txt and search indexes rebuilt; docs/subsystems/library.md.

Run (mote, rebased on 18fe1e2dc; budget, TestI18n*, i18n-keys, market-used and privacy-usage-stats again at b53e23ba3, ok):
- go test ./internal/library ./internal/stats ./internal/gui (TestPublicServers,
  TestPublicServerIDsAreCatalogIDs, TestSendPlugins, TestPluginCounts,
  TestCoreScriptBudget, TestI18n*): ok. gofmt -l clean; go vet darwin ok,
  GOOS=linux/windows CGO_ENABLED=0 vet of library and stats ok.
- node --test site/pluginstats.test.mjs: 8 of 8.
- GUI, chromium and webkit, en/zh/zh-TW/ja/de: market-used (new, 30 of
  30), i18n-keys, i18n-en-no-cjk, market-*, plugin-market, privacy-*,
  library-pi-market: 284 of 284.
- Broken by hand: matching a bare command made TestPublicServers name
  "bare-one"; turning byUse off made market-used red. The old single
  DELETE of 100+ bound values made the new site test red.

Not run before the push: the full Go suite and the whole GUI suite.
mote and mica were both running other sessions' full and GUI suites
(load 45 to 270); they run after, on mote. Not tried: a real day's
report reaching usemagpie.ai from a live install (the worker is
checked with curl after deploy).
2026-11-18 13:39:27 +08:00
yetone eca40383f7 routing: a group's routing and window read as a provider's do
The same setting had two names. The Routing page called the "usage"
routing "Least used", while the provider editor, Smart's own hint ("pick
In turn or Least used first"), Built-in plugins and the account reasons
call it "Least used first". A group's Advanced named the window agents
are told "Context", where a provider's Advanced, Agents and the context
card say "Context window". Both now use the provider editor's word
(translations already there in zh, zh-TW, ja and de). Stays, Rate
limited and Compact at already read the same on both pages and are left.

Run (mote, at this tree; load 27 on 18 cores, mica 26 on 12):
- group-context, routing-group-strategy, account-arrange, routing-save,
  routing-key-windows, i18n-keys, group-compact and settings-search,
  Chromium and WebKit: 118 pass, 2 red: account-arrange in both engines
  (53 !== 52), red the same on origin/main 265217bf4 run alone, #6010.
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS|Budget': ok.

Broken by hand: group-context and routing-group-strategy on the old
client.js, 8 of 22 red (the old labels).

Not tried: the real app window.
2026-11-18 12:38:45 +08:00
yetone 3c44ed92bb routing: a group's Save refuses a Slow to start, Context or Compact at that doesn't read
Typing "abc" into a group's Context, Slow to start minutes or Compact at
marked the box, but Save went on and sent the last good value (or the
one the editor opened with), so the user saw "Sol saved" for a number
they never typed. Save now stops on the first such box: Advanced opens,
the box takes focus, and the status line says what is wrong with it.
Compact at, which only set aria-invalid, now says it under the box too
("abc is not a length of tokens like 200k or 1m", the string Context
already has in every language); an empty box is none, not an error.

Run (mote, at this tree; mote's load was 27 on 18 cores, mica's 26 on
12, so neither had room and mote took it):
- group-compact, group-context and group-first-token, Chromium and
  WebKit, every language each covers: 34 of 34 pass.
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS|Budget': ok.

Broken by hand: the three tests on the old client.js are 34 of 34 red
("a bad time is not saved", "a bad context is not saved", "a bad
length is said, not only marked").

Not tried: the real app window.
2026-11-18 12:29:31 +08:00
yetone a265632dae routing: a model in a group at one reasoning can be added again at another (visamzh on X)
visamzh on X: in a Routing group, the same model can no longer be added a
second time at another reasoning effort (gpt-6.2-sol at xhigh and at high).
It used to work.

Cause: 74c67785c (#907, 10-05) ticked a model in the Add a model picker
when any member had its base, so sol showed ticked for sol:xhigh. A click
on sol then took sol:xhigh out instead of adding sol, so a second effort
could never be added from the GUI. Saving (SaveGroup's cleanList dedups
exact ids only), reading, the gateway's members() (each effort its own
member, internal/gateway/groupeffort_test.go) and the TUI picker were never
affected, so groups that already hold sol:xhigh and sol:high load and route
as they are.

Now a member held at a fixed reasoning or on one account is a row of its
own in the picker, ticked, its level/account in its note, and a click on
it takes that member out, as #907 asked. The model's own row under it is
unticked and adds the model again, to be set to another level in its row.

Tests:
- group-member-again.test.cjs (new): sol:xhigh in the group gives two sol
  rows (held one ticked, says "xhigh reasoning"), the plain one adds a
  third member, set to high it saves [sol:xhigh, terra:high, sol:high];
  a group already holding sol:xhigh and sol:high shows both and saves
  both. en/zh x chromium/webkit.
- group-pick-filter.test.cjs (#907) updated: the held row stays ticked and
  takes its member out; the plain row is not ticked; save keeps two:max.

Run (mote, mote-run, node --test):
- group-member-again + group-pick-filter at this head: 8/8 pass. At
  origin/main e1c186cfe with the new test: group-member-again 0/4
  ("sol at xhigh and sol itself are not two rows 1 !== 2").
- Every GUI file reaching ?view=groups or plugins/routing (104 files,
  concurrency 4): 1401/1473 pass. The 72 reds were in 10 files. The 9 files
  rerun at this head and at origin/main e1c186cfe (concurrency 2): the
  same 71 reds at both. routing-groups-page's one 420px red (quotas
  redrawn) passed in the rerun. Filed: #7016 (routing-provider-off,
  routing-rows-fit, win-fonts); the rest are in #6934
  (group-editor-selected, menu-input-scroll, mobile-web,
  name-suffix-where-named, zero-priced-free).
- Rebased onto 69233d6bc (Docker image only) after the runs.

Not tried: a click-through in the real app. No Go changed, so the Go
groupeffort tests were not run again. No new strings, so zh-TW/ja/de are
unaffected.
2026-11-18 10:42:59 +08:00
yetone 69233d6bcf docker: the image has npx, node, npm, uvx and python for the Library's MCP servers
Passings_z on X: in magpie's Docker image, adding Chrome DevTools' MCP
server from the Library said "npx not found". The runtime stage is
debian:12-slim with ca-certificates and curl only, and the Library's
servers run in the container (gateway mode keeps Library's MCP servers
and the router), so every featured entry but the remote ones failed the
same way: npx for chrome-devtools, playwright, filesystem, memory,
sequential-thinking, brave, firecrawl, tavily and everme, uvx for fetch,
git and time, and the registry's npx/uvx entries.

The image now copies in Node 24.22.3 (node, npm, npx, from the official
bookworm image, matching Debian 12's glibc) and uv 0.13.7 (uv, uvx, from
astral's image). python and python3 are a two-line shim onto uv's own
Python, which uv downloads into the volume on first use (UV_PYTHON=3.14).
UV_PYTHON_PREFERENCE=only-managed keeps uv from taking the shim as an
interpreter: without it uvx recursed and hung looking for one.

Size (docker image inspect / du -sxm / as root):
  origin/main  74,636,782 B compressed, 190 MB on disk
  this         142,667,379 B compressed, 370 MB on disk  (+68 MB, +180 MB)
node is 127 MB of it, npm 19 MB, uv and uvx 43 MB. Bun in place of npx
was weighed and left: agents in the container read PATH themselves, and
Bun's Node compatibility isn't every server's.

The image still has no browser (Chrome would be ~300 MB more for every
user). Chrome DevTools' and Playwright's servers start, list their tools,
and every tool then fails: "Could not find Google Chrome executable for
channel 'stable' at: /opt/google/chrome/chrome" (seen in the image). The
check now reports such a server, run by npx/bunx/pnpx in a container with
no /opt/google/chrome/chrome and no option pointing it at a browser
(--browserUrl/-u, --wsEndpoint, --executablePath, --channel,
--autoConnect; --cdp-endpoint, --executable-path, --browser,
--extension), as Why "nobrowser" with its tools still counted. The row
says "no Chrome here", and its tooltip points at Magpie Browser or the
server's option for a Chrome it can reach; the hub's text says the same.
Desktops, macOS and an image with Chrome are unchanged. A docker-launched
(OCI) entry still says docker not found: there is no Docker in the
container. Docs (en, zh, ja docker.html) get an "MCP servers" section;
the Docker workflow's smoke test runs node/npm/npx/uvx/uv -v and finds
python3 and python.

Run:
- Docker on xiaomi-gpu, origin/main's Dockerfile vs this one, web mode
  with a fresh volume, servers added with `magpie library mcp add` and
  checked through POST /api/library/mcp/check:
  - origin/main: chrome-devtools, memory: notfound "npx"; fetch:
    notfound "uvx" (the report).
  - this: memory ok, 9 tools; fetch (uvx mcp-server-fetch) ok, 1 tool,
    Python downloaded on first run; chrome-devtools error nobrowser
    --browserUrl, 33 tools.
  - tools/call over stdio inside the container with a small node MCP
    client: memory create_entities returned the entity; fetch fetched
    https://example.com; chrome-devtools new_page returned the Chrome
    error above.
- go test -run 'TestNoBrowser|TestCheckSaysNoBrowser|TestCheckStdio'
  ./internal/library on mote: ok. Broken by hand (the hook in
  checkServer turned off): TestCheckSaysNoBrowser red, "got {State:ok
  Tools:3 …}".
- GUI on mote, Chromium and WebKit, en zh zh-TW ja de, 1100 and 390:
  mcp-no-browser (new), mcp-home-health, library-mcp-health, i18n-keys,
  i18n-en-no-cjk: 58 of 58 pass.
- gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./... and go build ok on mote.
- go test -timeout 45m ./... on mote at this head (on e1c186cfe): 103
  packages ok, none failed (internal/gateway 1039s, internal/library
  408s).

Not tried: an arm64 build of the image (both base images are
multi-arch; CI builds it). The test box's network to npm dropped
mid-run: npx -y then timed out the 30s check step, and one npx install
cut short left ~/.npm/_npx with a missing module until it was removed;
that is npm's cache, the same on a desktop.
2026-11-18 10:02:53 +08:00
yetone 60b10c69a7 gui: Routing's live note gives way before its buttons in a narrow window (#6669)
Since Routing groups › (11-06) and Settings › (a6e4cf763) joined Hide
accounts in Routing's head, German ran 38px past a 560px window
("Konten verbergen" to 590 in a 552px view), so view-no-sideways was red
in both engines. The head's note ("live, as the gateway decides") now
shrinks first and ends in an ellipsis, as the plugin panel's head note
does; the three buttons stay whole. The phone layout, which puts the note
on a line of its own, is unchanged.

Run on mica at this tree (origin/main 169446a1d + this change),
Playwright 1.62.0:
- view-no-sideways and phone-no-sideways: 58/58, both engines (red at
  origin/main: "routing: scrolls 38px sideways here", de window 560px).
- the 15 GUI files that touch Routing's head (account-mask, mask-emails,
  mobile-web, provider-mask, reduce-motion, routing-*, settings-back,
  settings-places, view-scrollbar-drag and others), --test-concurrency=1:
  396 pass. mobile-web's 8 "desktop matches origin/main" cases fail
  because mica-run's copy has no .git to read origin/main from, the same
  without this change. provider-mask's en 420 case timed out waiting for
  the Providers list (#5109, commented); alone it passes 140/140.
Found by measuring every element of #view-routing past its width at de
560px in Chromium: button#rtMask [458,590].
Not run: the whole GUI suite (other sessions' GUI runs on mote and mica),
the real Linux app.
2026-11-18 04:13:33 +08:00
yetone 223b900b48 library: a skill from GitHub or git syncs as its source, and what a sync leaves out is said (#5715)
JJasonsun (Discord #help, #5715): a skill over a sync's 64 MiB budget was
left out of the server's file while Settings > Sync said the sync worked,
so the other computer silently didn't have it.

A library skill from GitHub or another git repository whose folder is
still what was fetched (editState known and unedited, or Pending) now
goes as its source, as a plugin does (plugin_carry.go): CarriedSkill
gets Fetch, Hash and Commit, and the receiving computer fetches it
itself after Put lets go of the library lock (fetchSkills, through
updateSkills). Its files still go as far as the room the skills carried
as files leave, so a magpie from before this, which ignores Fetch,
writes the skill as it did.

On the receiving side (fromSourceHere): same version is kept; one
changed here is kept and, when the other computer has another version,
said as a problem ("Update replaces them"); another version or a skill
new here is fetched, unless the carried files are already the whole of
it. A skill that can't be fetched stays Pending, shows "Not fetched
yet" on its Library row, and is said as a problem until Update fetches
it (library.Unsettled drops a settled one).

A skill changed here, one from a folder, and one from a link holding a
token (whose link must not be synced) go as their files, as before.

What a sync still leaves out is said: state.LibraryLeft names skills
and plugins whose files were too big (or that this computer never got,
Skill.Missing, carried on as Left so a third computer isn't told it
has them), state.LibraryProblems what the last sync bringing the
library in couldn't put here. Status gives them as libraryLeft and
libraryProblems, and Settings > Sync shows them in red under the
status (askPreviewRows). Strings in every language.

Run at this head (rebased on origin/main 7b552eef3):
- gofmt -l: clean. go vet darwin, GOOS=linux, GOOS=windows: ok.
- mica: go test -count=1 -timeout 45m ./internal/library
  ./internal/davsync ./internal/backup ./internal/gui: ok.
- mote: node --test in Chromium and WebKit of sync-*, i18n-*, gui-zh-tw,
  gui-ja, gui-de, skill-*, library-items, library-all, library-plugins
  and the new sync-library-left (16/16 in both engines). Red, and red
  the same in a fresh origin/main 7b552eef3 worktree, each filed:
  skill-fold-all (#6667), skill-manual (#6668), skill-group-shared
  (#6687), skill-where's zh 900px under concurrency (#5859).
- The first package run at this head had TestSkillCarriedBySource and
  ...NotFetched red: InstallSkills took another test's cached probe of
  owner/repo (SKILL.md only). carrySource now forgets the probes before
  and after; ./internal/library ok again, once more with -shuffle=on.

Broken by hand, each red: bySource always false (5 library tests),
fetchSkills removed (library + davsync), changedHere removed, Missing
not carried on, Unsettled removed, Pending not set in Put, signedIn
check removed from Collect and from Put (TestSkillSignedInLinkGoesAsFiles),
leftOut returning nil, Fetch not excluded from leftOut.

Not tried: a real sync between two computers with a real >64 MiB skill
from GitHub; the tests use a local git repository as the source. A
restore (backup.Restore through the restore and plan paths) carries
skills by source too but doesn't record LibraryLeft/LibraryProblems
yet (said in sync-backup.md).
2026-11-18 03:05:47 +08:00
yetone b1f044fc1e library: a Claude plugin goes to another computer whole, its hooks naming that computer's folder (#6685)
A plugin installed from Library > Claude plugins didn't reach the other
computer by sync: the bundle carried its parts as plain items, with
${CLAUDE_PLUGIN_ROOT} already resolved to the first computer's
<library>/plugins/<name>, and neither the plugin record nor its folder.
Hooks there pointed at a path that doesn't exist, Windows' too.

Now Bundle.Plugins carries each plugin's record (name, version, source,
pick, agents, Off, parts taken out by hand) and never its parts:
- A GitHub or git link goes as its source. The receiving computer
  installs it from there, as UpdatePlugin does, after the library's lock
  is let go. Re-installing from the source was chosen because the files
  stay the vendor's and an update keeps working there; a fetch that
  fails keeps the plugin Pending (shown on its row, "Update tries again")
  with a problem, and the next sync or Update tries again.
- A plugin from a local folder, or from a link holding a token (whose
  link must not be synced), goes with its files on the skills' budget,
  executables kept executable, and is installed from them.
- Either way the parts are read again there, so every hook, server and
  skill names that computer's own plugin folder. A plugin the bundle no
  longer has is removed with its folder; Off spreads.
- A bundle from an older magpie has no plugins list: this computer's
  plugins keep their parts over the same-named items it carries.
- An empty list hashes as before, so computers without plugins don't
  see a change; the preview names each plugin, its files as one digest.
- Sibling: a plugin installed from a marketplace under a name other
  than its manifest's named the manifest's folder in its parts.
- The sync settings' text says Claude plugins go with the Library (en,
  zh, zh-TW, ja, de); "Claude plugins" moved into the core i18n.js since
  the core now says it.

Run at this head (54e682dc5's tree on f1b0663f1, mote):
- go test -tags nogui -timeout 45m ./internal/library ./internal/davsync
  ./internal/backup: ok
- gofmt -l: empty; go vet GOOS=darwin (library, davsync, backup, gui),
  GOOS=linux -tags nogui ./..., GOOS=windows ./...: clean
- Windows (win-run, xiaomi-gpu): go test ./internal/library -run
  TestPlugin and ./internal/davsync -run Plugin: ok. The hook there names
  B's C:\...\plugins\kit/bin/done (TestSyncLibraryPlugins first failed
  on Windows for the test's own path form; fixed in the test).
- GUI, Chromium and WebKit, every language the files test:
  library-plugins, library-items, agent-plugin-agents, i18n-keys,
  i18n-en-no-cjk, old-webkit, every sync-*, github-sync, s3-sync,
  auto-backup: 337 pass, 1 fail: webkit en "S3 sync settings", red the
  same at origin/main f1b0663f1 (#2448, #3413, open).

Broken by hand, each red, then restored:
- parts not skipped and Plugins not set in Collect:
  TestPluginCarriedWhole, TestPluginCarriedBySource,
  TestSyncLibraryPlugins
- held.without dropped: TestPluginOldBundleKeepsPlugins
- fetchPlugins dropped: TestPluginCarriedBySource
- marketplace name fix reverted: TestPluginMarketplaceNameIsItsFolder
- empty list not hashed as none: TestNoPluginsHashAsBefore
- TestPluginFromFilesEitherOS guards that a Mac path is files on
  Windows and C:\ on a Mac; it passed without a new check (such paths
  are no git source), so none was added.

Not tried:
- a real two-computer sync through the GUI, Mac to Windows;
- a local marketplace entry's own fields (strict: false) aren't carried,
  so there it is read from its files alone;
- a private git source over ssh on the receiving computer.

Reported by JJasonsun on Discord; issue by JJasonSun (#6685).
2026-11-18 00:24:41 +08:00
yetone ae94571d70 library: a project's own instructions, in the file each agent reads
@VictorHong1022 on X asked to manage AGENTS.md per project beside a
project's skills, so the shared instructions keep only general rules.

A project in the Library now has instructions of its own (the
Instructions tab, expand a project; `magpie library project
instructions <dir>`). magpie writes them into the project file each
picked agent reads there, by that agent's own name for it: Claude Code
CLAUDE.md (or .claude/CLAUDE.md when that is the one there), Codex and
pi their override first, Gemini GEMINI.md (or its context.fileName),
Qwen QWEN.md, CodeBuddy CODEBUDDY.md, the rest AGENTS.md. magpie owns
only a marked part (<!-- magpie:begin … --> to <!-- magpie:end -->):
the user's own text around it is kept byte for byte, CRLF included, a
hand edit of magpie's part stays until the project's text changes, a
file magpie made is listed in the repo's .git/info/exclude and removed
when emptied, and an agent's user-wide instructions file is refused.
Worktrees of the project follow it. A first text goes to the agents
the shared instructions are on for, else every agent here that reads a
project file. Problems show as the project's "instructions" problem.

Tested:
- internal/library: 8 new tests (block kept around user text, CRLF,
  hand edit kept, made file excluded and removed, renamed files,
  global file refused, worktrees). Four broken by hand, each red.
- internal/cli: TestLibraryProjectInstructionsCmd; red with the
  default agents dropped.
- GUI: project-instructions.test.cjs, en and zh, chromium and webkit,
  6 of 6. Red when Goose (no project file) was offered, and red when
  the defaults ignored the agents the instructions are on for.
- Real use on mote: the built binary, sandbox HOME and project. add,
  text, agents; CLAUDE.md kept CRLF with the part appended; AGENTS.md
  and GEMINI.md made and excluded; the user-wide CLAUDE.md untouched;
  zed refused; an edited part survived `library sync`; `agents none`
  put CLAUDE.md back byte for byte, removed the made files and
  emptied the exclude block.
- Full Go suite (go test ./... -timeout 45m) on mote: 103 packages ok,
  gofmt clean, go vet darwin, linux (nogui) and windows rc=0, at this
  change on origin/main 873b1f7d5.
- At dbb7230ae (rebased on d4af0ca4f), on mote: gofmt clean; go vet
  darwin, linux (nogui) and windows rc=0; go test internal/library,
  internal/cli, internal/gui and internal/testenv ok; node --test
  site/*.test.mjs 133 of 133. Not the whole Go suite again: of the
  commits that came in, only backup_cmd.go and main.go in internal/cli
  touch a package this change does, and its tests pass.
- The 89 Library GUI files (library-*, lib-*, project-*, skill-proj*,
  i18n-keys) at dbb7230ae on mote, both engines: 1868 of 1876. Red:
  library-open-again's 6 at 1100px, red alone at origin/main 28f27e07b
  too (#6751); library-new-skill's chromium en 420 timed out waiting for
  "taken" under the parallel run and passed alone at this head.
- Rebased again on 28f27e07b (three commits, one internal/cli test):
  go test internal/cli and internal/library ok on mote, and
  docs-index.mjs leaves the generated site files unchanged.
- Site: node docs-index.mjs regenerated llms-full, search and
  docs-index.sums at the rebased head; node --test site/*.test.mjs
  133 of 133.
- Full GUI suite (make test-ui, both engines) on mote at 873b1f7d5's
  rebase, beside other sessions' runs at load up to ~100: 28532 tests,
  1156 red in 133 files, none of them project-instructions. 115 files
  are #6975's, red at origin/main. Run alone at this change and at
  origin/main 8e1534f5f, the other 18 give the same result at both:
  16 green, name-suffix-remote red (#5147), library-env red. Recorded
  on #6975.

Not tried: a real Cursor, Copilot or Gemini session reading the files;
the library tests on Windows or Linux (cross vet only). Cursor and
Copilot read both CLAUDE.md and AGENTS.md, so picking Claude Code and
them together can show them the text twice.
2026-11-17 23:37:54 +08:00
yetone 5bfa57e3d3 usage: check one model on one provider with a few fixed-answer calls, kept beside the other providers
skingstyle48487 on X runs more than ten relays and asked for something
like the "pelican test" to spot one that waters a model down. In a
follow-up (2122694296054972815) they said speed, failures and the model's
name show whether a relay is fast and stable, not whether the model got
weaker. They asked for small tests with known answers, the share of right
answers and of right tool calls, and relays compared side by side.

On Usage › Requests › Model speed › Providers, each row has a Check… that
opens a dialog. Opening it sends nothing; only its Check makes the calls.
POST /api/relay-check (gateway.CheckRelay) makes 6 small streamed Chat
Completions calls through the gateway, pinned to provider/model as an
agent would, three at a time:
- write 1 to 40;
- 1234 × 5678, 987 × 654 and 2468 × 1357;
- weather in Paris and time in Tokyo, each call offering both tools,
  so the right one has to be picked.

Each part says what it found, never a verdict on the provider:
- whether the answer was the expected one, and what came back;
- the model the reply named, when the ledger would call it another
  model (usage.Swapped, not SameSpelled or ListedAs);
- the provider that answered, when the call was handed on;
- how many input tokens the 118-character prompt was counted as;
- first token, tok/s and the whole time.

The dialog heads the parts with "Answers right: n of m" and "Right tool
calls: n of m". The numbers come from the gateway's own usage records (a
tap in appendUsage keyed on the request's context), not from each
protocol's reply. The tally of each provider's last check is kept in the
window's storage. The Providers table then shows Answers and Tool calls
columns: sortable, amber when short of all, a dash for providers not
checked, so relays are compared side by side. The dialog code is a
lazily loaded root script (relaycheck.js), as app.js has no room left.

Run, at this head:
- mote: go test -timeout 45m ./internal/gateway ./internal/gui
  ./internal/cli ./internal/usage: ok (the full ./... suite passed at
  41d88731c, before the fixed-answer calls; mote and mica were each
  running another session's GUI suite at this head);
- gofmt -l, GOOS=linux go vet -tags nogui ./... and GOOS=windows go
  vet ./...: clean;
- go test -run 'CheckRelay|ReadChatStream' -v ./internal/gateway
  (5 tests pass);
- usage-model-speed.test.cjs, chromium and webkit, en, zh, zh-TW, ja and
  de at 400px: 12/12;
- i18n-keys and old-webkit: their only reds are the three on origin/main,
  each filed (#6877 ", with an image", #5919 :has(), #6030
  headerpresets.js);
- TestCoreScriptBudget and the app.js budget: ok, not raised.
Broken by hand:
- taking tapUsage out of appendUsage turns TestCheckRelayAnsweredAsAsked
  and TestCheckRelaySaysWhatDiffers red;
- dropping the tool-name check turns TestCheckRelayCountsEachAnswer red
  (get_weather for Tokyo read as right);
- pressing Check as the dialog opens turns the GUI test red ("opening the
  dialog sends no call").
Not tried:
- the whole GUI suite at this head (both machines busy with another
  session's suite);
- a real relay (fakes only);
- a context-window probe;
- a comparison with the vendor's own count_tokens;
- a periodic check (the check runs only on a press).
2026-11-17 23:13:03 +08:00
yetoneandmdwsk88 fe41216b01 claude-desktop: Claude Code's WebSearch runs on the model picked for haiku (#6348)
In Claude Desktop's gateway mode, Claude Code's WebSearch call always went
to the session's model (Opus here, 11-19s a search). Claude Code 2.1.321
sends it to its small (haiku-tier) model only when the remote flag
tengu_plum_vx3 is on, and Desktop sets DISABLE_GROWTHBOOK=1 in gateway
mode, so the flag falls back to off. WebFetch's page summaries already run
on the haiku pick (#5534); WebSearch now does too.

- desktopSearchCall knows the call by its shape only: tools is exactly one
  web_search_* server tool named web_search, and tool_choice is
  {"type":"tool","name":"web_search"}. The prompt is never read.
- desktopMoveTo, for a request Claude Code sent in Desktop, puts it on
  DesktopTiers()["haiku"] when that pick is set, served and not already
  the model asked, recorded as desktop-search. It doesn't change the
  session's recorded model (desktopPicked).
- A subagent's search taken by the haiku pick is Claude Code's helper,
  not the subagent's turn: Desktop's subagent model, effort and turn tag
  leave it (desktopSearchHelper; subagentTurnOf takes the agent, so
  terminal Claude Code is unchanged).
- No haiku pick, or one magpie doesn't serve: nothing changes.
- The Routing page says why (desktop-search, en/zh/zh-TW/ja/de), and
  gateway-routing.md has the rule.

Ported from mdwsk88's f68197aa6 (mdwsk88/magpie
desktop-websearch-haiku-tier), reviewed line by line. Changed in the port:
the gateway-routing.md conflict was merged onto main's text (main's
codex-suggestions kept), and the cheap pre-check is bodyHas on
`"tool_choice"` and `web_search_` instead of bytes.Contains, since
desktop.go no longer imports bytes on main (the patch didn't compile
there) and every Desktop request from Claude Code takes this check.
web_search_* is kept as a prefix, so a newer search tool version
(web_search_20260209) is matched as the same call.

Run on mote (go1.26.8). Whole packages last at base 659e8850a (also
fefe3f658, 05d46f42e, 4a1ac8442 before; all ok):
- go test -count=1 -timeout 45m ./internal/gateway/ ./internal/gui/: ok
  (gateway 949s, gui 218s at 659e8850a).
- After rebasing on 50c5a52db (backup, touches internal/gui):
  go test ./internal/gui/ ok, and the focused gateway run below ok.
- Focused -run '^(TestDesktop|TestClaudeDesktop|TestSubagentTurn)': ok.
- Broken by hand, each red: the search rule removed (old routing) ->
  TestDesktopWebSearchHaiku, ...KeepsSessionPick, ...Route fail; the
  Claude Code guard removed -> TestDesktopWebSearchScope fails; the
  subagent helper exemption removed -> TestDesktopSubagentWebSearchIsHelper
  and TestDesktopWebSearchRoute fail.
- node --test routing-moved-why, i18n-keys, i18n-en-no-cjk (chromium and
  webkit): 37/38; the one red is i18n-keys "a plugin's words are its
  own" on ", with an image", red on origin/main and filed as #6877.
- gofmt -l: clean. GOOS=linux go vet (-tags nogui and without) and
  GOOS=windows go vet on ./internal/gateway ./internal/gui: ok.

Not tried: a real Claude Desktop session's WebSearch; the reporter's
routing log will show it landing on the haiku pick.

Co-authored-by: mdwsk88 <11055210+mdwsk88@users.noreply.github.com>
2026-11-17 22:56:55 +08:00
yetone efcf8d9c0c routing: a key's row is named by its provider, the key after it (iamleehom on X)
iamleehom on X: "为什么路由中不显示供应商名称了?" Two OpenAI-compatible
providers, each with unnamed keys, showed only "sk-4…ab10" and
"sk-a…eb0c" on the Routing stage, with nothing saying which provider
each belongs to.

Cause: 83545a5d8's twin rule added the provider's name only when two
providers' keys had the same name. A masked key always differs from
every other one, so the rule never fired for unnamed keys, and a named
key unique across providers lost its provider too.

Change (plugins/routing/client.js, routing.css):
- A key's stage row is headed by a new span.prov with its provider's
  name. The key's name follows in span.who, muted, and gives up room
  first (flex-shrink stays on .who). .who keeps the key's name, so every
  test and lookup that finds a row by it is unchanged.
- The twin rule's sub-line is no longer needed for key rows; the plan
  name stays there.
- The answered card says "Provider · key" (where()).
- Rows inside a provider's fold are unchanged: the fold heading already
  names the provider once.

Not changed, filed: the request list rows and the decision lines still
name an unnamed key by its masked key alone (#6982).

Tests:
- routing-key-provider.test.cjs (new): the reporter's case, two
  providers with unnamed keys. Rows read [Relay East, sk-4…ab10] and
  [Relay West, sk-a…eb0c], the provider's name is not cut at 1100px,
  the card reads "Relay East · sk-4…ab10" from a live long-poll, and a
  fold's rows keep only the key under a heading naming the provider.
  Every language, both engines, 1100px and 440px.
- routing-twin-keys.test.cjs: re-derived to [prov, who, sub].

Run:
- Broken by hand: routing-key-provider at base 3f4372cc9's client.js on
  Windows, chromium: every non-fold subtest red (null .prov; the card
  read "sk-4…ab10"). On mica at the first design: 42 red, 20 (folds)
  green.
- Screenshots (zh 1100px chromium, en 440px webkit, de 440px chromium)
  checked by eye: "Relay East sk-4…ab10" on each row, nothing overlaps.
- Windows (xiaomi-gpu, win-run, Node 22, Playwright 1.62.0, Chromium +
  WebKit), at 90aa5bc23 (this change on 3f4372cc9): the 324 GUI files
  the change can reach (every routing-*, i18n-keys, and every file that
  opens view=routing or uses .rt- or plugins/routing): 5911 tests, 5737
  pass, 173 fail, 1 cancelled, ~59 min, beside another session's Go
  builds. The 39 red files run again side by side at base 3f4372cc9 and
  at the change (concurrency 4): 155 vs 161 fail of 774. The ones red
  on only one side are on both sides (WebKit timing, Usage,
  rest-try-now, Codex subagent); none reads a key row except
  routing-many-keys, which alone 3 times is red 1 of 3 at base (#5543)
  and green 3 of 3 with the change.
- After rebasing on origin/main 8e1534f5f, on Windows: routing-key-
  provider, routing-twin-keys, group-member-line, group-member-free,
  i18n-keys, routing-answered-still, routing-agents-apart,
  routing-keys-fold, routing-many-keys, routing-model-chip-whole: 296
  tests, 292 pass, 4 fail. Each red is red the same at origin/main
  3126b0bac on the same box: i18n-keys "a plugin's words are its own"
  (#6877), routing-many-keys chromium en (#5543), and
  routing-model-chip-whole en 1600px live in both engines (#6981, filed
  now).
- mica: go test ./internal/gui/ -run 'Budget|Compress|Revalidate|Plugin'
  ok.

Not run: the whole GUI suite at the pushed head (mote and mica were
busy, and the earlier whole-suite run on Windows was stopped because
its tree was stale); the real app; the reporter's own providers.

Reported-by: iamleehom (X)
2026-11-17 21:15:47 +08:00
yetone 3be322fe4c library: a skill brought in from an agent goes back to it when removed (BeiWeiji on X)
BeiWeiji on X (v0.1.4322, zh): a skill imported from "Agent 中已有"
had no way back, only off or Remove, and removed it was gone from the
agents and from "Agent 中已有" too: Remove sent the folder that had been
moved into the library to magpie's backups and took the agents' links
and marked copies away.

ImportSkill now records where the skill was (Skill.Home, this
computer's own; Put keeps it for the same source, a sync never carries
it): the folder moved in (Home.Dir; handOver points it at the shared
~/.agents/skills place) and each agent's entry, a link with its own
text or a byte copy. RemoveSkill/RemoveSkills put it back (putBack):
the library's folder moves back to Home.Dir with what was changed in
the library, or the library's link goes; each agent's link is made
again as it was and each copy copied back. It is in "In your agents"
again and nothing goes to the backups. An entry the user replaced since
is left alone; when Home.Dir is taken the skill is removed as before,
its folder to the backups. This covers every agent with a skills folder
(the record is per agent entry, links and copies alike).

The page: SkillView.back lists those agents, and such a row has Put
back in the trash's place ("放回 {agents}"), whose sheet says where it
goes and sends skills/remove. Other skills keep the trash.

Old imports: a skill brought in before this has no Home record.
Removed, its folder goes to magpie's backups as before, where it can
be moved back by hand (the reporter's already-removed skill is there).

Run (at this change on acc358f07, then rebased on a75a1fffc and on
d67ccbd3c; the commits between touch no library code):
- go test -tags nogui ./internal/library ./internal/gui on mote at
  this head (d67ccbd3c base): ok; go build ./...: ok.
- Full go test -timeout 45m ./... on mica at the acc358f07 base: exit 0,
  every package ok. Not run again after the rebases.
- GOOS=windows go vet and GOOS=linux go vet -tags nogui: ok (whole tree
  at acc358f07; internal/library and internal/gui at this head).
- gofmt -l internal/: clean.
- GUI: skill-put-back.test.cjs (new) in chromium and webkit, en, zh,
  zh-TW, ja, de at 980px and 400px: ok; remove-found-skill ok;
  i18n-keys: only #6877 (", with an image"), red the same at a fresh
  origin/main copy.
- Whole GUI suite (make test-ui) on mica at the acc358f07 base, beside
  another session's suite (load to 200): 28548 tests, 1060 red in 128
  files. Each red file was run at a fresh origin/main a75a1fffc copy:
  118 files (1039 tests) red there too, filed as #6975 (108 already in
  #6934, the rest with their own issues). The other 10 (editor-advanced-
  align, group-new-head, ledger-swipe, library-problems-hide,
  nav-sub-fold, routing-pulse-composited, search-mcp-library,
  signin-closes-sheet, readable-focus, library-env) pass at this change
  run alone on mote, 150 of 150.
Broken by hand: canPutBack forced false; TestRemoveSkills,
TestRemovedImportGoesBackToTheAgents and TestRemovedLinkedImportGoesBack
went red (TestPutBackLeavesTheUsersNewFolder guards the fallback and
passes either way).
Not tried: a real magpie with real agents (tests run in a sandbox
HOME); Windows junctions and WSL-distro links (a WSL distro agent's own
entry is recorded like any other but not tried there); the link tests are skipped on Windows.
2026-11-17 20:48:59 +08:00
yetone f1a4de736e routing: a group's card says each member as one piece, parted by the list's comma (tmr11235 on X)
tmr11235 on X (v0.1.4334): a found group's card read "Kimi Code · K3.1
Pro · OpenCode Go · Kimi K3.1 Pro (关闭) · Devin · Kimi K3.1 Pro". The
same " · " parted a member's provider from its model and one member
from the next, so nobody could tell where a member ended.

Now each member is one span: its provider in the line's muted colour,
then its model in --fg-2 (both colours the page has), then what is said
after it (account, fast, free, off). Members are parted by the list's
own comma, t(", ") (、 in zh, zh-TW and ja), or " → " in order, never
" · ". Narrow (body.web), a member moves to the next line whole; before,
"(off)" could sit on a line of its own.

Siblings: memberLabel, the one text form, is built from the same parts
(memberParts). The group-picking card (the row drawn while selecting
groups to remove) uses the same memberLine. A nested group's tooltip in
the editor joined with " · " too and now uses memberJoin. The rule
tooltip already joins with ", ". The CLI and TUI list member ids
(provider/model), where "/" already parts provider from model; left as
they are. No new string, no new colour.

group-member-free.test.cjs read the members by splitting on " · ";
it now reads each .mbr.

Red on the old client.js: group-member-line.test.cjs (AssertionErrors:
the members are one text node parted by " · "). Red without the
body.web .mbr rule: WebKit at 420px, "(off)" alone on a line.

Run at f8787be1f, these two commits on origin/main f9492fd8e (rebased onto origin/main f9492fd8e,
whose found-group window change, mergeName/windowless, this is merged
with: the unprefixed id is looked up first, then put through mergeName;
MergeName takes the provider, and group_window_test calls it so):
- mote: gofmt -l clean; go test -timeout 45m for root, internal/cli,
  internal/gui, internal/provider, internal/catalog, internal/tui,
  internal/agent: all ok; go vet ./..., GOOS=linux go vet -tags nogui
  ./..., GOOS=windows go vet ./...: ok.
- Full Go suite (go test -timeout 45m ./..., log tee'd) in WSL
  magpie-desktop at 074614077, an earlier base of the same two commits:
  99 packages ok, gateway included. Red: root, internal/cli and
  internal/gui don't build there (no gtk4/webkitgtk-6.0 dev packages;
  they pass on mote above), and internal/usage
  TestRequestStateKeptAcrossACatalogFetchedAgain, red on origin/main
  7c3e68908 too, #6572.
- GUI: group-member-line, group-member-free and the other group-* files
  (10 files) on mote, Chromium and WebKit: 152 pass. The whole suite
  (make test-ui, concurrency 3) in WSL ran about 2,560 tests (files a*
  to codex-*) before it was stopped; 26 files went red, none of them a
  routing page. 23 are red on origin/main f9492fd8e too; 3 pass in a
  run of their own at f8787be1f. All filed in #6973.
- Rebased since onto Gemini, agent, usage and gateway commits that
  don't touch these files; internal/provider and internal/catalog ok
  again on mote, and GOOS=windows vet, at 381076a1f (on b1d5912de).
2026-11-17 20:21:21 +08:00
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