Commit Graph
3779 Commits
Author SHA1 Message Date
yetone 992f88d634 usage: a stand-in reading says why the read behind it failed
@tmr11235 on X (tweet 2123334817991520577, magpie v0.1.4520): agy-cli's
card showed "截至 2026/11/15 14:19:19,暂时无法获取最新额度" days later,
with nothing to say why. keepLast stands the last good reading in for a
read that fails with a passing error (timeout, 429, 5xx, network) and
dropped that error, so a stand-in that lasted four days read the same as
one a minute old. The reading now carries the error as readError
(SubscriptionQuota, and Quota for `magpie quota --json` and the gateway
report), and asOfText puts it after the date: "… 暂时无法获取最新额度 ·
agy usage query timed out." A deferred read (not asked) has none, and
the short "As of" line on cards stays short. Every provider's stand-in
gets it, not only agy-cli's.

Run (mote, at origin/main 9bf5848c1 + this commit; again after rebasing
onto c01988e43: vet, the provider/gui quota and budget tests, usage-card-refresh
and i18n-keys, 50 pass):
- gofmt -l clean. go test -count=1 -timeout 45m on internal/provider,
  gui, cli, tui, usage, agent: ok. internal/gateway: one red,
  TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes, filed as #7117 on
  origin/main before this (an OpenCode env-block test, not quotas); the
  doneHold fake's "close of closed channel" log is #6690/#6505.
- GUI: usage-card-refresh, account-every-reset, balance-parts,
  claude-usage-asked, panel-quota-refresh, i18n-keys: 94 pass, 0 fail
  (chromium + webkit, every language).
- GOOS=linux/windows go vet ./internal/provider/ (after rebase).
- Broken by hand: without the keepLast line, TestQuotaDeferredReadIsNotFailure
  fails (readError = "", want "connection refused"); without the
  asOfText change, usage-card-refresh fails ("a failed read hid why").

Not tried: the reporter's own failing read (which error it is); a real
GUI with a stand-in card (the fixture page only).
2026-11-19 17:38:05 +08:00
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 975799a069 gui: Settings' search finds what the words are about (canlee886 on X)
canlee886 (X, 2123329450502938656) searched Settings for "可访问性",
"监控" and "自动选择模型" and each said no setting matched: "缺少搜索时
的智能联想". The search only found settings whose text had every word.

What it does now, all in finder.js, in the page, nothing sent anywhere:
- A table of ~30 concepts, each with the words a reader may type in
  en, zh, zh-TW, ja and de (accessibility, monitoring, picking a model
  by itself, theme, proxy, notifications, startup, privacy, LAN, cost,
  quota, hotkey, ...), leading to the English names of the settings it
  covers (a setting's English is its data-en in every language). Those
  settings are listed with the ones that have the words themselves,
  for rows, built-ins and other pages' places alike.
- When nothing has the words: a long run of Chinese or Japanese is read
  by its two-character words ("文字大小调整" finds Text size), and a
  Latin word over 3 letters may be one edit off ("currancy").
- When no setting has the words themselves but some are related, the
  line over the parts says "Settings related to “…”" (start-aligned,
  in every language) instead of "No setting matches".
- The finders count first (setFeatsFind/elseFind take a dry flag), so
  a search renders once and the view's MutationObserver doesn't loop.

Not done, on purpose: pinyin (a large table, and readers type Chinese
through an IME), a recent-searches list and "did you mean" chips (a
layout that jumps on focus; the owner has said no to UI churn).

Run (WSL magpie-desktop: mote's load was 26 to 34 on 18 cores, mica's
disk is full):
- settings-search-related.test.cjs (new), Chromium and WebKit, en, zh,
  zh-TW, ja, de at 560x420, plus magpie web at 390x760: 16 of 16.
  Against origin/main 9bf5848c1's assets (SEARCH_ASSETS): 0 of 16, "無
  障礙"/"accessibility"/"barrierefreiheit" show no Text size.
- 37 nearby GUI files (settings-*, search-*, find-*, i18n*, menu-scroll,
  click-scroll, builtins): 636 pass, 34 fail. The six files with reds,
  run again at origin/main 9bf5848c1 and at the change: builtins,
  click-scroll, menu-scroll and settings-update-source are red the same
  at both (#4120, #4471, #1550); search-key-list/search-keys time out
  on one subtest a run, a different one each time, at the change only,
  and touch no Settings search: filed as #7194.
- At the rebased head (239da9991): settings-search-related,
  settings-search, settings-search-reach, find-anywhere and i18n-keys,
  64 of 64; go test ./internal/gui (TestCoreScriptBudget and the rest)
  on Windows (xiaomi-gpu), since WSL has no gtk4: TestCoreScriptBudget and
  the i18n checks pass; 10 Windows reds, none in assets, all filed
  (#6068: TestLodyImportHandoff's %AppData%, TestUpdateThatWontStart,
  TestGatewayHeldByAContainer, ...; #7112 TestSetPortServes...).
- Broken by hand: the base-assets run above.

Not tried: the whole GUI suite (WSL and mote were busy with other
sessions' suites; mica has no disk), the real app (only Playwright's
engines, not WebKitGTK or WKWebView; no motion was added).
2026-11-19 17:21:45 +08:00
yetone 9bf5848c1f gateway: a Kubernetes rolling update runs two pods on one volume safely
@justforlxz on X asked for a RollingUpdate (maxSurge 1, maxUnavailable
0) with no request dropped. The docs said strategy: Recreate, because
the work only the serving magpie may do (renewing sign-ins, check-ins,
moves, plugin updates, WhileServing) was kept to one magpie only by the
gateway's port: a second couldn't bind it. Two pods each bind their own
network namespace, so in an overlap both did it, and two renewals of
one refresh token can spend it (a single-use token rotates).

Design: both pods answer requests at once (each refresh and file write
is already locked across processes: filelock, host.js lockRenew); the
serving work is held to whichever gateway holds gateway.serving.lock
(flock on the config folder, serving.go). The new pod retries every
second and takes the work over as the old pod's gateway ends (its drain
lets go first). A file system without locks is read as no other magpie,
as before.

Pods share the volume but not a pid namespace (both run magpie as pid
1), so the locks that judged a holder by its pid now judge it by host:
- host.js lockRenew records host (hostname + pid namespace); a lock of
  another host is stale by age only, never by "pid 1 is alive here".
- lockMoves (migrate.go) the same.
- gateway.json records Host; forgetListening removes only its own, so
  the old pod's end no longer removes the new pod's file (same pid,
  same Started second was enough before).
- temp and run-mark names get a random part (writeDurable, Claude run
  marks, gateway.json's temp file).

While draining (SIGTERM), every reply says Connection: close, on the
gateway and on magpie web's page port, so an agent that kept its
connection to the old pod alive dials the Service again for its next
request. Without it, the real rollout below had one broken pipe per
kept-alive connection, ~5.8s after each SIGTERM, when the drain's end
closed them.

Docs (en/zh/ja docker, reference.md): RollingUpdate maxSurge 1 /
maxUnavailable 0, the readiness probe, a required podAffinity on
kubernetes.io/hostname (a ReadWriteOnce volume mounts on one node), and
one Recreate update from a version before this one, whose old pod
doesn't take the lock.

Run:
- Real overlap, podman 4.9.3 in WSL magpie-desktop: three pods
  (pa -> pb -> pc) on one volume, each its own container (pid 1, own
  hostname and network), a Service proxy over a readiness-probed
  endpoint list (1s probe, endpoint removed 1s after SIGTERM as
  kube-proxy does), 12 agents streaming 3s SSE turns through it, half
  keeping connections alive, no retries. Before Connection: close: 226
  ok, 10 failed (broken pipe, kept-alive). After: 209 ok, 0 failed;
  second run 207 ok, 0 failed. Each new pod logged "another magpie serves", then
  "let go" as the old pod's gateway ended; gateway.json named the last
  pod.
- Broken by hand, each red then green: TestServingWorkWaitsForTheOther-
  Magpie, TestServingWaitEndsWithItsGateway, TestForgetListeningKeeps-
  AnotherPods, TestMoveLockOfAnotherPod, TestRenewLockOfAnotherPodIs-
  WaitedFor, TestDrainingRepliesCloseTheirConnection,
  TestPagePortClosesWhileDraining.
- Full suite, go test -count=1 -timeout 45m ./..., at 85305a82d (this
  change on 2926b7bef): macOS on mote, 102 packages ok; Linux
  (-tags nogui) in WSL magpie-desktop, 101 ok. Reds:
  - TestAuthLockWaitDoesNotFreezeTheHost, both: this change's
    writeDurable called randomUUID, which the test's sandbox of host.js
    doesn't give. It now names the temp file with Math.random; plugin
    then ok on mote and on Linux.
  - Not this change, filed: TestCappedIsSmall (Linux, #5975),
    TestRequestStateKeptAcrossACatalogFetchedAgain (Linux, #6572),
    TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes (macOS, #7117).
  - Not a red, filed: the macOS log has a recovered "http: panic
    serving ...: close of closed channel" in the doneHold test fake
    (continuation_test.go:781); no test failed on it. It is #6505
    (also filed as #6339 and #6690).
- go vet ./..., GOOS=linux -tags nogui and GOOS=windows go vet ./... ok
  on mote; go vet -tags nogui ./... ok on Linux; gofmt -l clean.
- At the pushed head (rebased on 6e5882109), on mote: go vet (macOS,
  GOOS=linux -tags nogui, GOOS=windows) of gateway, gui, plugin and
  provider ok; go test -count=1 of gui, plugin, provider ok, gateway
  ok but #7117's TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes;
  site node --test 135 pass, 0 fail.
- New tests on Windows (win-run): gateway, provider, plugin, gui ok.

Not tried: a real Kubernetes cluster and kube-proxy (the podman harness
stands in for both); a real OAuth plugin's renewal across two pods (the
plugin test uses a fake vendor); an RWX/NFS volume's locks. A stream
that began before SIGTERM and outlasts the drain's 20s still ends with
the old pod. Pods exit 2 on SIGTERM as pid 1 (before this change too).
2026-11-19 16:20:34 +08:00
yetone 72f7c1f41a agents: Nowledge Mem's own AI runs on magpie (xiaomaomiloulou on X)
Nowledge Mem asks for "选择一个 AI" on its first page and in Settings >
AI, and Mem 0.10 has a provider type of magpie's own. Picking a magpie
model for the new agent nowledge-mem now sets it up from magpie:

- Mem keeps its providers in remote_llm.json with each key encrypted, so
  the file is only read. Changes go through its backend (nmem-server,
  127.0.0.1:14242, $NMEM_API_URL when it names this computer), as its
  Settings and `nmem config provider` do: POST /remote-llm/config saves
  provider "magpie" at the gateway's /v1 with agentKey("nowledge-mem")
  and the model, which makes it active and turns the AI on.
- Mem puts temperature, max_tokens and timeout back to its defaults
  when a save leaves them out, so every save sends the provider's own.
- What Mem had is stashed once: the active provider, whether the AI was
  on, and a "magpie" provider the user made, which keeps its key and
  gets its model, base and parameters back. Stepping out activates the
  provider Mem had (unless one was picked in Mem since), removes
  magpie's provider and turns the AI off again if it was off.
- Mem has to run to change it (errMemDown); a sync moves the base only
  when the gateway's port moved. Detected by its config folder or the
  installed app (co.nowledge.mem.desktop). Icon from its icon.icns.

Run (mote):
- go test -count=1 -run 'NowledgeMem|TestEveryAgent|TestListOnly|TestSync|Desktop'
  ./internal/agent ./internal/library ./internal/agentenv ok; -run Icon
  ./internal/gui ok.
- GUI: icon-one-tone, icon-tile, routing-client-icons, i18n-keys in
  Chromium and WebKit, 58 of 59; the red is icon-tile's dim-color, red
  on origin/main since 2649d5d72 (#6759), not this icon.
- Real Nowledge Mem 0.10.121 (free tier) in a sandbox HOME on mote, its
  nmem-server on its own port behind a logging proxy, and a sandbox
  magpie (go build of this tree) with a fake OpenAI vendor:
  `magpie nowledge-mem fakeoa/fake-model` made magpie Mem's active
  provider at the sandbox gateway; Mem's own `nmem config provider test`
  answered "Connection OK — magpie/fakeoa/fake-model", the vendor got
  the request, and `magpie usage` counted it under Nowledge Mem.
  `magpie nowledge-mem default` put openai_compatible/u2 back as active,
  removed magpie's provider, and Mem's test passed on it again.
- That run found NMEM_API_URL dropped as "not an absolute path";
  NotPaths has it now (the AGY sibling is the commit before).

- On 681f2ee7f, then rebased onto 6af38c0ee (internal/gui providers
  only, none of these packages): gofmt -l clean; go vet, GOOS=linux
  and GOOS=windows go vet of ./internal/agent ./internal/agentenv
  ./internal/library ok; the tests above again ok.
- Not run: the full go test ./... suite. mote had another session's full
  suite running and mica's disk is full (323 MB free); it runs on mote
  once that one ends, and a red gets its own issue and fix.

Broken by hand: without the check that magpie's provider is still the
active one, TestNowledgeMemKeepsALaterPick is red; without re-sending
temperature, or sending a key over the user's own magpie provider,
TestNowledgeMemKeepsTheUsersMagpie is red; with NMEM_API_URL out of
NotPaths, TestNowledgeMemOnlyOnThisComputer is red.

Not tried: Mem's window itself (the run used its API and CLI), magpie's
GUI connect row clicked, Windows and Linux (config folder per OS is
from Mem's source, not a real install), a paid Mem plan.
2026-11-19 15:44:48 +08:00
yetone 6af38c0eeb providers: a resting key's row says what its vendor answered (@YsiCing on X)
@YsiCing on X ("用 oai api 经常遇到额度不足情况,实际账号额度还是有很多的")
showed one API key's row in the provider editor (sk-s…igYA, any
protocol, all models): "暂停使用 · 400 余额不足 · 13:37 恢复 · 立即重试",
posted at 13:12, so a first-rung creditRest of 30 minutes. Nothing on
the row said what the vendor answered, and the screenshot names no
provider, agent or error text.

Cause of the missing words: 82b45888a gave every Rest the vendor's words
(Rest.Error), and 63dc359fb showed them on a subscription account's row
(accountRests passes Error and By), but the key rows of an API-key
provider are filled in providerJSON from gateway.RestOf with
Why/Status/Until/Key/Probed/Rate only, so restLineOf's .key-rest-said
was never drawn for a key. A key's row now carries Error and By as an
account's does.

Not changed, and why: failure() reads a 400 as out of credit when its
words match creditWords (balance, credit, billing, payment, 余额, 充值 …),
which is right for Anthropic's 400 "credit balance is too low",
DashScope's 400 Arrearage and SuperMagic's 400 积分不足 (#4095). The
screenshot has no vendor words, so which 400 this relay sent, and
whether creditWords read it wrongly, is unknown; changing the
classifier on a guess would break those. It is not a rate limit called
out of credit: a 429 shows as 429, and OpenAI's 429 rate_limit_exceeded
(minuteRate) and insufficient_quota (credit) are already told apart.
With the words now on the row, the reporter's next refusal says what
the vendor answered.

Tests:
- TestKeyRestSaysVendorWords (new, internal/gui): a fake upstream
  answers both keys of an API-key provider 400 with an OpenAI-shaped
  credit error through a real gateway.New() (both keys are asked); the
  key it rests carries the words in /api/providers' KeyList. The last
  key left isn't rested on a 400 (quotaStatus is 429/402 only,
  ff930886a), so the test asks for at least one. Red on origin/main's
  providers.go (Error ""), green after.
- TestKeysImportAndRest: its stubbed key rest carries Error and By, and
  checks they reach the row. Red on the old providers.go.
- key-import.test.cjs: a new case, "a resting key says what its vendor
  answered", draws .key-rest-said with the words on the resting key
  only. A case of its own: the taller row moved "Paste several" into
  #6416's scroll red.

Run on WSL magpie-desktop, at origin/main 7f11dfc77 plus this change and
again after the rebase onto 344253c4e (vet, internal/gui ok in 83.7s,
key-import the same 12/16 and 6/8)
(wsl-run; mote was at load 24-31 with two full suites, and mica's disk
had 157MB free, so its full run failed to build: no space left):
- gofmt -l internal/gui: clean. go vet -tags nogui ./internal/gui and
  GOOS=windows go vet ./internal/gui: ok.
- go test -tags nogui -count=1 ./internal/gui: ok (117.6s).
- go test -tags nogui -count=1 ./internal/gateway ./internal/provider:
  ok (982s, 117s), at the same base before the test-only edits.
- key-import.test.cjs, Chromium and WebKit, en and zh: 12/16 and 6/8
  pass; the new case passes in all four. The reds are "Paste several
  takes many keys at once" in every engine and language, red the same
  with this commit's fixture left out. That is #6416 (now seen in
  WebKit and on Linux too; noted there).
- Red by hand: origin/main's providers.go with these tests,
  TestKeyRestSaysVendorWords and TestKeysImportAndRest fail (Error "",
  By "").
Not run: the full go test ./... (no machine had room) and the whole GUI
suite (the change is in providers.go's JSON; app.js is unchanged). Not
tried with the reporter's relay, whose 400 text the screenshot doesn't
show.
2026-11-19 15:39:48 +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 ef997d186c serve: a SIGTERM finishes the requests in flight, for Kubernetes rolling updates
@justforlxz on X runs magpie in Kubernetes and every update cut the
requests in flight. A SIGTERM ended the gateway like Ctrl+C: the
listener closed at once and Shutdown cut what was left after 2s, an
agent's stream included, with no unready phase for the Service to see.

Now a SIGTERM to `magpie serve`, `magpie web` or `serve --web`:
- GET / answers 503 {"draining":true} at once, so `magpie healthcheck`
  (the image's HEALTHCHECK, and the readiness probe the docs give) fails
  and the pod leaves its Service's endpoints;
- in a pod (KUBERNETES_SERVICE_HOST) it keeps accepting for 5s while
  that reaches kube-proxy and the ingress, then stops accepting;
- the requests in flight, streams included, get up to MAGPIE_DRAIN to
  finish: unset, 20s in a pod (k8s' default grace is 30s, with room to
  save after) and 7s elsewhere (docker stop and Compose kill at 10s,
  and a drain past that would lose the state saved at the end);
  seconds or a Go duration; 0 ends after 2s as before; an unreadable
  value logs and uses the default. magpie web's page port (which
  serves /v1 too) shuts down within the same grace.
Ctrl+C and SIGHUP end as before. Nothing to configure.

A request still answering at the end of any drain was logged as "cut"
but kept running, its upstream call too, until the process exited:
Shutdown doesn't close active connections. The gateway now closes them
after a failed Shutdown, so a gateway restarted in-process (the GUI's
restart, a test) leaves nothing holding the provider catalog
(holdCatalog). TestDrainEndsAtItsGrace's cut request, still in flight
after it returned, made the next test, TestGrokGetsAgentMessageAsUser,
read migrations.json through that hold and fail in a full gateway run
on WSL; the test now waits for it to end, and without the Close that
wait fails at 30s.

PID 1: the image's ENTRYPOINT is exec form, so magpie is PID 1 and gets
the SIGTERM itself (it calls signal.Notify). As PID 1 it exits 2 rather
than 143 after the drain, the same on the old code.

/config shared by two pods (a RollingUpdate overlap) is not verified
safe: files are flock'd and written by rename, but the serving magpie's
sign-in renewal, plugin sign-in renewal and check-ins would run in both.
The docs say one pod per volume with strategy: Recreate (an RWO volume
on another node also stalls a RollingUpdate). Requests sent between the
old pod's end and the new one's start are refused; the drain covers what
was in flight.

Docs: a Kubernetes section (Deployment with an exec readiness probe,
terminationGracePeriodSeconds, Recreate, the RWO note) and a
MAGPIE_DRAIN row on docker.html in en, zh and ja; docs/reference.md's
Docker section; site index regenerated.

Run:
- TestDrainedGatewayFinishesItsStream, TestDrainEndsAtItsGrace,
  TestHandedOverGatewayFinishesItsStream, TestReadOnlyKeyEveryRoute,
  TestDrainGrace, TestDrainOnSignal and the cli Signal tests: ok (mica).
- Broken by hand: without Drain's grace in drainFor,
  TestDrainedGatewayFinishesItsStream fails "the gateway ended with a
  stream in flight".
- Real binary (before the 7s default, which applies outside a pod
  only, and the Close), sandbox HOME, fake SSE upstream streaming 10s, SIGTERM
  at +2s, KUBERNETES_SERVICE_HOST set, magpie as PID 1 in its own pid
  namespace (unshare) on Linux (WSL magpie-desktop), serve and web:
  new: healthcheck fails while draining, a new request 1s after SIGTERM
  200, the stream completes at +10s, exit at +11s. origin/main: the new
  request is refused, the stream is cut at +4s after 4 chunks. Also
  serve on macOS (mica): same, exit status 143.
- gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./..., go build: ok (mica), before the 7s default
  and the Close.
- Full suite, go test -count=1 -timeout 45m ./..., on Linux (WSL
  magpie-desktop; mote and mica were each running another session's
  suite) at the first version of this change on 2051dfc23: every
  package ok except root, internal/cli and internal/gui, which can't
  build there (no gtk4/webkitgtk-6.0 dev packages), and
  internal/gateway, red on TestGrokGetsAgentMessageAsUser (the hold
  above, fixed here). The doneHold "close of closed channel" panic in
  the log is #6339/#6505/#6690, not this change.
- After the fixes: internal/gateway and internal/provider whole on WSL
  ok (1075s, 156s); root, internal/cli, internal/gui on mote ok.
- At this head, rebased on 1c9c359f9: internal/cli whole and the drain,
  handover, Codex tool and Grok gateway tests ok (mote); go vet of
  gateway/cli/gui, GOOS=windows the same, GOOS=linux -tags nogui of
  gateway/cli ok (mote).

Not tried: the real Docker image build and a real Kubernetes cluster
(no Docker daemon on mote, mica or WSL; Docker Desktop on xiaomi-gpu is
not running).
2026-11-19 13:04:38 +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 598bc45346 update: a container's hint names the found version's own image, not :latest (fishmagic80 on X)
In Docker, Settings › About on the Daily channel said "0.1.4479 is out
… docker pull ghcr.io/yetone/magpie:latest". :latest is the newest
release (docker.yml), daily and stable the Daily and Stable channels'
(docker-daily.yml, docker-stable.yml), so :latest held 0.1.4504, not the
0.1.4479 announced; on Stable it is weeks apart. docker.yml writes every
release's own tag (ghcr.io/yetone/magpie:0.1.4479; checked on ghcr: 4479,
4395, latest, daily, stable, 0.1 all resolve, daily = 4479's digest).

update.Image(version) is that tag, and every place that printed the
command names it now, with "recreate the container from it" (a compose
file on :latest would otherwise run the old tag again):
- the GUI's Version row and Update pill (/api/update's new `image`,
  stuck "container"; app.js updateStuck);
- `magpie update` in a container (internal/cli);
- a Remote magpie row's tip for a container: UpdateRemotes now keeps the
  version it asked for on an "unsupported" answer too, so the tip names
  that version's image;
- i18n zh, zh-TW, ja, de for both strings;
- docs/docker (en, zh, ja): Updates says Settings › About names the
  version's own image and that latest may be ahead of the channel;
  llms-full and search indexes rebuilt (site/docs-index.mjs).

Run at this tree (mica, through mica-run):
- red on origin/main 14b6b9555 with the new tests copied in:
  TestUpdateInContainerSaysPullTheImage (cli: ":latest" in the error),
  TestRemoteMagpieAskedToFollow (gateway: Version v0.1.100, not the asked
  v0.1.200), update-stuck.test.cjs container cases and
  remote-update.test.cjs, both engines;
- green here: go test ./internal/update ./internal/cli, internal/gateway
  and internal/provider -run TestRemote*, internal/gui except
  TestGatewayModeListsNoOwnSessions, which fails the same on
  14b6b9555 alone (#7064);
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
  ./..., go build, gofmt -l (nothing);
- node --test site/docker-tags.test.mjs; GUI files in chromium and
  webkit: update-stuck, remote-update, update-channel,
  update-stable-newest, update-release-page, update-check, lan-docker,
  i18n-keys, gui-de, gui-zh-tw, i18n-en-no-cjk (216 pass, 0 fail);
  gui-ja's "ja has every zh string" is red on main for another string
  (#7144).

Not run before the push: the full `go test -tags nogui ./...` (mote and
mica each had another session's full suite running); it runs after.
Not tried: a real container pulling the new tag. Not checked at runtime:
whether the version's image is already on ghcr; docker.yml pushes it in
~6 minutes, before the release is published, and a missing one makes
docker pull fail with "manifest unknown", not pull another version.
2026-11-19 10:26:23 +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 67405d5609 gui: the management API leaves a key let use Magpie Memory alone
4e24994a6 let a gateway key the user picks use Magpie Memory from another
computer (access.Key.Memory). memory-key is left out of the management
API, but rotate-key is not: an admin key, which may manage magpie and
nothing more, could rotate a Memory key through POST
/v1/magpie/admin/gateway-keys/rotate-key and get its new secret back (or
set a secret of its own). With it, it read and wrote memory, whose digest
goes into every agent's instructions on this computer.

adminMayChangeKey now refuses any action on a key with Memory, as it
already did for a key that may manage magpie; the caller's own key stays
its to change. TestAdminAPILeavesMemoryKeys covers rotate-key, with and
without a chosen secret, and memory-key.

Run on mica at this tree:
- go test ./internal/gui ./internal/access: access ok; gui red once on
  the first run, and the log of that run wasn't kept, so the failing test
  isn't named. Two more runs of ./internal/gui, logged whole: ok, ok.
- go vet ./internal/gui ./internal/access on darwin, GOOS=windows on
  mica, and -tags gtk3 on Linux (wsl-run, magpie-desktop): clean.
- gofmt -l: clean.
Broken by hand: with the new check off, the test is red. rotate-key
answers 200 with the Memory key's secret, and the caller's chosen secret
opens "Remote box".
Not tried: a running gateway with a real remote admin key.
2026-11-19 03:06:55 +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 c4bae07248 gui: the keep guard sets ImageResolution, which only its own row sends
f6a538ece (v0.1.4490) added Settings > Images' Resolution. The server
keeps it when a save leaves it out, but TestSettingsSaveKeepsWhatItDoesNotSend
wants every field the Settings page doesn't send set in its fixture, and
was red: "ImageResolution: not sent by the Settings page". Found by the
post-ship full suite on mica at f6a538ece.

Run on mica: go test ./internal/gui -run
'TestSettingsSaveKeepsWhatItDoesNotSend|TestSettingsImageResolution'
ok. Broken by hand: dropping the keep in settingsapi.Merge turns it red
("ImageResolution:  after a save of the Settings page, was 4K").
2026-11-19 02:02:53 +08:00
yetone 1622484a86 update: a restart whose new version couldn't be started leaves this magpie running instead of quitting (ShipInSand on X)
restartInto logged a relaunch error that was not a system refusal and still returned true, so the caller quit with the new version installed and nothing started; the handover's fallback did the same. Both now keep this magpie up, say why in the version row (Error), and let a later restart through.

Run, on mote/mica (macOS), at origin/main de58a3879 plus this commit: TestRestartThatCouldNotStartStaysUp is red on the old update.go and handover.go ("restartToUpdate said to quit, though the new version didn't start") and green with the fix; the Restart and Handover tests in internal/gui ok; internal/update ok; gofmt -l clean; go vet for darwin, linux with -tags nogui and windows clean. Windows: internal/update Relaunch|Blocked|Install|Aside ok; the new test skips there (a failed start on Windows is always a BlockedError). Full internal/gui run at d048939da+fix: red only in TestLaneLimitRoutes (#5150), TestSettingsSaveKeepsWhatItDoesNotSend (#7127) and TestAppReplacesItsOlderGatewayOnceIdle's TempDir cleanup (#6297); the first two are red the same on origin/main de58a3879, the third passes alone on both. TestUpdateThatWontStart is red on Windows on main (#6059).

Not tried: a real failed relaunch on a real install; Linux gui tests (wsl-run lacks gtk); the Windows AwaitPredecessor/lock hypothesis (commented on #5922), which this does not change; no GUI .cjs tests (no GUI file touched).
2026-11-19 01:25:26 +08:00
yetone 2ab2f69132 agent: Codex's status line shows the account's quota or the relay's balance (opt-in)
lyj1115 on X asked for the current account's quota, or the relay key's
balance, under Codex's chat box, off by default. Codex's TUI draws its
footer from a status line provider from 0.171.0-alpha.12 on: a stdio
MCP server whose tool advertises a statusline entrypoint, picked in
[tui] status_line_provider behind [features] tui_extensions_statusline.
Codex reads it about once a second with the thread's id. Nothing is put
into the prompt or the model's reply.

- `magpie statusline --codex` is that server. Each read asks the local
  gateway for the thread's latest route and the kept quotas (no vendor
  read). It answers `→ provider/model` and that provider's account that
  answered last, with its windows or a key's balance. A gateway that is
  down gives a null tree, never an error, because an error stops Codex's
  reads. The tool's name and words name neither magpie nor a vendor,
  since the tool is listed to the model.
- A status line square on Codex's row (`magpie codex statusline on`)
  writes the flag, [mcp_servers.quota_line] (this magpie by full path,
  args statusline --codex, env_vars = ["MAGPIE_ADDR"]) and the
  provider. Every write is read back, and the file is restored on a
  mismatch. Off and Disconnect take out only magpie's keys, and the flag
  only when the stash says magpie wrote it.
- Nothing of the user's is written over. A provider of their own, a
  quota_line of theirs, the flag turned off or an unreadable file keeps
  the square away and refuses on.
- The switch is offered only when a Codex CLI here is 0.171.0-alpha.12
  or newer (0.170.0 reads the keys and draws nothing), and only on this
  computer, not in a WSL distro.
- In the GUI, the status line square's title takes the note of its
  field's on option, which Claude Code's field already sent with the
  same words TOGGLES kept, so Codex's says its own words in en, zh,
  zh-TW, ja and de. TOGGLES' copy of Claude's note went, and app.js
  stays under its budget (30 bytes of room) without a raise.

The Codex desktop app has no such footer. cockpit-tools reaches it
through a debug port, and magpie doesn't.

Run (WSL magpie-desktop, since mote's load was over 18):
- go vet -tags nogui ./...; GOOS=windows go vet of agent, cli, provider
  and gui; gofmt -l clean.
- go test -tags nogui of ./internal/cli and ./internal/provider: ok.
- ./internal/agent -run "CodexStatus|Statusline|StatusLine|TestCodex|
  TestWSLCodex": ok.
- ./internal/gui -run "CoreScript|Budget|I18n|Keys" and node --test of
  codex-statusline, claude-statusline and i18n-keys (both engines, every
  language, window and panel), with vet (and GOOS=linux and windows
  vet) of agent, cli, provider and gui, on mote at the rebased head
  (on 1bd1a08a3): all ok, 64 of 64 GUI cases.

Broken by hand:
- free() reduced to `readable`: TestCodexStatusLineLeavesTheUsers is red
  on their provider, their server and flag off.
- The field not appended: TestCodexStatusLineSwitch is red ("no
  statusline field").
- The first build checked `at.base == nil` after codexIn had set base.
  Every agent test went red, which is how that bug was found.

Real Codex, in a sandbox HOME on WSL with a fake gateway:
- 0.171.0-alpha.13, with `magpie codex statusline on` writing config.toml,
  draws `→ relay/glm-5  relay $4.20` under the prompt, and the server is
  read about once a second.
- Without env_vars, Codex starts the server without MAGPIE_ADDR: nothing
  was asked and nothing was drawn. That is why env_vars is written.
- On a second time leaves the file byte for byte. Off brings it back to
  what it was, apart from Codex's own NUX counter.
- 0.170.0 lists quota_line from the same file and runs fine.

Not tried: macOS and Windows Codex; a real gateway with real accounts
(the server was fed through MAGPIE_ADDR); whether an open Codex session
picks the footer up without a restart.

Full suite: run after push.
2026-11-19 00:44:40 +08:00
yetone 1bd1a08a3a mcpauth: a server never reached says it is the network, and is asked twice (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS on X clicked Sign in on the Library's Notion server
(https://mcp.notion.com/mcp) and got "couldn't reach mcp.notion.com: Post
"https://mcp.notion.com/mcp": EOF", then asked whether the server supports
sign-in at all. It does (Notion answers 401 with OAuth metadata, checked
with curl from here); the first request's connection was cut on their
side of the network.

- discover asks the initialize probe once more when it gets no answer:
  Go never sends a POST again by itself, so a kept-alive connection that
  a proxy or the server closed reads EOF and failed the sign-in.
- The failure is mcpauth.UnreachableError, with the host and the proxy
  the request went through (redacted) or none. api.go says it with an
  i18n key (unreachableSaid): the network, not the server's sign-in, with
  the way it went and what to do, Go's words kept in brackets. zh,
  zh-TW, ja, de.

Run at this head's tree on mica (mote at load 33):
- go test ./internal/mcpauth/ ./internal/gui/ ./internal/library/: ok
- go vet, GOOS=linux go vet -tags nogui, GOOS=windows go vet on
  internal/mcpauth and internal/gui: ok
- GUI: mcp-*.test.cjs, i18n-*.test.cjs, signin-browser-down: 328/328,
  Chromium and WebKit; mcp-signin gains the direct and proxy cases in en
  and zh.
Broken by hand: without the second ask, TestSignInAsksAgainAfterACut
Connection and TestSignInUnreachableSaysTheWay/direct go red, the first
with exactly the reporter's message.
Rebased on f6a538ece (also i18n.js): go test -run Budget|I18n
./internal/gui/ and i18n-keys, mcp-signin, image-resolution GUI
(32/32) run again at this head on mica: ok.
Not tried: a real cut connection to mcp.notion.com from the reporter's
network; the full Go and GUI suites.
2026-11-19 00:32:47 +08:00
yetone f6a538ece9 images: a resolution tier, 1K, 2K or 4K, in Settings and the image MCP (skingstyle48487 on X)
Asking the image MCP for 4K through a relay came back at 2K: nothing
told the model how large to draw. Settings › Models › Images now has
Image resolution (Automatic, 1K, 2K, 4K; an app menu, saved as
imageResolution), and generate_image takes a resolution argument. The
agent's own resolution or WIDTHxHEIGHT size wins over the setting.

The images API takes `resolution` (or a tier given as size, "4K"), and
each vendor gets it in its own field:
- Gemini: imageConfig.imageSize (3.x image models; 2.x draws at 1K);
- chat image models (Gemini's): image_config.image_size;
- OpenRouter /images: resolution;
- Grok Imagine: resolution 1k or 2k (its largest);
- Seedream (Ark): the size tier the model has, or its pixels for a ratio;
- MiniMax H3: area;
- GPT Image 2 and other WxH images APIs: pixels at the ratio, within
  GPT Image 2's limits (edge 3840, 655,360 to 8,294,400 pixels, /16);
- gpt-image-1, DALL·E and SenseNova keep their own sizes.
A vendor that answers 400 or 422 to a tier is asked once more without
it. An unknown resolution is a 400. Both MCPs now say what size each
image came back at, and when that is under the tier asked.

The row is drawn by videogen.js, after Video generation's, so app.js
keeps its budget (it was at 1,088,641 to the byte); the server keeps
imageResolution when a save doesn't send it (TestSettingsImageResolution),
so prefsKeep doesn't carry it. The menu has no notes: "The model's own"
was a plugin's key already.

Run (magpie-desktop WSL on xiaomi-gpu; mote was over load 18 all day):
- gofmt -l: clean; go vet -tags nogui ./... and GOOS=windows go vet
  ./...: ok.
- go test ./internal/gateway -count=1 (1995s), ./internal/imagemcp,
  ./internal/settings, ./internal/settingsapi: ok; at this head go vet
  -tags nogui of gui, gateway and settingsapi, and gateway -run
  "Tier|ImagesAPIResolution|ImageMCP|Draw|Image", settingsapi and
  imagemcp: ok.
- New: draw_tier_test.go (each protocol's field, a fake upstream for
  the images API and the image MCP, the 400 retry, the precedence).
- At this head (on 88b65d758): go test -tags nogui ./internal/gui -run
  "Budget|I18n|SettingsImage": ok; node --test i18n-keys,
  image-resolution (22 of 22: chromium and webkit, en zh zh-TW ja de,
  1100 and 420 wide), video-gen-pick and old-webkit: 62 of 64. The 2 reds are
  old-webkit's "compat.js is the first..." (guideback.js) and "the
  styles hold up in Safari 15.0" (app.css :has()), the same on a clean
  copy of origin/main 88b65d758: #6570.
- Broken by hand: imagesAPISize returning the size as given, the retry
  off, chat image_size and OpenRouter resolution dropped, the image MCP
  ignoring the setting, the server's keep of imageResolution removed,
  a zh string removed: each turned its test red.

Not run yet: the full go test ./... and the whole GUI suite (WSL's one
suite slot was taken by another session); they run after this push.
Not tried against a real vendor.
2026-11-19 00:27:58 +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
yetoneandrecih bfbc22e190 claude: an idle session is saved whenever the gateway ends or hands over (#7017)
recih: after magpie web restarted (an update's re-exec, or Quit and
start again) the next Claude turn replayed the whole conversation
instead of resuming its session. Web.Wait closed the page server and
never drained the gateway, so abortAll never ran and claude-shelf.json
was never written.

- Web.Wait drains the gateway (Close: page server, then stopServing)
  before the plugin hosts end and before update.Reexec.
- Desktop quit: OnShutdown calls stopServing.
- Signals: web, serve, the TUI and the app register their gateway with
  the signal handler (stopGatewayOnSignal). SIGINT, SIGTERM and SIGHUP
  drain it, sessions saved, before magpie dies of the signal. The return
  path waits for a drain the signal already started. The TUI and the
  app take SIGINT/SIGTERM themselves, but SIGHUP (the terminal closing)
  stays with magpie. runTUI, runGUI and runPanel now register
  tui.StopGateway and gui.StopServing for it (added in review).
- Handover: the successor answered a Claude turn before the predecessor
  had saved its shelf. The predecessor now serves
  GET /_magpie/claude-ready on its callback socket, answered once
  abortAll has run. A Claude turn on the successor waits for it.
  - The predecessor saves only after every request it holds has ended,
    of any provider, which can take up to handedOffDrain (15m).
  - Added in review: the wait is bounded by predecessorWait (90s, inside
    Claude Code's ten minutes for a reply). Past that, the turn goes on
    as before, as a replay, and no later turn waits
    (errPredecessorSlow).
  - loadShelf still reads a shelf written later, at the next turn with
    no session found.
  - A predecessor without the endpoint (404) keeps the old race.
- Sweep: sweepSessions removed session files older than idleLongest.
  That included a session kept for hours past a quota 429
  (keepForReset) and one moving from the shelf to a run.
  - Those are now protected: the shelf file, the in-memory shelf, the
    resuming set and active runs.
  - An unreadable shelf skips the sweep.
  - loadShelf and the sweep's snapshot are serialised by shelfFileMu.
    The bridge lock is held only for the shelf maps, never across the
    file's reads (added in review: the branch read the file under b.mu,
    which every Claude turn takes).

From recih's branch fix/web-restart-session-persistence (7a0261cc1,
fab0ea651), with the review's follow-ups. Not taken from the branch:
the .github/workflows/test.yml change (contributors.md: .github/ stops
for the maintainer), and the test-flake commits in other packages,
which are separate goals.

Red on origin/main 48fffb60c (the branch's tests, trimmed to what
compiles there), on mica:
- TestWebShutdownKeepsClaudeSession quit and restart: no
  claude-shelf.json ("Web.Wait did not keep the idle Claude session").
  Restart is a real Unix re-exec of the test binary with a fake claude.
- TestDesktopShutdownDrainsGateway.
- TestClaudeHandoverWaitsForSavedSession: "the successor answered
  before the predecessor saved its session".
- TestClaudeSweepKeepsQuotaSessions: 5 of 5 subtests swept the kept
  session.

Broken by hand: with runTUI's, runGUI's and runPanel's
stopGatewayOnSignal defer removed, TestHangupDrainsTheGatewayFirst
fails tui, app and panel ("SIGHUP never drained the gateway"), on
mote.
Run on mote at e4506887c (this stack on origin/main 7300be4d0):
go test -timeout 45m ./...: 101 packages ok, 2 FAIL, both open issues
that fail the same at 7300be4d0 on mote, where an ssh session forwards
127.0.0.1:3425 to a real magpie: internal/cli's
TestHealthcheckFindsTheRunningGatewayWithoutMagpieAddr,
TestUpdateRestartsTheGatewayItFindsWithoutMagpieAddr and
TestUpdateFindsAMagpieThatWroteNoRecord (#6223), internal/gui's
TestLaneLimitRoutes (#5150). On mica: gofmt -l clean; go vet ./...,
GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go
build, GOOS=linux go build -tags nogui, GOOS=windows go build all ok.
go test -race -count=2 of the new and touched tests in internal/gateway,
gui, plugin, tui ok on mote.
Not tried: a real desktop app quit or update with a real Claude
account; SIGHUP from a real terminal closing.

Rebased since. At dc507aefd on mote: go vet (darwin, GOOS=linux
-tags nogui, windows) ok; go test of internal/cli, tui, plugin,
gateway, gui, claudebridge ok but for the same #6223 and #5150 reds.
At 939fe31b6 (on origin/main 78b6d47cc) on mote: gofmt -l clean, the
three vets ok, the stack's tests with TestClaude* and
TestCoreScriptBudget ok in all six packages. Pushed on b400566f9 after
a clean rebase; the commits between touch no Go file this stack does.

Co-authored-by: recih <240406+recih@users.noreply.github.com>
2026-11-18 23:06:38 +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 1b360f08c2 gui: the Version row's Restart is named Restart only (realfxw on X)
With automatic updates off, Settings › About's Version row shows Check
and a bare Restart. realfxw restarted again and again, reading Restart
as "install the update", while his build was newer than Daily's and no
update was on offer.

Why the button is there: 74bba1fa6 added it for yansheng1003 on X, to
start magpie again as it is so start-only settings apply (LAN set by
hand in settings.json, environment variables). It does something, so
it stays, named for what it does: "Restart only" (仅重启, 僅重啟,
再起動のみ, Nur neu starten). It still shows only while no update is on
offer; the paths that install an update keep their own buttons. No
description text is added. The plain "Restart" key stays for the
agent dialogs that use it.

A longer "Restart without updating" was tried first: at 420 wide it
squeezed en's "Automatic updates are off" onto two lines, the row grew
and update-auto's "a view at its top stays at its top" went red (top
25, 2 of 2 runs, both engines). "Restart only" keeps that line on one.

TestCoreScriptBudget: app and core budgets +5, the longer word alone;
renderUpdate draws it on every window, so there is no page to move it
to.

Tests: version-restart.test.cjs gains "automatic updates off, the button
beside Check says it doesn't update", every language at 900 and 400
wide (buttons on one line, no sideways scroll, no page errors).

Run, on mote:
- Red on old: the new case against origin/main's assets, chromium, 31
  failures (['Check','Restart'] where the new label is expected).
- At this head (rebased on 35a03fee0):
  - gofmt -l internal/gui empty;
  - go vet ./internal/gui for darwin, linux -tags nogui and windows;
  - go build ./... for darwin, linux -tags nogui and windows;
  - go test -run 'TestCoreScriptBudget|TestI18n|TestRestart|TestUpdate'
    ./internal/gui ok.
- GUI, the 32 files it can reach (update-*, version-*, i18n-*,
  gui-zh-tw, gui-ja, gui-de, settings-search*, old-webkit, refresh-page,
  settings-update-source), chromium and webkit: 356 of 358 in each engine; the two reds are old-webkit's, below.
  - Before the rebase: update-auto, version-restart, update-check,
    i18n-keys, gui-de, gui-ja and gui-zh-tw passed 70 of 70 in each
    engine.
- old-webkit's two reds (guideback.js from cb1fe6d5d isn't in its
  list) fail the same on a fresh origin/main 35a03fee0, alone, in both
  engines; recorded on #6570.

Not run: the full Go suite (mote at load ~50, mica's disk full).
Not tried: the real app's About page with automatic updates off.
2026-11-18 22:32:44 +08:00
yetone 78b6d47ccc update: a version newer than its channel's says nothing comes until the channel passes it (realfxw on X)
realfxw on X (tweet 2123033167170814171): "升级无效,重启了无数次,一直卡在这个版本",
on 0.1.4445. Every release around it has its 17 assets, so nothing was
missing to download. Their Update channel is Daily, and Daily's pick
(the 11-17 20:00 UTC cut) is 0.1.4395, older than what they run. The app
keeps the newer version and installs nothing until Daily passes it, which
is right, but the version row said "Up to date on Daily" (每日版已是最新)
and, before a check, Automatic updates are off with a bare Restart. They
restarted again and again waiting for an update that couldn't come.

- update.go: the update JSON says ahead when the state is latest and
  this version is newer than the channel's.
- app.js: the row says "Newer than Daily's 0.1.4395; it updates once
  Daily passes it", the newest on Every version after it, and Switch to
  Every version as before; one t() for both channels and the Every
  version tail shared with Up to date. Translated in zh, zh-TW, ja, de.
- update_cli.go: `magpie update check` says the same, with
  `magpie update channel every` to get it now.
- core_budget_test.go: +68 bytes of code on app.js and the core scripts,
  packed to the shortest form; renderUpdate draws on every window, so
  there is no page to move it to.
- docs/reference.md: the channel section names Daily and the line.

Red on the old code (upd-ahead-red, origin/main b855cfee9):
TestUpdateAheadOfChannel FAIL (no ahead key in the JSON),
TestUpdateAheadOfChannelSaysSo FAIL ("up to date"), and
update-stable-newest.test.cjs timed out on the ahead line in every
language.

Run at this head (253547908's tree, rebased on 4d79bebfa), on mote:
- gofmt -l clean; go vet ./internal/gui ./internal/cli ./internal/update
  for darwin, GOOS=linux -tags nogui and GOOS=windows; go build . for all
  three.
- go test -count=1 ./internal/gui ./internal/cli ./internal/update
  ./internal/settings: update and settings ok; the new tests pass; gui
  and cli red only on TestLaneLimitRoutes (#5150),
  TestHealthcheckFindsTheRunningGatewayWithoutMagpieAddr,
  TestUpdateRestartsTheGatewayItFindsWithoutMagpieAddr (#6471) and
  TestUpdateFindsAMagpieThatWroteNoRecord (#6223), the same on
  origin/main b855cfee9 on mote, where an ssh forward holds
  127.0.0.1:3425.
- GUI, BROWSER=chromium and webkit: update-*, i18n-*, gui-zh-tw/ja/de,
  settings-search(-reach), 28 files, 296/296 each, before the rebase;
  update-stable-newest and i18n-keys 15/15 each after it, with
  TestCoreScriptBudget ok.

Not run: the full go test ./... suite. mote and mica each had another
session's full suite running, and mica's disk is full; CI runs it.
Not tried: a real Daily install moving past it.
2026-11-18 21:44:37 +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 e08dc0fe58 provider: OpenAI's own API sends Responses turns over the WebSocket by default, only the new input each turn (KawaiiZapic on X)
KawaiiZapic's screenshot showed 6.4 GB up for 799 MB down: every turn
went out whole. What each leg sends, checked in the code:

- Codex on a ChatGPT subscription: the kept upstream socket already
  sends previous_response_id and only the new input (codex_socket*.go).
- A Responses provider with socket=auto/on: the same, but socket was
  off unless someone ticked it, so an OpenAI API key provider sent the
  whole conversation each turn over HTTP.
- A client's own previous_response_id is kept for api.openai.com,
  Azure and Ark (prevKeeps); other relays get the expanded whole turn,
  since they can't be trusted to hold the chain.
- Claude Messages, Chat Completions and Gemini have no incremental
  protocol; those always send whole (prompt caching is what saves there).
- The ↑ counter (upbytes.go) counts each upstream write once; no double
  count found.

Change: a Responses provider at https://api.openai.com with no socket
set now goes over the WebSocket (provider.SocketByDefault, mirroring
codex-rs's create_openai_provider supports_websockets: true). socket=off
is now stored, so unticking it there sticks; elsewhere unticked is still
"". The CLI shows "auto (default)" and takes socket=off|default. The
editor's WebSocket row moved into socketrow.js (imported as the editor
draws), so app.js and the core shrink by 165 bytes and their budgets
drop with them. Caveat: an OpenAI provider saved unticked before this
(socket "") now goes over the socket until it is unticked again; the
docs say so.

Measured (fake api.openai.com over TLS, sandbox HOME, 20 turns of a 4KB
user message each): socket off 20 HTTP posts, 876,345 bytes up;
default 0 posts, 20 socket turns on one handshake, 84,928 bytes up
(Traffic().Up equal to the socket bytes, so no double count).

Run (mica). At this head, rebased on origin/main 589e4ba6d: the go
test -run line below ok (budgets included), gofmt clean,
provider-socket.test.cjs 80/80 and old-webkit's same 2 reds. The rest
ran at the tree rebased on 1bfa8d5a1 (main since touched only plugin
assets and docs outside these files):
- go test -run 'Socket|Budget|OpenAI' ./internal/gui ./internal/provider
  ./internal/cli ./internal/gateway: ok.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows
  for provider, cli, gateway, gui: ok.
- GUI: provider-socket.test.cjs 80/80 (chromium + webkit, 5 languages,
  2 widths). Every provider-*, i18n-* and old-webkit file in one
  run: 1793 pass, 76 red. Each red file run alone at this tree and at
  origin/main 1bfa8d5a1 is red the same or green at both:
  provider-fetch-again (#5057, #5232), provider-many-keys and
  provider-max-output (#6209), provider-models-rest, provider-picks-stay
  and provider-typed (#6532), provider-proxy (#7100), provider-remove
  (#7101); provider-advanced-fold 50/50, provider-env-paste,
  provider-add-gemini, -gemini, -at-once, -auth-header and -mask pass
  alone (load).
- Full suite, go test -count=1 -timeout 45m ./...: 99 packages ok, 4 red.
  Alone: TestSearchQueueKeepsCodexAlive (gateway) and
  TestWSLStoppedDistroKept (sessions) pass; TestGatewayModeListsNoOwnSessions
  (gui, #7064) and the dirent watch tests (#7031) are red at
  1bfa8d5a1 too.
- old-webkit.test.cjs: 2 reds (guideback.js not in the lazy list,
  Safari 15.0 styles), the same on origin/main 1bfa8d5a1 run alone;
  noted on #6570.

Broken by hand: SocketByDefault returning false turns
TestSocketByDefaultOnOpenAI and TestOpenAIProviderTurnsGoOverWebSocketByDefault
red ("2 HTTP posts, 0 socket turns on 0 handshakes").

Not tried: a real OpenAI API key, and a real Codex binary against an
API-key provider; the fake follows the Responses WebSocket protocol the
existing socket tests use.

Reported-by: KawaiiZapic on X
2026-11-18 20:22:30 +08:00
yetone 9314999a4a ccswitchlink: a ccswitch:// link that still reaches magpie goes to CC Switch, and so does the scheme (asombrado_a on X)
@asombrado_a (X, 2122995130097713493) has CC Switch and magpie both
installed, and a ccswitch://v1/import link opened magpie. magpie claims
magpie:// only since 03314b25a (v0.1.4455), but v0.1.3981 to v0.1.4454
claimed CC Switch's scheme too, and what they registered stays:
- macOS: Launch Services keeps the old Info.plist's ccswitch claim after
  the bundle is rewritten in place (seen on mote below);
- Windows: HKCU\Software\Classes\ccswitch running magpie.exe;
- Linux: magpie-ccswitch.desktop as the x-scheme-handler/ccswitch default.

The owner's call in 03314b25a stands: magpie doesn't read CC Switch's
links. A ccswitch:// link that reaches magpie anyway is now handed on:
- cli.run, before anything is read, moved or started (Windows, Linux:
  `magpie ccswitch://…`), and the Mac's URL event in gui.Run call
  ccswitchlink.Forward;
- macOS: `open -b com.ccswitch.desktop <link>`, then `lsregister -f` on
  magpie's own bundle, which reads its current Info.plist and drops the
  claim;
- Windows: the handler's program when it isn't this magpie, else
  %LOCALAPPDATA%\Programs\CC Switch\cc-switch.exe (where CC Switch's
  per-user MSI installs it); when the handler ran this magpie the key is
  rewritten as that MSI writes it ("URL:com.ccswitch.desktop protocol",
  URL Protocol, DefaultIcon, shell\open\command "exe" "%1");
- Linux: CC Switch's .desktop entry in the XDG data dirs (its first
  start's cc-switch-handler.desktop with %u first, else the package's
  "CC Switch.desktop", whose Exec has no %u, so the link is appended) is
  run, and a default that is magpie-ccswitch.desktop moves to it; magpie's
  entry is removed while it runs this magpie or a gone binary. Any other
  default is left alone.
- No CC Switch: ErrNotInstalled, nothing opened, the claim kept, so
  magpie opens such a link as it does now (it says it reads magpie://
  links only).

Existing users: nothing changes until a ccswitch:// link reaches magpie.
The first one is opened in CC Switch and the claim goes back, so later
links go to CC Switch directly.

CC Switch's facts come from farion1231/cc-switch (tauri.conf.json's
deep-link schemes ["ccswitch"], wix per-user-main.wxs, lib.rs's
register_all) and its v4.0.35 assets: macOS.zip's Info.plist
(com.ccswitch.desktop, CFBundleURLSchemes ccswitch), the portable zip's
cc-switch.exe, the .deb's "CC Switch.desktop" and /usr/bin/cc-switch.

Run (this tree on d74754970, then again where named after a rebase on
589e4ba6d, which touches none of these files):
- mote: go test -count=1 ./internal/ccswitchlink ./internal/cli
  ./internal/gui ok; go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./..., go build ok; gofmt -l empty.
- wsl-run (magpie-desktop) and win-run (xiaomi-gpu): go test -count=1
  -v ./internal/ccswitchlink ok (Windows writes a test key of its own,
  Software\Classes\magpie-test-ccswitch-<pid>, removed after).
- Full suite on mica (go test -count=1 -timeout 45m ./..., on
  d74754970): 101 packages ok; reds, all filed and none in a package this
  touches: internal/dirent's watch tests (#7031; red alone on a fresh
  origin/main 589e4ba6d too), TestGatewayModeListsNoOwnSessions (#7064)
  and TestWSLStoppedDistroKept (#7071), both ok alone on mica.
- After the rebase on 589e4ba6d: go vet ./..., GOOS=linux go vet -tags
  nogui ./..., GOOS=windows go vet ./..., go build, gofmt -l on mote ok;
  ./internal/ccswitchlink and ./internal/gui ok on mote; ./internal/cli
  ok on mica. On mote three cli tests reach the 127.0.0.1:3425 an ssh
  port forward holds there (#6223).
- Real, macOS (mote, in ~/runs, cleaned up with lsregister -u): a test
  bundle registered with the old ccswitch claim kept it 5s after its
  Info.plist was rewritten without it; the built Forward then opened
  the real CC Switch v4.0.35 app and the dump showed the claim gone.
  Without CC Switch registered it returned ErrNotInstalled.
- Real, Linux (magpie-desktop, sandbox HOME and XDG dirs): with
  magpie-ccswitch.desktop as the real xdg-mime default, Forward ran
  cc-switch-handler.desktop's Exec with the link and the default was
  cc-switch-handler.desktop after.
- Broken by hand: no lsregister call (darwin), no xdg-mime default
  (linux) and no handBack (windows) each turned their test red.
- GUI suite: not run; no page, app.js or i18n change.

Not tried: a real CC Switch install on Windows (the box's real HKCU
ccswitch key is left alone; the test uses its own key), and a real
CC Switch .deb or AppImage on Linux (its entry was faked with the
package's own bytes).
2026-11-18 20:07:09 +08:00
yetone d2fa7d8d79 sessions: an Antigravity app conversation shows what was said, not only its title
@yansheng1003 on X: the Sessions page showed an Antigravity 2.0
conversation's title and preview only. HasTranscript left "antigravity"
out, since conversations/<id>.db's step text is encrypted at rest, so
the row had no Show conversation and /api/sessions/transcript said
"this agent's conversations can't be shown".

The app also writes every step in plain text beside the database:
brain/<id>/.system_generated/logs/transcript_full.jsonl in the same
store, in agy CLI's format (user input, planner responses with their
tool_calls, tool results). Antigravity 2.30's language server writes it
in the stable store and in Insiders' (both checked: run in a sandbox
HOME on Windows against a fake model that called read_file).

- transcript.go: antigravity has a transcript; readTranscriptOf reads
  it through agyTranscript (antigravityTranscriptOf), so the viewer,
  TranscriptAt, search, the said index and the Markdown export all get
  it. A conversation with no transcript file is ErrNoTranscript, as
  before.
- antigravity_app.go: antigravityTranscript derives the path from the
  database's (stable, Insiders, a WSL distro's); its size and time are
  folded into the session file's with the -wal's, so a step it adds
  reads the session and the said index again.
- search.go: linesFile is false for antigravity, so the encrypted .db is
  never pre-scanned for the words.
- testdata/antigravity-2.30-tools: that real conversation (db with the
  WAL checkpointed, summary row, brain/ logs).

Tests: TestAntigravityAppTranscript (stable, Insiders, WSL: parts, search
hit and miss, Markdown), TestAntigravityAppNoTranscript,
internal/gui TestSessionAntigravityConversation (/api/sessions marks it,
/api/sessions/transcript gives the five parts).

Run: on mica (mica-run) at base de5fc6700:
- gofmt -l internal/sessions internal/gui: clean.
- go vet ./internal/sessions ./internal/gui, GOOS=linux go vet -tags
  nogui and GOOS=windows go vet on the same, go build .: ok.
- go test -count=1 -timeout 45m ./internal/sessions: ok but for
  TestWSLAgentsGoneListingDrops (load ~48; fixed at its cause in the
  commit before this one); go test ./internal/gui: ok (299s).
- After that fix: go test -run 'WSL|Antigravity|Agy|Gone'
  ./internal/sessions ok; GUI files sessions-talk, -talk-sheet,
  -talk-model, -export, -said, -subagents, -reads, -search, -convert:
  168 of 168 in Chromium and WebKit.
- Old code (de5fc6700 with only the new tests and testdata):
  TestAntigravityAppTranscript red in stable, insiders and wsl ("the
  session isn't marked readable"), TestSessionAntigravityConversation
  red ("listed with no conversation to show ... Transcript:false").
- Windows (win-run on xiaomi-gpu): TestAntigravityAppTranscript (3
  subtests) and TestAntigravityAppNoTranscript pass.
  TestAntigravityAppFolder is red there at the base as well (#5957).
Rebased onto bfddc9cfb, on mote (mote-run) at this tree: gofmt clean,
the three vets and go build ok, go test -count=1 ./internal/sessions
./internal/gui ok (56s, 157s).
Not tried: the real GUI window opening this conversation; the API and
page are covered by the tests above.
2026-11-18 18:55:46 +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 2416beed69 sessions: a tab's count is the rows it lists, and a Pi subagent's calls are no row delete can't find (lurx98 on X)
lurx98 on X (tweet 2122972281534402597): on the Sessions page the tabs
said Codex 6 and Pi 8. Codex, opened, said 0 and "no sessions yet"; Pi
said 6 from any other tab. Deleting a row titled "Task: 只读事实核对…"
toasted "no such session".

Two causes, both about one count path and the list disagreeing:

- Codex: agentCounts counted every rollout, while the list drops a
  subagent thread whose parent thread is gone (keptSubagents, 82f09e324:
  Codex App leaves them behind when a thread is deleted). Both now ask
  orphanSubagents; agentCounts reads the identities from the parses kept
  (codexIdentitySnapshot), so a rollout never parsed yet still counts
  until something reads it (Usage, the Codex tab).
- Pi: a pi-subagents scout runs as a Pi of its own and names its own
  session id to the gateway. The lead's row covers it (NativeIDs, its
  subIDs), and a tab not shown skips it, but the shown tab deduplicated
  gateway sessions only by its rows' own ids, so the scout's calls were
  a row of their own, titled by its "Task: …" prompt. Its count (rows)
  went up by those. Delete sent that id to the lead's files (the delete
  handler's NativeIDs path), where no session has it: "no such session".
  The shown tab now skips the same native ids as the counts and delete.

Test: TestSessionTabCountsAreTheirRows (internal/gui), built on the real
pi-subagents fixture (Pi 1.4.0, pi-subagents 0.88.1) with the scout's
calls through the gateway, and Codex App rollouts whose parent thread is
gone. It checks each tab lists the rows it counts, from every tab, and
that each listed Pi row deletes.

Run:
- Old code red: with both files reverted, 5 failures (scout listed as a
  row, codex 4 vs 2, pi 3 vs 2, delete "no such session"). Reverting
  only internal/sessions/manage.go: codex 4 vs 2. Reverting only
  internal/gui/sessions_manage.go: the Pi failures and "no such session".
- At 41b4edf87 (on origin/main 03314b25a), through mote-run: gofmt -l
  clean, go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows
  go vet ./..., go build, then go test ./... -count=1 -timeout 45m: 103
  packages ok, no FAIL (gui 203s, sessions 163s, gateway 1045s).
- Rebased onto 54117164c (gateway files only, none of these): go test
  ./internal/gui ./internal/sessions -count=1 ok again at the pushed head.
- No GUI script changed (client.js untouched), so no GUI suite run.

Not tried: the reporter's own files. The Codex fix needs the rollouts
parsed once (as above); and agents whose rows can be hidden
(GatewayHidden, uninstalled agents' Forget) still count hidden rows on
another tab, which the reporter's agents don't have.
2026-11-18 17:30:43 +08:00
yetone 03314b25a4 import: magpie no longer registers CC Switch's ccswitch:// scheme (asombrado_a on X)
889758605 (v0.1.3981, coder_shaun on X asking for one-click import from
relays' CC Switch links) made magpie claim ccswitch:// on every system:
Info.plist on macOS, HKCU\Software\Classes\ccswitch on Windows, and
magpie-ccswitch.desktop on Linux. That scheme is CC Switch's, and magpie
claiming another app's links is not something it should do (asombrado_a
on X: "Magpie为啥要注册 ccswitch://协议的深链").

From this version magpie registers magpie:// only: the ccswitch entry is
out of Info.plist, and the Windows and Linux registration is back to what
it was before 889758605. A start doesn't touch what an older version wrote
(the owner's call); uninstall still takes it out while it is magpie's, as
before. The ccswitch:// parser (importccswitch.go, its test and CC
Switch's example links) goes with it: with nothing registered, no link
reaches it, and ParseImport, ImportLink and `magpie import` take magpie://
links only. The docs' "CC Switch links" paragraph is out in en, zh and ja,
and llms-full.txt and the search indexes are regenerated.

TestRegisterScheme now holds that registration never asks about or claims
x-scheme-handler/ccswitch, and TestImportLink that a ccswitch:// argument
is not taken as an import link.

Run at this commit's tree (rebased on 1318864d1), on mica (mote's load was
38): gofmt clean; go vet darwin, GOOS=windows
(gui, uninstall, provider), GOOS=linux nogui (provider, uninstall);
go test provider, gui, uninstall, cli ok; node --test site/*.test.mjs
135 pass. Linux (wsl-run, magpie-desktop, -tags gtk3), at the tree before the rebase
(the scheme files are the same at this one): provider, uninstall ok; gui ok
except TestClipboardReadBack/copies_after_a_read_back,
which fails the same on origin/main 3ec89c522 (probe segfault, #7073); at this tree TestRegisterScheme*, TestImportLink
and TestImportIsReadOnce ok.
Pushed on 3e66d25d8, which landed after the run and changes internal/agent
only; not run again with it.
Not tried: a real Windows or Linux desktop with an older magpie's
ccswitch registration, which this leaves in place; macOS Launch Services
dropping the scheme once the updated bundle replaces the old one.
2026-11-18 16:52:58 +08:00
yetone a2d402afe0 gui: the Mac's tray panel sits at a menu bar extra's level, so a screenshot tool draws over it (zyh6036 on X)
zyh6036 on X: the menu bar panel stays so far in front that even
WeChat's screenshot can't cover it, so it's hard to take a picture of.

The panel asked for AlwaysOnTop (NSFloatingWindowLevel, 3), but Wails'
SystemTray.PositionWindow sets the window it places to
NSPopUpMenuWindowLevel (101) every time (systemtray_darwin.m), and magpie
places the panel with it on each open and each resize. The live app's
panel read layer 101 in CGWindowList. Nothing in magpie's history chose
101 (git log -S finds only AlwaysOnTop, from the first commit).

placeByIcon now does PositionWindow and then sets NSStatusWindowLevel
(25), the level of the status bar itself: still over normal windows,
floating ones, the Dock (20) and the menu bar (24), and still on every
Space and over full-screen apps (the collection behavior is unchanged,
#2141), but under pop-up menus and anything a screenshot tool puts up at
25 or above. Both PositionWindow calls (togglePanelNow, sizeOpenPanel)
go through it. Other systems: setPanelLevel is a no-op.

What was run (mica, macOS 27, at 48fffb60c + this change; the panel tests again at the rebased head):
- TestPanelJoinsFullScreenSpaces now has a real SystemTray, places the
  panel through placeByIcon and checks the level is
  NSStatusWindowLevel. Broken by hand (setPanelLevel call removed): red,
  "the panel is at level 101". Restored: green.
- A real build in a sandbox HOME (MAGPIE_ADDR 127.0.0.1:3536),
  `magpie panel`, with a tiny AppKit helper: CGWindowList front to back
  read the panel (439x521) at layer 25 over a normal titled window
  (layer 0); a full-screen borderless overlay at NSScreenSaverWindowLevel
  (1000) shown after it was in front of the panel, and so was one at
  NSStatusWindowLevel (25) shown after it, as a screenshot overlay is.
  Before the change the panel was at 101, over the one at 25.
- go test -count=1 -timeout 45m ./internal/gui: ok (714s). An earlier
  run of it had two source guards (panelside_test.go) reading the old
  PositionWindow call, updated here, and TestGatewayModeListsNoOwnSessions
  red under load ("listing":true, the search asked before the list was
  read), green alone: filed as #7064.
- go vet ./internal/gui on darwin, GOOS=windows, and Linux in WSL
  (magpie-desktop, -tags gtk3): ok. gofmt -l: clean.

Not tried: the panel over a real full-screen app. mica's and mote's
screens are locked, and a window there doesn't enter full screen; the
full-screen guarantee is the unchanged collection behavior, which the
same test still checks. WeChat itself: not installed on any test Mac,
so its overlay's level isn't known; if it is below 25 this doesn't
reach it, and the reply asks the reporter to say.
2026-11-18 16:30:23 +08:00
yetone 534b85bf99 gui: an unset Claude Code tier's effort reads "follows session"; a set one says it wins
lightwlh on X: Claude Code's Details shows an effort beside each tier
(Opus, Sonnet, Haiku, Fable) and another under New sessions, and asked
which one wins when they differ. A tier's effort is written into its
model id as <model>:<level> (tierWith in internal/agent/claude.go), and
the gateway asks that model at that level whatever Claude Code asked
(askedAt); the New sessions effort is Claude Code's own (effortLevel /
CLAUDE_CODE_EFFORT_LEVEL), which /effort changes, and reaches only the
tiers with none of their own. The page didn't say so: an unset tier's
effort read "default", like a level of its own.

- An unset tier's effort button reads "follows session" (跟随会话,
  跟隨會話, セッションに従う, wie Sitzung) instead of "default"; its
  title still names the effort Claude Code asks for.
- A set tier's title adds "Used whatever the session's effort or
  /effort is".
- New sessions' effort, while any tier has its own, adds "A tier with an
  effort of its own runs at that one" to its title; both follow a pick
  in the slider at once (the slider's field is a copy, so the check
  reads the picked value).
- No layout change: the same buttons and lines; the subagents' effort
  and the tray panel's tiers' square are unchanged.
- app.js +485 and the core +843 bytes of code, budgets raised with the
  reason: connectPanel and the effort slider draw every agent's Details,
  so there is no page to move it to; the words share one ownSaid.

Run (mote, at this tree rebased on de5fc6700):
- node --test tier-effort, claude-subagent-effort-row, wsl-claude-tiers,
  claude-effort, subagent-effort, panel-effort, agent-tweak-fold,
  i18n-keys, gui-ja, gui-zh-tw, i18n-en-no-cjk: 124 pass 0 fail
  (Chromium and WebKit; tier-effort's narrow 560px case now in all five
  languages, each tier's effort on its model's line, no sideways scroll).
- Broken by hand: tier-effort against origin/main's app.js, 4 of 4 of
  the pick tests red (no "follows session", no wins line).
- go test ./internal/gui: ok (TestCoreScriptBudget red before the raise).
Not run yet: the whole GUI suite (mote and mica each had another
session's full suite running); it runs after the push.
2026-11-18 16:24:12 +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 c5cb1c0588 gui: the tray's logo is 16pt, as large as other apps' menu bar icons
qingnianxiaozhe on X: magpie's A\ in the menu bar looked a size smaller
than another app's A\ beside it. magpie fitted each logo to a 14pt box,
so the A\ (about 1.37:1) drew 14x10pt. Claude.app's menu bar template
(TrayIconTemplate@2x.png, 48x48 px) has 32x32 px of ink, a 16pt glyph,
and in the reporter's screenshot the other A\ is 32x22 px against
magpie's 28x20 px at 2x. mpLogo is now 16; the letter in a ring (a logo
that can't be read) grows with it. The two 10pt rows of percentages are
unchanged and still fit the 22pt bar.

Tests: the logo boxes in the tray tests follow the 16pt box (offsets 28
-> 32, 34 -> 38 px at 2x); TestTrayImageLogoSizes now wants 27-33 px of
a 32 px box.

Run on mote (macOS 27.2):
- go test ./internal/gui -run Tray -count=1 -v: ok.
- Broken by hand (mpLogo back to 14): TestTrayImageLogoSizes FAILs
  ("alma spans 24 px of a 32 px box", codex/zcode/workbuddy 26 px) and
  TestTrayImagePlain FAILs ("238 px with logos, 182 without").
- Rendered by the real drawing code (trayImagePNG, 22pt bar at 2x)
  next to Claude.app's own template icon: the A\ is 28 px wide before
  and 32x24 px of ink after, as wide as Claude's 32 px spark; the
  percentages are the same text at the same size. The before/after
  strips are kept outside the repo (tray-toolbar-scratch/before and
  after/strip-{light,dark}.png).
Suite and checks, on mote at aa31e737c8d271455865615fafdf512e09073663 (this commit and its pair, the
tray logo size / the toolbar menu):
- go test -count=1 -timeout 45m ./... in a sandbox HOME, caches pinned:
  exit 0, 103 packages ok, none FAIL (internal/gateway 1633s,
  internal/agent 949s, internal/provider 470s, internal/gui 295s).
- gofmt -l internal/gui: nothing. go vet ./..., GOOS=linux go vet -tags
  nogui ./..., GOOS=windows go vet ./..., go build, GOOS=linux go build
  -tags nogui, GOOS=windows go build: all ok.
- No GUI asset changed, so the Playwright suite wasn't run.
After a rebase onto 42c43c002 (Antigravity sessions, internal/gui
sessions reads; no file in common), at the pushed head:
go vet, GOOS=windows and GOOS=linux -tags nogui go vet of ./internal/gui/...
and go test -count=1 ./internal/gui/...: ok.
Then rebased onto f7e0f68ca (Codex instructions, internal/provider
only), not run again.

Not tried: a screen screenshot of the real menu bar (no Screen
Recording permission over ssh on mote; the image is the one the app
hands NSStatusItem); the reporter's notch Mac, where the bar is 24pt.
2026-11-18 16:08:15 +08:00
yetone add1e75ee3 gui: no Icon and Text menu on a right-click by the traffic lights
AlanWang1027713 on X: a right-click on the main window's title bar, by
the lights, offered "Icon and Text / Icon Only / Text Only". It comes
from the empty NSToolbar that MacTitleBarHiddenInset puts there to
inset the lights; NSThemeFrame's menuForEvent: lists its display modes.
insetLights takes the toolbar away only in the macOS 26 design, so on
macOS 27, with an older SDK and in a right-to-left layout the toolbar,
and its menu, stayed.

quietToolbar turns the menu off where the toolbar stays:
allowsDisplayModeCustomization = NO (macOS 15+), and AppKit's own
_setWantsToolbarContextMenu: NO for macOS 12-14, each looked up with
respondsToSelector, since the SDK that builds magpie may be older than
the system it runs on. Nothing about the title bar's shape changes.

windowshape.Of now reads the menu a right-click 20pt below the top,
120pt in, gets from the window frame (TitlebarMenu), and
TestMainWindowCorners and TestMainWindowRightToLeft fail when the main
window gets one, or when the reference toolbar window doesn't (so the
probe is proven to see it).

Run on mote (macOS 27.2), real makeMain window:
- go test ./internal/gui -run 'TestMainWindowCorners|TestMainWindowRightToLeft'
  -count=1 -v: ok. Each stage logs "title bar menu []" next to the
  reference toolbar window's ["Icon and Text" "Icon Only" "Text Only" "-"]
  (macOS 26 SDK) and ["-"] (macOS 15 SDK). Lights [[26 26] [49 26] [72 26]],
  66pt title bar and 16pt corners with the 26 SDK, [[19 19] [39 19]
  [59 19]] and 38pt with the 15 SDK: the same as without the change.
- Broken by hand (quietToolbar call taken out): both FAIL, "a right-click
  on the title bar gets a menu: ["Icon and Text" "Icon Only" "Text Only"
  "-"]" (26 SDK) and ["-"] (15 SDK).
- A probe app on mote: either switch alone empties the frame's menu.
Suite and checks, on mote at aa31e737c8d271455865615fafdf512e09073663 (this commit and its pair, the
tray logo size / the toolbar menu):
- go test -count=1 -timeout 45m ./... in a sandbox HOME, caches pinned:
  exit 0, 103 packages ok, none FAIL (internal/gateway 1633s,
  internal/agent 949s, internal/provider 470s, internal/gui 295s).
- gofmt -l internal/gui: nothing. go vet ./..., GOOS=linux go vet -tags
  nogui ./..., GOOS=windows go vet ./..., go build, GOOS=linux go build
  -tags nogui, GOOS=windows go build: all ok.
- No GUI asset changed, so the Playwright suite wasn't run.
After a rebase onto 42c43c002 (Antigravity sessions, internal/gui
sessions reads; no file in common), at the pushed head:
go vet, GOOS=windows and GOOS=linux -tags nogui go vet of ./internal/gui/...
and go test -count=1 ./internal/gui/...: ok.
Then rebased onto f7e0f68ca (Codex instructions, internal/provider
only), not run again.

Not tried: a screen screenshot (screencapture over ssh has no Screen
Recording permission on mote; the menu is read from AppKit instead);
macOS 12-14, where only the private selector applies.
2026-11-18 16:08:15 +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 48fffb60c5 gui: the provider editor waits for its Advanced headings before it draws (#7051)
31575f71a grouped the editor's Advanced rows from advgroups.js, imported
as Providers first draws. An editor opened before the import landed drew
its rows ungrouped and moved them under headings a moment later, so a
reader saw the rows jump and settings-groups read either order (red 6 of
14 on origin/main 61c714ed0, both engines, en and zh).

renderProviders now waits for the import (a local file, a few ms) before
it draws an open editor, and groupAdvanced groups in the same draw. A
failed import draws the editor ungrouped rather than not at all.
settings-groups lists Claude's rows in the grouped order.

Run (mote, at this tree):
- settings-groups 3 runs, advanced-headings, provider-prefs,
  settings-search, provider-unsaved-paths, Chromium and WebKit: all pass
  (14, 10, 20, 18, 4).
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok.

Broken by hand, then put back:
- the wait removed and the import held 400ms: settings-groups 6 of 14 red.
- the wait kept and the import held 400ms: settings-groups and
  advanced-headings green.

Not tried: the real app window, the full GUI suite.
2026-11-18 14:56:22 +08:00
yetone 42181fdd27 gui: the Claude provider's run field is named Claude requests, not Claude Code
The Claude provider's editor had a field under Advanced named "Claude
Code", the same name as the agent's own sheet on the Agents page, so
two different places read as one. The field says how magpie sends
requests to Claude (its run row), so it is now "Claude requests": zh
Claude 请求, zh-TW Claude 請求, ja Claude リクエスト, de
Claude-Anfragen. The name was also the only field label left
untranslated. The Agents page's Claude Code is unchanged.

claude-extra-usage-setting checks the field's name in each language.

Run (mica):
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS':
  ok, at this change rebased on 31575f71a.
- claude-extra-usage-setting, provider-prefs, i18n-keys there: 46 of 46.
  settings-groups: 6 of 14 red, the same as origin/main 61c714ed0, where
  31575f71a's Advanced headings land before or after the first draw and
  Claude's rows change order (#7051). Before 31575f71a, at 433814799,
  settings-groups was 14 of 14 with this change, alongside
  claude-lean-prompt-setting, settings-search, gui-de and nav-timeout.
- Rebased again onto 61c714ed0 for the push; not run again there.

Broken by hand, then put back: the old untranslated "Claude Code"
label, claude-extra-usage-setting 20 of 20 red.

Not tried: the real app window, the full GUI suite.
2026-11-18 14:41:21 +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 31575f71a1 gui: the provider editor's Advanced rows sit under four small headings
The provider editor's Advanced held some thirty rows in one run (item
19). They now sit under four small headings, Routing, Models, Limits and
cost, and Connection, each row keeping its order inside its group; a row
the list doesn't name stays with the one before it, and the headings
show only when two groups are used. No page, row or fold moves
elsewhere. advgroups.js is imported when Providers first draws, so it
weighs nothing on the core script, and the editor opens with the
headings already in place.

Not done from item 19: a routing group's strategy stays under the
group's Advanced. The owner folded it there on purpose (9edc6506e,
11-09, "the Add group form was too long"; and for providers on 11-12,
"这些也要折叠在高级里"), and routing-advanced holds the provider side.

New test: advanced-headings, for an account and a key, both engines,
every language: the headings in order, Routing/Stays under Routing,
Context window under Models, Requests at once under Limits and cost,
Proxy under Connection, the heading across the whole row.

Broken by hand: both groupAdvanced(advIn) calls removed,
advanced-headings 10 of 10 red; put back, 10 of 10 green.

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.

The Codex client row 07d19510f added to the Codex provider's Advanced
sits under Connection, beside User-Agent: which client the requests say
they come from. advanced-headings has a Codex account for it; with the
row left out of the list, 10 of 10 red.

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