Commit Graph
4522 Commits
Author SHA1 Message Date
yetone 4b3bdbe28c masking: the flow's dots, scan and Live dot stop moving once played (#3185)
The Masking page never came to rest. Each dot in its agents-to-providers
flow was an SVG animateMotion with repeatCount "indefinite", the scan
mark on the middle line ran forever, and the Live dot pulsed forever.
The SMIL dots alone made Chromium lay the page out ~700 times a second
(6,965 layouts and 2,282 style recalcs in 10s, read with CDP
Performance.getMetrics). Removing just those 22 elements took it to 0.

Now each dot goes round twice when the flow is drawn, and the scan mark
plays twice. The flow is drawn again only when the numbers change. The
Live dot pulses once each time the list is drawn again, which happens on
each 15s read. Reduced motion is unchanged: still no motion at all.

Measured on a sandbox `magpie app` (origin/main, sandbox HOME, real
deepseek provider, the real masking log copied in: 19,657 values over
577 requests). The Masking page was loaded in Playwright 1.62.0, and only
that browser's own processes were sampled with proc_pid_rusage, 20s per
sample:
- WebKit, before: 180 wakeups/s, 2.8% CPU, 56 mW.
  After: 37/s and 9.7 mW while the motion plays out (8-28s), then
  10.8/s, 0.1% CPU, 1.4 mW.
- Chromium, before: 96-98/s, 17% CPU, 537-543 mW.
  After: 40/s, 2.0% CPU, 57 mW while the motion plays out, then
  18.5/s, 0.5% CPU, 10 mW.
- The other pages at rest: 12-30/s and 1.6-7.7 mW in WebKit.

Test: masking-records' new "the masking page's motion ends" (chromium
and webkit, 1100px and 640px). It moves the SVG clock on an hour and
asks Chromium whether any dot is still in an interval. In both engines
it checks that no SMIL element is set to repeat for good and that no
CSS animation has an infinite end. All 4 cases are red on the old
page.js/redact.css and green on the new ones.

Run at this tree:
- masking-records, held-animations and i18n-keys: 68/68.
- account-mask-sessions, account-mask, mask-actions, mask-emails,
  provider-unmasked and redact-*: 172/172.
- go test -timeout 45m ./internal/gui: ok.
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui: ok.
- gofmt: clean.

Other states measured, with no change made:
- Go main process at rest with the window open: 25/s, 7 mW.
- Streaming 3 deepseek-flash replies (2,450 SSE events in 20s):
  275/s, 3.5% CPU, 107 mW, about 2 wakeups per event.

Not tried: the window hidden and the tray panel open; the
WKWebView in the real app window on Masking (measured in Playwright's
WebKit instead); the full GUI suite.
2026-10-25 20:33:33 +08:00
yetone 41b0445ccf provider: a local server's address is a field shown first, and address= on the command line (LM Studio on another computer)
mengxiangziyou on X: "供应商里的LM Studio只能用本地的,怎么用局域网里其他机器
上的LM Studio, baseUrl 不能改". Moving a local preset (Ollama, LM Studio,
oMLX, MLX-Serve) to another host has worked since #1165, but the window
put the Address in a "Server address" fold under the key, while the
Endpoints row showed http://localhost:1234/v1 as plain text. Reproduced
in a sandbox: Add > LM Studio shows the URL and nothing to change it
with unless the small fold is found.

- GUI: the Server address field is shown first, above the key, never
  folded, for a new provider and a saved one alike (its label and hint
  are the strings the fold used, so no new i18n keys). Saving still
  sends the URLs moved only when the address was changed.
- CLI: `magpie provider add|set <id> address=<host:port>` moves every
  URL the provider has (chat, Anthropic, Responses, decision), each
  keeping its path; from the preset's when it was saved with none, and
  `address=` alone puts a local server back at its preset's. A provider
  of the user's own moves its own URLs. Vertex refuses it as it does
  url=. Before, Ollama on another computer needed url= and anthropic=.
- TUI: unchanged (asked on adding, `w` after).
- docs/subsystems/providers-accounts.md: Local servers row.

Security: only upstream URLs move. The gateway's own loopback/origin
guards are about inbound requests and don't read them; the one rule
that looks at an upstream being on the LAN (Unredacted) stays the
user's own switch.

Run at this tree (origin/main 642180a80 + this change; rebased onto
2f44e075a, which touches none of these files, then build, the new CLI
tests and local-address.test.cjs run again there: ok):
- New TestProviderAddressMovesALocalServer and TestProviderAddressPairs
  (internal/cli): fail on the old providers_cli.go with `unknown field
  "address"`, pass with it.
- local-address.test.cjs (both engines, en/zh/zh-TW/ja/de, 900 and
  440px): with the old app.js 3 subtests fail at "shown when added,
  nothing to open"; 22/22 pass with it.
- GUI files add-sheet, decide-endpoint-label, local-address,
  nokey-editor, provider-insecure-tls, remote-magpie, provider-unmasked,
  i18n-keys, gui-de, gui-ja, gui-zh-tw: 161/161 pass.
- go test -tags nogui -timeout 45m ./internal/cli ./internal/provider
  ./internal/tui ./internal/gui in a sandbox HOME: all ok.
- gofmt -l clean; go vet (darwin), GOOS=linux go vet -tags nogui,
  GOOS=windows go vet on internal/cli; go build, GOOS=linux go build
  -tags nogui, GOOS=windows go build: ok.
- Real use, sandbox HOME, built binary (-tags dev): a fake LM Studio
  bound to the Mac's LAN address 10.0.0.111:41234. The window's Add >
  LM Studio showed the field; typing 10.0.0.111:41234 and Add saved
  chat http://10.0.0.111:41234/v1, listed lmstudio/lan-qwen-9b from
  that host (GET /v1/models there), and a chat completion through the
  gateway reached it. `provider set lmstudio address=` put it back at
  http://localhost:1234/v1; `address=10.0.0.111:41234` moved it again
  and the next request went there.

Not run: go test ./... over every package (other sessions' suites on
this machine, load ~60), the whole GUI suite, a real LM Studio on a
second machine, the Windows and Linux apps.
2026-10-25 20:29:22 +08:00
yetone 5be7d05d28 agent: Desktop on magpie offers its own import of the signed-in sessions (lambdua on X)
lambdua on X: "claude Code桌面端支持么? 我桌面端切换账号,对话都能全都不见".
Nothing is lost. Desktop on magpie runs in 3p mode, whose userData is
Claude-3p, a folder apart from Claude/. Desktop 2.7032 keys Code and
Cowork sessions by account and org (claude-code-sessions/<acct>/<org>):
in 1p the claude.ai login's, in 3p the install id in ant-did and a fixed
org. So the sessions made signed in stay in Claude/ untouched and show
again when Desktop is switched back; claude.ai chats are on Anthropic's
servers. magpie's on/off never writes or removes a session (desktopOff
removes only what magpie made, and only when empty).

Desktop has its own importer (Settings -> Import: the signed-in userData,
other Claude* folders, ~/.claude/projects; copies under new ids, originals
left), but in 3p only when the profile's claudeAiImport.enabled is true
(3p-only policy, default off, since 1.28929.0). magpie's profile now gets
"claudeAiImport":{"enabled":true,"bannerBehavior":"detect"} once per
folder set (desktopSeedImport, stash mark claude-desktop.import): on the
switch on, and from Sync at magpie's start for a Desktop already on
magpie. A claudeAiImport already there is kept; one the user removes is
not written back (the mark is read, never unstashed).

Run (suite at origin/main 5df62c5cd, then rebased on 2f44e075a):
- go test ./internal/agent/ -run Desktop -count=1: ok.
- go test ./... -timeout 45m -count=1 at 5df62c5cd (log kept whole):
  every package ok but two reds already on main and filed:
  TestFolderVarsAreListed (#3600, fixed in 2f44e075a) and
  TestNoCommandBypassesProc (#3567, internal/tui/keep.go, open).
- after the rebase onto 2f44e075a: go test ./internal/agent/
  ./internal/proc/ -count=1: agent ok; proc red on #3567 only.
- gofmt -l clean; GOOS=linux and GOOS=windows go vet ./internal/agent/
  ok; GOOS=windows go build ./... ok; GOOS=linux go build ./internal/agent/
  ok (the CLI and GUI need Wails' cgo, not cross-built here).
Broken by hand:
- desktopSeedImport returning at once (the old code): TestClaudeDesktopFresh,
  TestClaudeDesktopOnKeepsTheUsersOwnGatewayProfile and the new
  TestClaudeDesktopOffersItsSessionImport go red.
- the mark read with unstash (consumed on read): the new test goes red
  with "seeded again over the user's choice". My first draft had this
  bug; the test found it.
Schema checked in Desktop 2.7032's asar (read-only, extracted to a
scratchpad): claudeAiImport is a flat leaf key whose value is the object
{enabled, bannerBehavior}, gated in 3p on enabled === true.
Not tried: a real Desktop in 3p mode with the key (would mean running
Desktop against the live userData); the live Claude folders were only read.
2026-10-25 20:29:08 +08:00
yetone 07936ca890 gateway: a turn held before routing shows on Routing and is answered 504 after 2m
heyusaku6 on X: Codex desktop thought for over ten minutes on a model
served through magpie (a routing group's DeepSeek, then Qoder CN's
MiniMax, then GPT-6.1 Sol), the Routing page showed none of them, and
only restarting Codex and magpie ended it. Codex waits for a reply's
headers with no limit of its own, and a request shows on the Routing
page only once a route is begun for it, so whatever held these requests
held them before routing, in silence.

The root cause was not found. Every pre-route wait read (the classifier,
image description, plugin GatewayBegin, JS middleware, provider.Hold,
the body read, pluginrt.Refresh, the trace lock) has a bound or follows
the request's context. So this makes the stall visible and bounded
instead, and records where it was held:

- counted watches an agent's turn (Chat, Responses, Messages, Gemini
  generateContent, Codex backend /responses) while no route is begun for
  it (unrouted.go). After 15s a route of provider "magpie" shows it on
  the Routing page as routing; it gives way to the request's own route
  when one begins (noteRoute, trace.drop).
- After 2m with no route and nothing written, the client is answered
  504 in its own protocol, whole (Content-Length, Connection: close) so
  it has the error even if the handler stays stuck. The request's
  context ends with errUnrouted, its route ends with the error, and the
  log gets every goroutine's stack (at most once in 10 minutes), which
  says what held it next time.
- The handler writes through heldWriter, which drops its writes once
  magpie has answered for it.

A request waiting on another request's identical image description for
over 2m is now answered 504 too; the retry finds the description cached.

Run in the worktree at origin/main 5df62c5cd + this change:
- The stall was injected as an image description in flight that never
  ends (a never-closed s.sights entry), which holds pastedImage inside
  serve before beginFor. TestUnroutedRequestShownThenAnswered and
  TestUnroutedShownGivesWayToItsRoute are red with the watch unhooked
  from counted (the request never shows; the client waits out its 20s
  timeout) and green with it; the log's stack names describe at
  vision.go:319 under seenBody.
- go test -race -count=3 on TestUnrouted|TestVision|TestEndBroken|Busy|
  Concurrency|Trace: ok.
- gofmt -l clean; go vet ./internal/gateway on darwin, linux -tags nogui,
  windows: ok.
- go test ./internal/gateway -timeout 45m -count=1: ok (537.9s)

Rebased onto 2f44e075a (internal/agent only); at that head go build ./... and TestUnrouted: ok.

Not run: the full ./... suite (another session's full suite was running
on this machine); a real Codex desktop on Windows.
2026-10-25 20:28:36 +08:00
yetone 2f44e075a2 agent: TZ is not an agent's folder (#3600)
c888ef272 made a routing rule's hours fall back to the machine's zone,
which reads TZ in internal/provider/grouprule.go. TestFolderVarsAreListed
asks every variable those packages read to be one a sandbox clears, or to
be excused; TZ is the machine's zone, not a folder, so it is excused.

Run: go test ./internal/agent -run TestFolderVarsAreListed -count=1, ok
(red at origin/main 642d430ec per #3600, the same message).

Fixes #3600
2026-10-25 20:12:48 +08:00
yetone 5df62c5cda pii: pf-serve is pf-v2, which holds the model once on a GPU (#3590)
pf-v2 is 642d430ec's pf-serve (weights-once.patch): on Metal and
Vulkan the GGUF is read straight into the device's buffer instead of
also kept whole in a CPU copy. serveSHA pins pf-v2's five zips, each
checked against the release's SHA256SUMS.

A user who turned the model on before has pf-v1 on disk, in a folder
named for its tag. pf-v1 now still counts as installed and is run
(oldTags), and starting it fetches pf-v2 in the background (upgrade):
once fetched, the running pf-v1 is ended so the next request starts
pf-v2, and pf-v1's folder is deleted. One that can't be fetched leaves
pf-v1 running and is tried on the next start. A fresh download fetches
pf-v2 and deletes an old tag's folder.

Run:
- go test ./internal/pii ./internal/redact (ok), -run TestLoopGuard
  ./internal/gateway and -run Privacy ./internal/gui (ok, the doc and
  the settings route); go build; GOOS=linux and GOOS=windows go vet
  -tags nogui ./internal/pii; gofmt -l clean.
- TestOldServeRunsUntilUpgraded and TestUpgradeThatFailsKeepsTheOld
  are red with `go upgrade()` taken out of start (not upgraded / never
  tried) and with binDir looking at serveTag alone (the old pf-serve
  not taken for installed).
- Real: a sandbox cache with the released pf-v1 darwin-arm64 and the
  real model, pii.Find through it: pf-v1 answered, pf-v2 was fetched
  from the real release, pf-v1's folder deleted, the next request
  started pf-v2 (ps shows its path), 1664 MB phys_footprint idle.
- pf-v2's released darwin-arm64 probed alone: 1680 MB idle (pf-v1 4777
  MB), spans identical to pf-v1's; load ~1 s both, alternated 3 times.

Not tried: the upgrade on Windows, where the old folder can only be
deleted after its pf-serve ends (upgrade ends it first; a folder left
is deleted on a later start).
2026-10-25 20:03:57 +08:00
yetone 254461829b gateway: a Codex Lite request is no longer decoded whole, nor parsed twice for its facts
XiaoYin_OK on X: after a long run the app's memory climbs toward 2 GB.
The owner's own app (26h up) showed RSS 550 MB, HeapInuse 317 MB but
HeapSys 992 MB: the heap peaks while requests are in flight. Its profile
had 209 GB allocated, ~94 GB of it under codexBackend/serve, of which:
- parseResponses 24.7 GB, liftAdditionalTools 14.9 GB of it;
- factsOf 24.6 GB, reached from turnOf (13.6 GB) and dirOf (11.0 GB),
  the same conversation parsed twice per request.

Three causes, each fixed where it is:
1. liftAdditionalTools decoded the whole Lite request into maps to move
   its additional_tools item, and wrote it all again: ~7.6x the body.
   Now only that item and the tools are decoded; every other item and
   member goes byte for byte as it came, written once into one buffer.
2. affine counted the turn in the masked body while dirOf read the plain
   one, two different slices, so factsOf's memo could never serve both.
   affine now counts it in the body as the agent wrote it.
3. That body is rarely the one readRequestBody held (requestModel,
   spawnAgentModels and the lift each write a new one), so factsOf's
   memo missed for it anyway. serve now holds it (holdBody), and holdBody
   lists a body once when it is held twice.

Tests (internal/gateway/lite_lift_test.go), each red on the old code:
- TestLiteLiftMovesOnlyTheTools: same result as the old whole decode
  (liftWhole, kept in the test) on testdata/context/codex.json, the
  merged-namespace case, a 2,000-word conversation and the no-op shapes;
  an item with its keys unsorted, \u escapes and 2.50 goes as written.
  Old: the kept item came back re-sorted and re-escaped.
- TestLiteLiftAllocatesAboutTheBody: under 2x a 1.35 MB body.
  Old: 14,126,976 B (10.4x).
- TestMaskedRequestParsedOnceForItsFacts: a served masked Lite request
  is parsed once for its turn and folder (factsParsed hook in readFacts).
  Old: 2. With only change 2 it was still 2 (cause 3).

Measured (darwin/arm64, a 4,012,240 B Lite body):
- liftAdditionalTools: 30.46 MB/op, 98,560 allocs -> 5.17 MB/op, 6,609.
- readFacts of it: 54.0 MB/op -> 26.7 MB/op.
- Served through New().Handler() with masking on, 8 concurrent x 5
  rounds of a 4,010,268 B body, two runs each:
  allocated per request 215.6 / 220.7 MB -> 116.2 / 116.2 MB;
  peak HeapInuse 993 / 802 MB -> 612 / 561 MB;
  HeapSys 1001 / 892 MB -> 699 / 674 MB.
- The live app's WebKit processes were ~8-9 MB RSS each, so the webview
  is not where the memory went on macOS; the live pid sat at 476-596 MB
  RSS over a 15-minute sample.

Run at this head: gofmt -l clean; go vet ./...; GOOS=linux go vet -tags
nogui ./...; GOOS=windows go vet ./...; go build (gui and nogui);
go test -tags nogui -timeout 45m ./... in a sandbox HOME at d2e0ea393
plus this change: every package ok (internal/gateway 619s) except two
guard reds already on main and untouched here: internal/proc's
TestNoCommandBypassesProc (#3567) and internal/agent's
TestFolderVarsAreListed (TZ in grouprule.go, filed as #3600). After the
rebase onto 642d430ec (one gateway test file added upstream),
internal/gateway was run again: ok (425s), with gofmt and the three vets of it clean.
Not tried: a 26h run of the new build against real Codex traffic, and
Windows (#3383's 4.2 GB report) beyond go vet.
2026-10-25 20:02:12 +08:00
yetone 642180a809 redact: Insights › Masking and Try it mark a made-up key as a placeholder (#3599)
With "Keep a key's form" on (bea9f905d), a secret goes to the vendor as
a made-up key of its form, kept in the record as its placeholder. The
Masking page and Settings' Try it only matched {{…}}. So a request
masked that way showed no changed text: no marks, nothing side by side,
nothing lit. Try it showed the made-up key as plain text.

maskMatches (plugins/redact/page.js) matches the {{…}} placeholders and
the record's own non-{{ placeholders, longest first. A key of the same
form that the user wrote is not marked. All five page.js uses and
maskTryDraw in app.js use it. app.js grows 3 bytes.

Run at this head (origin/main 7536477c8):
- masking-records "a made-up key is marked as a placeholder is"
  (chromium/webkit, en/zh): red 4/4 on the old page.js/app.js (no
  .msk-msg drawn), green 4/4 with the fix.
- mask-actions "Try it marks a made-up key" (chromium, webkit): red 2/2
  on the old code (marks [] for [MADE, MADE]), green 2/2.
- GUI files masking-records, mask-actions, redact-*, privacy-*,
  provider-unmasked, vision-not-marked and i18n-keys, both engines,
  every language: 270 of 270 pass.
- go test ./internal/gui -run 'Budget|Assets|Script': ok.
- Rebased onto 642d430ec: six commits, and in the GUI only app.css and a
  heatmap test. Re-run at the pushed head: the budget tests ok, the six
  new GUI tests 6/6.
- Real run: a sandbox HOME with `magpie web` built from this tree,
  redact + redactShape on, a fake provider with an echo upstream, and
  "OPENAI_API_KEY=sk_w3ax…" sent through the gateway.
  - The upstream got sk_t1ns….
  - Insights › Masking marked sk_t1ns… on the vendor side and sk_w3ax…
    as written here; picking the value lit both.
  - Try it marked sk_t1ns….
  - No page errors.

Found on the way and filed: #3601. A value found by its KEY= context
is masked there only, and its other copies go as written, in either
mode.

Not tried: the old code in the real app (the GUI tests cover it), and
WebKitGTK/Windows.
2026-10-25 19:57:25 +08:00
yetone 642d430ecb native: pf-serve on a GPU reads the model once, not twice (#3590)
On a GPU (Metal, Vulkan), privacy-filter.cpp read the whole 1.6 GB
GGUF into a CPU ggml context, copied every tensor into the device's
buffer, and kept the CPU copy "as source" for as long as pf-serve ran.
#3590's Mac held 4.7 GB of physical footprint idle.

patches/weights-once.patch opens the GGUF metadata-only when the
backend isn't the CPU, and reads each tensor from the file straight
into the device's buffer through one 16 MB chunk. The CPU backend
still reads it whole and uses that buffer in place, as before.

Run: build.sh for every target on CI (privacy-filter run 40188759504,
green on all five), then a probe (start pf-serve, classify 7 texts in
en/zh/code/cards plus a 57K and a 20K text, 20 hot requests, 3 long
ones, read memory after 5 s idle) on the released pf-v1 and on this
commit's CI build, with the pinned model (sha256 80efc180…):

  Mac M4 Pro, Metal, GGML_METAL_NO_RESIDENCY=1 as magpie starts it:
    idle phys_footprint 4777 MB -> 1683 MB, RSS 4798 -> 1706 MB
    hot request median 9.0/13.8 ms -> 10.8/9.9 ms (two runs each,
    load average ~180, so noisy); long 1.5-1.9 s both
  Mac, CPU: 1852 MB both, as before
  Windows, AMD 8060S, Vulkan:
    private bytes 6629 MB -> 1968 MB, working set 3258 -> 174 MB
    hot median 4.2-4.7 ms both, long 0.79-0.85 s both, load 1.2 -> 0.8 s
  Windows, CPU: 1810 MB working set both

The spans are byte-identical before and after on each backend (Metal,
Mac CPU, Vulkan, Windows CPU; each backend's own as before).

Not tried: Linux's pf-serve-vulkan on a real GPU (the same code path
as Windows' Vulkan); linux-arm64 and darwin-amd64 run on the CPU only,
which this doesn't change, and were only built.
2026-10-25 19:52:47 +08:00
yetone 83571db8ed provider: Command Code's plugin is at least 0.1.17, its Credits bar second where magpie shows two windows (01huadalang on Discord)
01huadalang said the Command Code card has no bar for the total quota
left. The Providers account line (quotaLine) and the menu bar
(trayusage) show a provider's first two windows. A plan account's
plugin reported [5 hours, Weekly, Credits], so the dollars were only
in the tooltip. Plugin 0.1.17 (plugins 8531ccc) puts Credits second,
after the 5 hours. The min goes to 0.1.17 so keepMovedCurrent updates
every moved user.

npm view @magpie-community/opencode-commandcode-auth --prefer-online:
latest 0.1.17, published by publish.yml run 40186792179 with provenance
(its npm job is red only on think-tags 0.1.1's known E404, plugins#180).
The plugin's bun test: 65 pass. The plugin's auth.usage, against the
owner's real GOAT account: 5 hours 0.93%, Credits $0.63 / $70.00,
Weekly 1.20% (before: 5 hours, Weekly, Credits). Plugins PR #303 was
reviewed and not merged (it loses the $ on today's magpie and adds no
bar); see its comment.

At the pushed head (this and the provider commit, rebased on
origin/main 758be6d14): go test -tags nogui -count=1 ./internal/gui
./internal/provider in a sandbox HOME: ok (67.5s, 133.5s); gofmt -l
clean; go vet ./internal/gui ./internal/provider ok; go build ./...
(mac) ok; heatmap-scrollbar, usage-heatmap, view-scrollbar and
view-wheel-unheard .test.cjs at 7ad6df865: 38 pass, 0 fail. Before the rebase, at
30bd722ef on d2e0ea393: the same two packages ok (84.9s, 157.1s), and
go vet ./... for mac, GOOS=linux -tags nogui and GOOS=windows ok, with
linux nogui and windows go build ok.
Not run: the full suite (the disk was full). Not tried: a sandbox magpie
showing the bar on the account line. No test fails without a min
bump; the plugin's usage test holds the order.
2026-10-25 19:40:37 +08:00
yetone 47689f9fd9 gui: the usage heatmap scrolls under the app's thin thumb, not the system's bar (cybercaius on Discord)
cybercaius said the usage heatmap's scrollbar looked out of place beside
the rest of the window. .heat-scroll was the only scroller with
scrollbar-width: thin. In Chromium (so WebView2) a non-auto
scrollbar-width drops every ::-webkit-scrollbar rule and draws the
system's bar, gray track and all; on a Mac the WebView draws only the
overlay bar, which a mouse never shows. The line is gone, and the Mac
rules pages, dialogs and framed editors use take .heat-scroll too, so
the weeks scroll under the same 8px (Mac) or 10px thumb as the page.
No layout change.

heatmap-scrollbar.test.cjs: chromium and webkit, on and off a Mac, a
420px card of 53 weeks: the weeks overflow, scrollbar-width is auto,
and the heatmap's bar gutter equals a .view's.

What was run, at this commit's tree (base d2e0ea393):
- heatmap-scrollbar.test.cjs: red on the old app.css in all 4 cases
  ("expected 'auto', actual 'thin'"); dropping only scrollbar-width
  still fails the 2 Mac cases; 4/4 pass with the change.
- usage-heatmap.test.cjs (every language, 420 and 1100px, both
  engines): 26 pass, 0 fail.
- view-scrollbar, view-scrollbar-drag, sidebar-overlay-scrollbar,
  strip-scrollbar, ledger-hscroll, ledger-hscroll-foot, click-scroll and
  every usage-*.test.cjs: 3 reds, none from this change:
  usage-agents-hide (chromium and webkit, 10 subtests each) fails the
  same 22 of 22 on d2e0ea393's app.css (#3414, #2276);
  sidebar-overlay-scrollbar chromium fails one language per run
  ("dragged to the end: 193 of 222") on the old and new app.css alike,
  4 runs each way (#1863).
- Screenshots off and on a Mac, old and new: the system bar before, the
  page's thumb after.
- At the pushed head (this and the provider commit, rebased on
  origin/main 758be6d14): go test -tags nogui -count=1 ./internal/gui
  ./internal/provider in a sandbox HOME: ok (67.5s, 133.5s); gofmt -l
  clean; go vet ./internal/gui ./internal/provider ok; go build ./...
  (mac) ok; heatmap-scrollbar, usage-heatmap, view-scrollbar and
  view-wheel-unheard .test.cjs at 7ad6df865: 38 pass, 0 fail. Before the rebase, at
  30bd722ef on d2e0ea393: the same two packages ok (84.9s, 157.1s), and
  go vet ./... for mac, GOOS=linux -tags nogui and GOOS=windows ok, with
  linux nogui and windows go build ok.
  Not run: the full suite (the disk was full).
2026-10-25 19:40:37 +08:00
yetone 758be6d14e library: magpie-setup is first in the market's skills, so an agent can set magpie up as asked
Leyuu_5 on X: "功能越来越多,感觉可以来个skill让AI来帮设置需求了". The skill
lives in magpie-community/plugins (skills/magpie-setup, e513644) and
teaches an agent to turn a request into magpie's own commands. Listing
it in featuredSkills puts it first under Library › Market › Skills,
official, one click to add, with no setup.

What was run at this head:
- go test ./internal/library ./internal/cli: ok (library's first run
  failed only with "no space left on device" while writing testlog.txt;
  run again on its own: ok 193.7s)
- TestFeaturedSkills extended: magpie-setup first, quota second, both
  Official/Featured with a description; "setup", "routing" and
  "gateway key" find magpie-setup first, "quota" finds magpie-quota
  and not setup. Red with magpie-setup taken out of the list.
- gofmt -l internal/: empty; go vet (darwin), GOOS=linux go vet -tags
  nogui, GOOS=windows go vet on internal/library and internal/cli; go build
- library.InstallMarketSkill("magpie-community/plugins", "magpie-setup")
  in a sandbox HOME against the pushed plugins repo: Installed
  [magpie-setup], SKILL.md in library/skills/magpie-setup.
Not run: the full ./... suite (the disk had under 1GB free), the GUI
suite (no GUI asset changed; market-featured-skill.test.cjs fakes the
list).
2026-10-25 19:34:55 +08:00
yetone fba554c7f8 library: magpie library mcp add without agents= says the server went to no agent
A server added with no agents= is kept in the library and given to no
agent, but the command printed "✓ every agent already has it". It now
says "<name> is in the library, given to no agent yet" and names
`magpie library mcp agents <name> <a,b…>`. With agents=, and for
`mcp agents`, the output is as before ("written into claude").
Found while trying the magpie-setup skill's commands in a sandbox HOME.

Not changed (#3598): `library instructions set` with no agents chosen still
prints "every agent already has it" while no agent is given it.
Instructions have sets, so its check needs the active set's agents.

Run: go test ./internal/cli -run TestLibrary -count=1 ok; the new
TestLibraryMCPAddNoAgents fails on the old library_cli.go (reverted by
hand: "✓ every agent already has it") and passes with it. go vet
./internal/cli and gofmt -l clean.
2026-10-25 19:34:55 +08:00
yetone 6bffcfe178 gateway-key: a key's monthly limit can be set from the CLI again
`magpie gateway-key limit <id> month --cost 5` (and `add month`) failed
with "an N-hour cycle is a whole number of hours …: \"month\"":
parseKeyLimit cut an h off any window ending in one before it looked
for a named period, and month ends in an h. A named period (day, week,
month) is now taken as itself before the <N>d and <N>h forms are read.
Found while trying every command for the magpie-setup skill in a
sandbox HOME.

Run: go test ./internal/cli -run TestGatewayKey -count=1 ok; the new
month cases in TestGatewayKeyLimitCLI fail on the old parseKeyLimit
(reverted by hand) and pass with it. Tried the built binary in a
sandbox HOME: limit <id> month --cost 5 sets "this month".
2026-10-25 19:34:55 +08:00
yetone 7536477c8e gui: the Dock icon flaps its wing and tail as the header logo does
Clicking magpie's Dock icon plays the header logo's .logo.wag on the
tile: the same keyframes, turn points, .9s and cubic-bezier(.3, 0, .3, 1),
a frame every 30ms. The icon macOS draws (its glass tile and glossy bird)
is cut into body, tail and wing by index.html's own clip paths, the tile
under the bird filled with the tile's colour read either side of it, and
each frame turns the pieces over it, set as the Dock tile's content view.
The tile goes back to the system's icon after. It plays only when the
Dock draws icons light (no AppleIconAppearanceTheme, RegularLight, or
RegularAutomatic in light mode); a dark, clear or tinted Dock is left as
it is. A click while it plays doesn't start another.

Run:
- go test ./internal/gui/ -run TestDockFlap: TestDockFlapIsTheLogos holds
  the keyframes, origins, length and easing to app.css and parses the
  bird and clips out of the embedded index.html. Broken by hand: changing
  one keyframe in flapkeys.go turns it red.
- TestDockFlapFrames (MAGPIE_DOCK_APP=/Applications/magpie.app) wrote the
  31 frames; looked at by eye. Frame 0 against the system's own 512px
  render: inside the tile 0.03% of pixels differ by over 40/255 (the
  tile's rim resampled); the pieces' seams were visible until they
  overlapped by 1px.
- A sandbox bundle (own bundle id, sandbox HOME, ports 3446/3447) got the
  Dock's reopen event by pid: a burst of screen captures of the real Dock
  shows the tile in different poses.
- go vet ./internal/gui/, GOOS=windows go vet, GOOS=linux go vet -tags
  nogui, GOOS=linux go build -tags nogui, GOOS=windows go build, gofmt -l.

Not tried: a dark or tinted Dock (skipped by the gate, not drawn), a
real mouse click on the Dock (the same reopen event, sent by pid).
2026-10-25 19:28:05 +08:00
yetone 7ad6df865c whatsnew: many releases' notes read as one list, by kind
The owner: nine releases of a line each, in the update sheet's "What
changed since v0.1.1521", read as a scattered list. When more than one
release is shown, their notes are now merged: a line saying the range
("9 releases · v0.1.1522 – v0.1.1530"), then one heading per kind (New
features, Improvements, Performance, Bug fixes, Security, Provider
changes, Changes, Documentation, then any heading of their own) with how
many lines it has, each line with the version it came in, newest first.
A line two releases both carry is said once, at the newest; a line with
no heading goes under Changes. One release reads as before. Both the
update sheet and What's new (after an update, and Settings' range
picker) merge; the not-installed badge names its range.

Run at this tree (rebased on origin/main 2c7f0ac12):
- GUI, Chromium and WebKit: whats-new 4/4, whats-new-range 12/12 (all
  five languages), update-notes-ask 12/12, whats-new-failed 4/4,
  i18n-keys 4/4, update-release-page 22/22, update-auto 10/10.
- go test -count=1 ./internal/gui: ok. Budgets raised to the bytes:
  app.js 1,326,105, core 1,537,016, no room added.
- Broken by hand: merging a single release turns "one release is shown
  by itself" red; dropping the de-duplication turns "the sheet names a
  release out since the download" red.

Not run: the full Go suite (other sessions' suites on this machine, and
the disk filled mid-run); the GUI suite beyond these files; the real app.
2026-10-25 19:26:17 +08:00
yetone db6d1540ef redact: eval cases that reach more of modelTakes/modelFits
TestMaskEval's cases reached 5 of the 36 checks on model spans: breaking
any other one by hand left it green. This adds 21 cases (39 to 60), most
of them texts from modelfits_test.go and vendorchecks_test.go, the
places the model was seen misreading, and records the real model's spans
on them (testdata/eval-model.json).

Breaking each check by hand (breaks.py: one replacement in model.go,
TestMaskEval run, file restored) now turns 13 red (5 before):
secret-madeID, person-2runes, email-realEmail, person-zhTrim,
person-assistant, account-numberLike, account-cue, address-letter,
secret-wordstart, secret-uuid, secret-hexwords, secret-hexcue,
edge-delimiter.

Still green, because the real model gives no such span on any text tried
(24 more probed) or another check catches the same span first:
secret-namesThing, secret-len8, person-snakeWord, account-madeID,
cut-from-word, person-chars, person-filedot, person-pathpart,
person-colon, person-lowerword (person-chars keeps the same lower-case
word), account-hex, account-version, the four phone checks, secret-pattern,
secret-json, secret-link, secret-base64, email-wordstart, email-modcache,
email-userinfo. Their unit tests in modelfits_test.go still cover them
with recorded spans.

A new real miss: "hex40 ok? 1 <sha1>" is one secret span "1 <sha1>" to
the model, and the hex-words check only looks at the first field. Filed
as #3597 and marked Known.

Totals at this head (rules / model / both, masked and wrongly):
16/40 0/89, 38/40 28/89, 39/40 1/89.

Run: MAGPIE_EVAL_CACHE=$HOME/.cache go test -run TestMaskEval -v
./internal/redact (recorded, then replayed green); go test -count=1
./internal/redact ./internal/pii ok; go vet ./internal/redact for darwin,
linux and windows; gofmt -l clean; breaks.py over all 36 checks.
Not tried: the full suite (only test files changed in internal/redact).
2026-10-25 19:17:53 +08:00
yetone dc6f3d496c masking: the flow's logos sit on one disc each, before the name on both sides
Insights › Masking's flow card showed each agent's and provider's logo
bare in a 16px box. A logo's own drawing fills that box or not (Pi's
edge to edge, Codex's a small tile, Alma's a picture), so three logos
of one box read as three sizes (the owner's screenshot). And an
agent's logo came after its right-aligned name, so the logos and the
names on that side lined up with nothing.

- Every logo sits 14px on a 24px disc (card fill, hairline ring), the
  disc the app's agent stacks use.
- Both sides read logo, then name over count, left-aligned. The
  agents' nodes are one block against the lines (a grid track as wide
  as the widest), so their logos make one column and their names one
  edge, as the providers' do.

Run (rebased on origin/main of 19:00, 10-25):
- masking-records.test.cjs: 52/52, Chromium and WebKit, 5 languages,
  1100px and 640px. Its flow check now asserts logo before name on
  both sides, a 24px round disc for every logo, and one column of
  logos and one edge of names per side.
- Screenshots with the owner's case (Pi, Codex, Alma → OpenRouter,
  Codex, OpenCode Zen), dark, 1x and 2x, looked at.

Broken by hand: the agent's logo back after its name turns
masking-records red ("the logo before the name").

Not tried: the light theme by eye (the disc is drawn from theme
tokens), the real app on WebKitGTK or Windows. Budgets untouched:
plugins/redact isn't in the core.
2026-10-25 19:14:47 +08:00
yetone 30d3001a04 gui: a wheel or coast macOS 13's WebKit never tells the page of still scrolls the view (issenn on Discord)
issenn, on macOS 13.7.8 (system WebKit 18615, Safari 16.6's): no page of
the window scrolls by trackpad or mouse wheel, the bar doesn't move, a
forced trackpad scroll shakes and snaps back, and only dragging the bar
works.

Cause (hedged, not seen on a real WebKit 16.6): the view guard puts back
every .view scroll outside a window the reader's own events open (wheel,
touch, keys, scrollOnPurpose). The bar's drag goes past it (barDrag),
which is why that alone works. WebKit 16.x can scroll a view under a
wheel or a coast it never dispatches to the page (WebKit bug 256582,
Safari 16.4.1: monitorEvents(window) showed no wheel over some
elements). With no wheel heard, no window opens, and every reader scroll
is taken as code's and put back. That is the shake, and the v0.1.1488
coast chain couldn't help, since it starts from a heard wheel.

Fix, in puttingBack: three put-backs on one view in one direction within
a second, with no click holding (held), are the reader's. They are given
back, and the fling window opens. Each later put-back the same way
within a second of the last is given back at once. So a wheel turned
slowly, or one run broken on a loaded Mac, loses no step. A scroll by
code happens once and makes no run: two at rest are still put back, and
scrolls a click holds against still are. On a WebKit that does dispatch
the wheel, nothing changes: the wheel opens the window first and
nothing is put back. To stay under appScriptBudget with no raise, the
guard header's click bullet was shortened, and its detail moved to
gui-shell.md.

Test: view-wheel-unheard.test.cjs (Chromium and WebKit, en and zh). A
capture listener stops every wheel before app.js hears it. Then:
- ten fast 20px wheels must move the view 190px or more;
- five notches 400ms apart must land, down and back up;
- six wheels up must bring it back;
- two code scrolls at rest are still put back;
- after a click on an agent row, a code scroll each frame leaves the
  row in place.

Run:
- At origin/main d2e0ea393: red 6/6 ("left at 0" before the slow case
  was added, "five slow notches" after).
- With the first version of this fix (a 150ms chain): red 6/6 on the
  slow notches. On a loaded box its fast case also lost a run (left at
  160).
- Broken by hand. With the held gate removed: red 6/6 ("the row clicked
  stays: at 311.5 ..., 191.5 once at rest"). With the continuation
  removed: red ("five slow notches").
- With the fix: green 6/6.
- go test -tags nogui -run Budget ./internal/gui: ok at the rebased head
  (app.js 1,323,345 of 1,323,401).
- GUI, the 27 files a view's scroll reaches (scroll, view-*, click-*,
  old-webkit, update-auto, routing-days-fit, routing-failed-open,
  text-size, sidebar, last-page), both engines, every language, under
  the suite lock: 306 pass, 15 fail. Every red fails the same way at
  origin/main 0cba7fa68, run in a base worktree:
  - sidebar.test, the masking tab (#3498);
  - menu-input-scroll, chromium (#3402);
  - old-webkit's :has() in app.css (#3403).
  An earlier run also had sidebar-overlay-scrollbar webkit (#1863) and
  menu-input-scroll webkit red under load, on base too. Both passed on
  this run.

Not tried: a real macOS 13 / WebKit 16.6 (none runs on this macOS 26.2),
a real trackpad, the whole GUI suite. A click followed within 4s by a
wheel the page never hears still holds the click's row, since a
put-back while held is never given back.
2026-10-25 19:08:53 +08:00
yetone 2c7f0ac12c plugin: options saved from a hooks package's own page reach its hook
SetPageOptions saved without starting the host again for any package whose
page and panels looked like all it had. Window() only reads main/exports,
so a package with magpie.hooks and a page (magpie-community/plugins#117's
PowerContext) counted as page-only. The host hands each hook the options it
loaded with, so a Service URL or key saved from the page did nothing until
magpie restarted. A gateway hook now goes through SetOptions, as a
middleware and an agent already did.

Run at d2e0ea393 plus this change:
- TestGatewayHookSeesOptionsSavedFromItsPage: red on the old page.go
  ("tag=first after the page saved, want second"), green with the fix.
- go test -tags nogui ./internal/plugin: ok (118s).
- go test -tags nogui -run 'TestAsyncGateway|TestGatewayHook' ./internal/gateway: ok.
- go test -tags nogui -run 'Page|Plugin' ./internal/gui: ok.
- GOOS=linux and GOOS=windows go vet of internal/plugin and internal/gateway; gofmt -l clean.
- The real PowerContext package (PR head 3a6aa8f rebased on plugins main)
  in the real Bun host behind New().Handler(): before the fix a page save
  sent nothing to the new server; after it, the next request resolved,
  prepared and hinted against the new server with the new key.
Not run: the full go test ./... (machine at load ~340).
2026-10-25 19:06:34 +08:00
yetone d2e0ea393d pii: pf-serve starts with ggml's Metal residency heartbeat off (#3185)
macOS's Energy Impact puts magpie at the top while CPU stays at ~6%
(#3185). Energy Impact counts wakeups, and an idle pf-serve (the
privacy filter's llama.cpp child) woke 134-146 times a second: ggml's
Metal backend keeps a residency set alive with a heartbeat. pf-serve
stays up for 10 minutes after each masked request, so any masking user
pays that most of the day. GGML_METAL_NO_RESIDENCY=1 turns the residency
set off.

Measured with proc_pid_rusage (ri_interrupt_wkups, ri_energy_nj) on an
M4 Pro, idle pf-serve, 20s windows:
- before, pf-serve pf-v1 as magpie starts it today: 140.0 and 138.5
  wakeups/s, 2.67 mW; the user's live v0.1.1370 pf-serve child read
  134-142/s
- after, pf-serve started through pii.Find at this commit: 0.4, 0.3,
  0.3 wakeups/s, 0.02 mW
- GGML_METAL_RESIDENCY_KEEP_ALIVE_S=0 or 1 instead: 143-146/s, no help
- latency: hot requests 51-78ms either way; the first request after a
  5-60s idle spell 57-77ms before, 105-518ms after; 90s idle through
  pii.Find at this commit 56-183ms

Run at this commit:
- go test -count=1 ./internal/pii/ ok;
  TestServeStartsWithoutResidencyHeartbeat red with the env line put
  back to os.Environ() ("residency " on both starts), green with it
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/pii/ ok,
  gofmt -l clean

Also measured: current main in a sandbox HOME with clones of the real
Claude/Codex sessions and magpie cache (no logins), window open, after
warm-up: main process 1.1-2.2 wakeups/s, 0.9-1.9 mW; its WebContent
0.5/s and GPU 0.3/s. The app.js intervals and the Go tickers were read
and are already held while the document is hidden or cheap.

Not tried: the full suite (an env-only change to one package); a
logged-in instance. The user's live v0.1.1370 main process reads 69-217
wakeups/s and 25-120 mW, which the sandbox at main (no logins) doesn't
reproduce, so its source is still unknown; Vulkan/Linux pf-serve (the
variable is Metal's only and ignored there).
2026-10-25 18:40:25 +08:00
yetone 0cba7fa680 provider: ZCode's mover min is 0.1.30 (plugins #387)
zcode 0.1.30 (plugins 57598ad) puts metadata.user_id
{"device_id":<sign-in's device>,"account_uuid":"","session_id":""} on a
GLM Coding Plan or team Messages request when the agent sent none, as
ZCode 3.14.3's client does on every Anthropic-format request
(glm/zcode.cjs Pst/MLs, vWr); before, only the Start Plan's dressed body
carried it. A key-only account's device is hashed from the key, the same
on every start. keepMovedCurrent brings every moved user up to it.

npm view --prefer-online @magpie-community/opencode-zcode-auth version:
0.1.30 when this landed.
Run at this tree: go test ./internal/provider/ -run
'Mover|Move|Moved|Migrat|ZCode|Retir|Adopt|HandOver' -count=1 -> ok.
Not run: the full suite (a one-line min change).
2026-10-25 18:34:27 +08:00
yetone 09c0a844bd gui: the tray panel draws its last allowances at once and asks for them beside the state (#3160, #3134)
The panel's Allowances tab stood on skeletons until the whole /api/state
had been read and only then asked /api/usage/quotas: the request trace on
the old code shows the quotas GET starting after the state ends every
time (state 216+73ms, quotas at 321ms; a run whose state took 2704ms
asked at 2825ms). On a machine with many agents the state alone is
seconds, and the vendors' reads came after it.

- The panel keeps the allowances last read in its webview's storage
  (magpie.panelQuotas) and draws them at once, each card's refresh
  turning (.quota-refresh.reading) until the read lands in their place
  (yiliang114's stale-while-revalidate, #3160). Kept cards wait for a
  state, the kept ?last=1 one or the read one, to say which are hidden.
- The first load asks for the allowances beside the state, not after it
  (panelQuotasNow, the same opened/not-opened rule as before, #1588).
- The core budgets go to the new size: the tray panel's, the core's own.
  84c50f032 had left app.js 4 bytes over the budget on main
  (TestCoreScriptBudget red there); the new size counts them.

Measured (sandbox HOME, deepseek's real key and balance, dev build of
the old and new code on their own ports, playwright opening
/?mode=panel on the Allowances tab at 360px, 14 runs each, old and new
interleaved, load ~180), median ms from DOMContentLoaded to cards drawn:
  Chromium 347 -> 160, WebKit 723 -> 211
(whole open, dominated by script load at this load: Chromium 5049 ->
2646, WebKit 7282 -> 4507).

Run at this head (rebased on f1537d9f9; the budget test and
panel-quota-kept again after the rebase): panel-quota-kept 20/20 (Chromium and WebKit, en zh
zh-TW ja de, 440 and 360px); red on the old assets (TimeoutError,
nothing drawn) and red with the early ask taken out by hand (the
allowances asked before the state assertion). panel-quota-lazy and
panel-quota-refresh 40/40; every panel-* and quota-* file and
i18n-keys pass except quota-count-wrap's WebKit case, red the same on
origin/main 11907448e (#2228, #3404). go test -timeout 45m
./internal/gui ok; GOOS=linux and windows go vet -tags nogui ok;
gofmt clean.

Not tried: clicking the real tray icon (System Events scripting failed
here); the 53 other test files that open mode=panel (running after
push); a real Codex or Claude account (deepseek only); Windows and
Linux webviews.
2026-10-25 18:31:33 +08:00
yetone f1537d9f95 context: the map counts on as a live request grows, and keeps its tip
The owner asked for the rest of what flohoeller's context map on X does,
keeping the A1 colours. On a live request's redraw:

- Every token count (the big number, the short head, the legend, each
  tile's value) counts on from what it said to the new value over 620ms
  (ease-out), instead of jumping. morph rolls any element with data-n;
  a tile's value rolls as the tile glides. With motion reduced, or on a
  first draw, the value is simply set.
- A tile pointed at keeps its tip through the redraw: the tip is told
  again with what the tile holds now and kept over it while it glides
  (followTip). Before, every redraw closed it.
- A tool's gathered results say how many ("exec_command ×20"), and the
  small files gathered into one tile name the folder they share
  ("api/ · 6 files") where they share one; otherwise "N more" as before.
  "{n} files" is translated (zh, zh-TW, ja, de).

A frame's time can be before the roll's start, which made the first
frame count back (40K, 39.8K, 40.7K); the progress is clamped at 0.

coreScriptBudget: 1,530,631 to 1,533,445: 2,810 bytes of context.js
(which the Routing page draws as well as Usage) and 4 bytes 84c50f032
added to app.js without raising it, which left TestCoreScriptBudget red
on main (1,530,635 > 1,530,631). With no room added.

Run:
- New tests/context-map-live.test.cjs, chromium and webkit, en zh zh-TW
  ja de, at 1100 and 420px, plus motion reduced: 22/22. Broken by hand:
  closing the tip in fill went red ("the tip closed as the request
  grew"); rolls forced quiet went red ("the count jumped: 48K").
- Every context, routing-ctx and i18n GUI file (context-map, -picks,
  -scroll-end, -text, -tune, -window, group-context, i18n-keys,
  routing-context-fold, routing-ctx-fold, routing-ctx-still, and the new
  one): 268/268.
- go test ./internal/gui: ok (220s) before the rebase onto 84c50f032;
  at the pushed head TestCoreScriptBudget, TestAppScriptBudget and the
  TestI18n tests: ok.

Not run: the full Go suite (two other sessions' suites were running on
this machine); the rest of the GUI suite.
2026-10-25 18:28:06 +08:00
yetone b30734f964 sessions: Antigravity CLI (agy) conversations are listed, with title, folder, tokens and resume (RickyWei, #1718)
agy's conversations were on no Sessions page: internal/sessions had no
lister for them, only the calls reader of #2097. Now each
~/.gemini/antigravity-cli/brain/<id>/.system_generated/logs/transcript_full.jsonl
is a session (agy.go). Its steps give the start and last times, the first
prompt (taken out of agy's <USER_REQUEST> wrapper), prompts, replies, tool
calls, and tokens under the model "agy", since no step names one. A step
written again replaces its tokens, read on or read whole. The title and
folder come from the conversation's conversation_summaries.db row:
title, and workspace_uris through agyFolder, which turns file:///C:/... and
file:///c%3A/... into C:\... and a host into \\host\share on Windows. agy
writes the title after the transcript, so the row is the file's rev. The
database is read again only when it or its -wal changed, and a failed read
keeps the rows read before. A row with conversations/<id>.db and no
transcript (#1718's case) is listed from the row alone, with no tokens and
no conversation to open. Resume is "agy --conversation <id>". When agy is
set to use magpie, it is the agent's launch command (gateway variables and
--model, the PowerShell form on Windows) with --conversation after it,
through sessions.AgyStart, which package agent sets. The transcript (user
text, thinking, text, tool calls, tool results) can be opened and searched.

Format read from real files: agy 1.3.5 and 1.4.7 in a sandbox HOME
against a fake Gemini endpoint, with plain replies, a read_file tool call
with thinking, invalid tool calls, and a conversation picked up again with
--conversation from another folder. testdata/agy-sessions is three of
those conversations with paths rewritten to /work.

Resume tried for real in the sandbox: `agy --conversation <id> -p again`
from another folder appended steps 2-4 to the same transcript and kept the
row's folder. Interactive `agy --conversation <id>` (in tmux) showed the
earlier turns.

Run at this tree, rebased on origin/main:
- gofmt -l internal clean
- go vet: darwin; GOOS=linux -tags nogui; GOOS=windows
- GOOS=windows go build ./...; GOOS=linux go build -tags nogui ./...
- go test -count=1 ./internal/sessions ./internal/gui ./internal/agent: ok
  before the row-only change. After it, sessions ok, and gui had one red,
  TestMainWindowCorners killed at its 40s deadline at load ~300 (#1936).
  It passes alone (47s).
- GUI (playwright 1.62.0, chromium and webkit, en and zh): i18n-keys,
  gui-de, gui-ja, gui-zh-tw, session-terminal, sessions-bar-names,
  sessions-manage, sessions-talk, sessions-toolbar: 49 of 49. No GUI asset
  changed. Tab names come from the agent registry.

Fails without the change (broken by hand, each one red):
- agyFiles out of allFiles: TestAgySessions, TestAgyTitleLater, TestAgyTranscript
- agy out of refresh's DBRevision check: TestAgyTitleLater
- no dropUse of a rewritten step: TestAgyGrows (4510 input, want 3010)
- AgyStart ignored: TestAgySessions (wired resume)
- drive letter not handled: TestAgyFolder
- agy out of HasTranscript: TestAgySessions, TestAgyTranscript
- the row-only listing off: TestAgyRowOnly; readable() off: TestAgyRowOnly

Not tried: agy on Windows. The Windows box (10.0.0.132) didn't answer
ssh, so the Windows paths are covered by unit tests only (agyFolder,
the Set-Location resume form). A wired resume through magpie's real
gateway was not tried. Not done: subagents (parent_conversation_id),
which I never saw agy write. The model name, which is only in
conversations/<id>.db's protobuf (#3147). Deleting an agy session from magpie. agy in WSL: #3595.

Side effect: agy's self-updater ran in the sandbox and replaced the
live ~/.local/bin/agy, 1.3.5 -> 1.4.7.
2026-10-25 18:24:20 +08:00
yetone 84c50f0328 update: an old "up to date" isn't said, and Settings' Version row asks again (RickyWei)
RickyWei (Discord, Windows, Chinese UI): Settings > 关于 said 版本 0.1.1402 ·
已是最新 with v0.1.1517 out on yetone/magpie-releases.

Cause, from the v0.1.1402 code (internal/gui/update.go is unchanged since):
state "latest" is set only when a check that worked found nothing newer,
and a failed read is state "error" ("Couldn't check for updates"), so the
row's claim is the answer of one check. Nothing aged it: the state stayed
"latest" until the next check, and the row only read it. v0.1.1402 was the
newest release from 13:14 to 13:37 UTC on 10-24 (v0.1.1403 at 13:37), so
a check then said up to date, and with automatic checks off (Settings'
"only when asked") or once a day that stood for the next day while ~115
releases went out. The feed itself is right: usemagpie.ai/api/latest,
with ?lang=zh too, answers 0.1.1517 (gh release list agrees), the version
order is numeric, and nothing on Windows skips the check. Hedged: the
user's settings aren't known, so the interval is inferred, not seen.

Now:
- jsonIn reports a "latest" older than freshAfter (5 min) as "" (not
  asked lately), so no surface says up to date from an old answer.
- GET /api/update?fresh=1, which only Settings' Version row sends, asks
  the feed again over a stale "latest" with automatic updates on; the row
  shows checking and reads again. With them off nothing is asked by
  itself, and the row says "Automatic updates are off" with Check.
  The header pill's reads don't ask, so the feed's cadence is unchanged
  for a window left open.
- app.js stays inside TestCoreScriptBudget: a comment word went.

Run, at this tree:
- TestStaleLatestIsNotUpToDate (new): 1402 checked while newest, then
  the feed at 1517 and the answer aged past freshAfter: the plain read
  isn't "latest" and asks nothing, the row's read finds 1517
  ("available"); with automatic updates off it is "" and asks nothing.
  Red on origin/main's update.go ("an old answer still says up to date"),
  green with it.
- update-check.test.cjs asserts the row reads with fresh=1: red on
  origin/main's app.js (4 of 4 language/engine cases), green now.
- go test -tags nogui ./internal/gui ./internal/update (sandbox HOME): ok.
- The 21 GUI files that fake /api/update plus i18n-keys, Chromium and
  WebKit, en/zh where they cover them: 299 of 300 pass. The red is
  header-centre webkit (ResizeObserver loop as a page error), red the
  same on untouched origin/main d58053720 2 of 2, filed as #3479.
- gofmt -l, go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./..., go build: clean.

Rebased onto c888ef272 after that run: go test -tags nogui ./internal/gui
./internal/update (TestCoreScriptBudget in it), the Windows and Linux
vet of internal/gui and gofmt again there: ok.

Not tried: the full go test ./... and the whole GUI suite (load ~160);
a real Windows install; the clock's monotonic reading across a Mac or
Linux sleep (Windows' InterruptTime counts sleep, so it isn't this case).
A v0.1.1402 that says up to date finds the update with a click on 检查
(the click asks the feed itself); one with automatic checks off keeps
needing that click, or a download from usemagpie.ai.
2026-10-25 18:22:13 +08:00
yetone c888ef2725 routing: a rule's hours are kept in the zone they were set in (gaubeebangeel on X)
magpie on a cloud server in UTC read a routing group's rule hours on the
server's clock, so a Beijing user's 09:00-18:00 held at 17:00-02:00
Beijing time, with nothing saying so.

- provider.TimeWindow carries the IANA zone its hours were set in
  ("zone": "Asia/Shanghai", omitempty). Holds reads From, To and Days in
  that zone (time.LoadLocation, cached; Go's embedded tzdata, so Windows
  knows them too). A window with no zone, every one saved before this,
  stays on magpie's own clock (time.Local) as before. A zone magpie
  doesn't know is refused on save (clean); one in a file edited by hand
  makes the window never hold, so the rule is as if absent, never always
  on and never hours off. Text() adds " (Zone)"; Line() writes tz=.
- GUI: changing a rule's hours or days in the editor saves the browser's
  zone (Intl resolvedOptions().timeZone); hours left alone keep theirs.
  /api/groups gives magpie's clock (clock: zone, offset in seconds), and
  when its offset differs from the hours' zone the Routing page tells the
  zone beside them, on the group's rules and in the editor: "Asia/Shanghai
  time" (zh "Asia/Shanghai 时间"), or "server time, UTC+0" (zh "服务器时间
  UTC+0") for hours with no zone. Nothing is added when the clocks agree.
  zh, zh-TW, ja, de.
- CLI and TUI: time=09:00-18:00@Asia/Shanghai or tz=Asia/Shanghai; with
  none, this computer's zone ($TZ, time.Local, the /etc/localtime link)
  when it has an IANA name, otherwise none (magpie's clock). An unknown
  zone is refused with what one looks like; tz= alone needs time= or
  days=. Usage text updated.
- docs/subsystems/gateway-routing.md: the zone rules.

Older magpie reading a shared or synced group ignores zone and reads the
hours on its own clock, as before.

Run in a sandbox HOME with pinned Go caches, first at base 9277c2567,
then again after the rebase onto origin/main d58053720 (vet, builds, the five packages,
routing-time-zone and i18n-keys all ok again there; then rebased onto
11907448e, which changes migrate_side.go and sessions only, and
internal/provider ok again, 139s):
- gofmt -l on the changed files: nothing. go vet ./..., GOOS=linux go vet
  -tags nogui ./..., GOOS=windows go vet ./...: clean. go build, GOOS=linux
  go build -tags nogui, GOOS=windows go build: ok.
- go test -timeout 45m -count=1 ./internal/provider ./internal/cli
  ./internal/tui ./internal/gui ./internal/gateway: all ok (provider 170s,
  cli 64s, tui 30s, gui 192s, gateway 513s; after the rebase 180s, 62s,
  25s, 181s, 568s); logs kept whole and grepped, no FAIL.
- New tests: TestRuleTimeWindowInItsZone (window, past midnight and days
  in a zone, instants in UTC), TestRuleTimeWindowWithoutZoneIsLocal,
  TestRuleTimeWindowUnknownZone, TestParseRuleTimeZone, TestRuleInZoneHere,
  TestGroupRuleTimeZoneCmd, TestRuleTimeWindowInItsZoneAtTurnStart
  (gateway, ruleClock in UTC). Run under TZ=UTC, TZ=Asia/Shanghai and
  TZ=America/Los_Angeles: ok. The zone used is Asia/Shanghai, or
  America/New_York on a computer on Beijing's clock, so they are red on
  any machine.
- GUI (playwright 1.62.0, chromium and webkit): routing-time-zone (new:
  en, zh, zh-TW, ja, de, 420px wide, browser in Asia/Shanghai, server in
  UTC and in Asia/Shanghai) 14 of 14; routing-time with the browser in
  Asia/Shanghai, the typed rule saved with its zone; routing-time-went,
  routing-day-window, routing-save, routing-rules-line, i18n-keys: ok;
  TestCoreScriptBudget ok.

Broken by hand: Holds reading at.Local() instead of the zone made
TestRuleTimeWindowInItsZone red under TZ=UTC (Shanghai's 10:00 not held,
18:00 held) and under TZ=Asia/Shanghai (with New York), and
TestRuleTimeWindowInItsZoneAtTurnStart red (10:00 Beijing went to the
group's order). routing-time-zone.test.cjs run against origin/main's
client is red (no zone told beside the hours).

Reds not from this change, the same on an untouched origin/main 99de8e1ad
worktree: routing-pause chromium 7 of 7 (#3410); routing-time webkit "Add
a rule" outside the viewport, 1 of 3 runs on main too (#3465);
routing-rules-line webkit zh 1100 once under load, passes alone on both
(#3593, filed now).

Not tried: a real cloud server in UTC with a browser in Beijing (the GUI
test sets the browser's zone and the server's clock instead); the Windows
box; the whole GUI suite.
2026-10-25 18:18:02 +08:00
yetone 11907448e3 provider: the Cursor mover's min is 0.2.23, which sends a Team account's x-cursor-team-id (plugins#231)
npm view --prefer-online @magpie-community/opencode-cursor-auth: 0.2.23.
Ran: go test ./internal/provider -run 'Mover|Moved|Min|Cursor' (ok), gofmt -l clean.
Not run: the full suite (a one-line min change). The plugin change itself
was reviewed and run against a real Cursor account in plugins#231.
2026-10-25 18:01:37 +08:00
yetone 120264a49f sessions: a Codex line's marks are read in one pass, not one bytes.Contains each (#3493)
callHead and codexCallLine asked of every rollout line, with a
bytes.Contains each, whether it held "type":"user_message",
"role":"user", "type":"function_call_output" and nine more: up to twelve
passes over the line in each, a line of megabytes of tool output
included. A CPU profile of a cold usage read on Windows (20,807 Codex
rollouts, 44GB, magpie web in a sandbox home on the Windows box) put 37%
of its 270s of samples in that bytes.Contains (indexbody).

cxMarksOf reads them all in one pass: it walks each `":"` that ends a key
(in a JSON string the quotes are escaped, so never one inside a string),
and records the "type" values and the user's role it finds. It finds
what each value's own pass found: the same line, anywhere in it.

Run:
- TestCxMarksAsContains: twelve lines (long escaped strings holding the
  values, a nested value past a long string, "subtype"/"xtype" keys,
  "role":"users", empty and cut lines) give the same marks as a
  bytes.Contains of each. Red when the role is not recorded (3 lines).
- Every line of the owner's real ~/.codex/sessions, read only: 619
  files, 20,059 lines, 4.3GB, 0 lines whose marks differ.
- BenchmarkCxMarks, a 1MB exec_command_end line: 0.36ms a line, from
  11.2ms.
- Windows box, cold (.cache\magpie removed), magpie web, 3 rounds each,
  alternating, origin/main 552e974f2 against this change:
    CPU in the first 70s:  214.3 / 214.1 / 216.0s  ->  127.2 / 123.4 / 124.5s
    peak working set:      318 / 297 / 311MB       ->  344 / 342 / 325MB
  The peak is ~25MB higher: the same work is done in less time. Not
  changed here.
- go test ./internal/sessions/ ./internal/usage/ ./internal/gui/: ok.
  gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui
  ./internal/sessions/ clean.

Not changed: codexBody (codex.go) asks the same values with
bytes.Contains, but only of lines codexHead let through by their head
(1% of the profile's bytes.Contains was there, under 1s).
2026-10-25 17:57:52 +08:00
yetone d580537201 provider: the ZCode mover's min is 0.1.29, a sign-in keeping the account's user id
zcode 0.1.29 (plugins 5c9b7a4) gives each sign-in uid: ZCode's user_id,
so the plugin host tells two ZCode accounts of one name apart (wakkana
on Discord reported it for WorkBuddy), and the app's entry follows ZCode
only while it is signed in to that user id. keepMovedCurrent brings moved
users up to it.

npm view --prefer-online @magpie-community/opencode-zcode-auth version:
0.1.29 at landing. go test -run 'Mover|Movers|Notice|Migrat'
./internal/provider: ok.
2026-10-25 17:45:01 +08:00
yetone 552cdf8071 redact: a value the model spans from the delimiter before it is masked (#3591)
The model's span may start at the token before a value: the `":"` of
a JSON field, a CSV row's comma. A phone number in
{"phone":"+86 139 1234 5678"} came as `":"+86 139 1234 5678`, and in a
CSV row as `,+81 90-1234-5678`, which the PHONE check took for no
number, and it went as written. A name came as `"Wei Zhang"` and was
masked with its quotes, so the JSON lost them. modelSpans now trims
spaces and `"',;:` from both ends of a name's, a phone's, an
address's, an account's and an email's span; a secret's only spaces,
since a password may start or end with a quote.

Found by TestMaskEval: its 3 #3591 phones are no longer Known, and
"both" reads 33/34 masked, 0/40 wrongly (from 30/34).

Run: go test ./internal/redact and ./internal/pii ok; -run
'Mask|Redact|Privacy' ./internal/gui ./internal/gateway ok; go vet
darwin, linux, windows; gofmt -l clean.
Broken by hand: edge = isSpace for every kind: TestModelSpanLeavesDelimiters
red (both phones as written, the name's quotes gone) and TestMaskEval
red on the 3 phones.
Not tried: the full suite (internal/proc's #3567 is red on main), a
real request through the gateway with the model on.
2026-10-25 17:44:52 +08:00
yetone 033990e642 redact: the masking evaluation starts with nothing known
A value Mask masks is known from then on, and masked wherever it is
again (known.go), Preview's too. TestMaskEval ran after the tests that
masked hunter2pass, rina.k@fastmail.com and the like, so in the
package's full run what they masked was masked in its cases too, and
the rules' column was not the rules': with one test before it that
masked the eval's phones, rules read 19/34 for 16/34. Forget
(export_test.go) lets every value go before the cases.

180cfb565's body says 38 cases; there are 39.

Run: go test ./internal/redact (TestMaskEval in the full run and
alone: 16/34 rules either way) and ./internal/pii ok; go vet darwin,
linux, windows; gofmt -l clean.
Broken by hand: without Forget and with a test before it that masks
the eval's phones, rules read 19/34.
2026-10-25 17:44:52 +08:00
yetone a30aed0162 provider: the WorkBuddy mover tells two accounts of one nickname apart by uid
wakkana on Discord: WorkBuddy accounts with one display name collapse
into one, deduped by name (wbWho's nickname, addSideLogin's EqualFold).

Where that runs today: WorkBuddy's built-in sign-in is gone, so
addSideLogin no longer writes WorkBuddy accounts. A sign-in through the
plugin goes to the plugin host, whose settle already keeps two accounts
of one name with different uids apart and lets the same uid replace
itself (#413, TestPluginSameNameOtherUID, passes at this head). What was
left by name is the mover, for accounts not moved yet:
- wbLogins dropped WorkBuddy desktop's account when an account magpie
  signed in had the same nickname, whatever its uid (the generic "one of
  magpie's stands for the agent's own" rule). Now it stands for it only
  when the uid matches; one removed in magpie stays out.
- renewedSince matched by name, so the desktop's marker read as the
  other "Me" renewed and the move would never commit. Moving and
  movedAccount carry the vendor's id (WorkBuddy's uid), matched by it
  where both have one; the agent's own is never compared; putBack skips
  by plugin key, not name.
Other movers have no id set, so they match by name as before; their
built-ins name accounts by email or login. The live addSideLogin callers
(Copilot, Google, ChatGPT API) name accounts by login or email too.
Sibling plugin: zcode 0.1.29 (plugins 5c9b7a4) now gives a uid, its
min is raised in a separate commit.

Run on origin/main 1dfa28484 plus this change; rebased onto 180cfb565,
whose two commits touch only internal/redact and the GUI:
go test -timeout 45m -count=1 ./internal/provider ./internal/plugin: ok.
GOOS=linux and GOOS=windows go vet ./internal/provider, gofmt -l: clean.
Broken by hand: TestWorkBuddyMoverSameNameOtherUID is red with
workbuddy.go from HEAD (one account moved) and, separately, with
same() by name only (the other account read as renewed).
Not tried: a real move with two same-name WorkBuddy accounts. Accounts
the old built-in already collapsed are gone; nothing brings them back.
Not run: the whole suite.
2026-10-25 17:42:37 +08:00
yetone a093e9c3a5 claude: a Claude Code run holding over its memory budget is let go after its turn, its session resumed (#3256)
claudeRoom bounded how many Claude Code processes run, not how large
each one is. A run is kept for its conversation's next turn, turn after
turn, and on a service never restarted one grew for days: a
node-MainThread in magpie.service reached 8 GiB RSS on a 31 GiB host and
the OOM killer took the machine down (#3256).

Now each time a run's reply ends, its process tree's resident memory is
read (proc.Tree.RSS: /proc VmRSS on Linux, ps on macOS, the working sets
of its job's processes on Windows, so an npm claude.cmd's node counts)
and logged with its pid. Over the budget (an eighth of memLimit on
Linux, of the computer's memory elsewhere, 1 GiB at least, 4 GiB if
unknown), a whole turn's run is not kept idle: its session is shelved
and the next turn resumes it in a new Claude Code with --resume, told
only the new messages. A run parked on tool calls is let go past 1.5x
the budget (no session to shelve there; its results start a new run).
Each Claude Code also logs pid and model at start, and run time, how it
ended and peak RSS (ru_maxrss) at its end, so an OOM pid can be found in
magpie's log. Budget on the reporter's 31 GiB host: 3.9 GiB.

Run (worktree at 99de8e1ad + this change, macOS arm64):
- go test -timeout 45m ./internal/gateway -run
  'Claude|Subscription|Room|Park|Idle|Resume' -count=1: ok (60.5s).
- go test ./internal/proc -count=1: every test ok except
  TestNoCommandBypassesProc, red on origin/main since 75e78a5a0
  (internal/tui/keep.go, filed as #3567, not this change).
- New tests: TestClaudeOversizedRunIsLetGoAndResumes (injected RSS over
  budget: the run ends, the next turn runs --resume s<pid> and is not
  told a1 again), TestClaudeRunWithinBudgetIsKept,
  TestClaudeOversizedParkedRunIsLetGo, TestClaudeRunBudgetScalesWithMemory
  (31 GiB MemTotal -> an eighth; 2 GiB -> the 1 GiB floor), TestTreeRSS
  (a real sleep's RSS read; none once waited for).
- Broken by hand: with both checks turned off, the oversized idle and
  parked tests go red ("the oversized run to end", "a run over its
  budget was kept waiting on its tool calls").
- Real Claude Code 2.1.310 in a sandbox HOME and CLAUDE_CONFIG_DIR,
  stream-json like the bridge, against DeepSeek's Anthropic endpoint
  (deepseek-chat, real key, synthetic 40KB turns): RSS after turns
  1/10/20/30 = 192/244/223/233 MiB, peak 245 MiB over 30 turns and
  ~1.2 MB of conversation. oversized() on that real process with the
  budget 1 MiB under its RSS said over; with the real budget on this
  64 GiB Mac (8192 MiB) it said keep.
- gofmt -l clean; go vet, GOOS=linux and GOOS=windows go vet -tags
  nogui ./internal/proc ./internal/gateway clean.

Not tried: a real Claude subscription run through the bridge on Linux
until it crosses the budget (the retire path is shown with injected RSS
on the fake Claude Code, and the RSS read on a real one); the Windows
RSS reader and job listing on the Windows box (vet only); a Linux run of
the /proc reader (macOS reads through ps); the full ./internal/gateway
package.
2026-10-25 17:41:41 +08:00
yetone 59f02d42cb provider: the Qoder mover's min is 0.2.37, so a QwenWork personal account's usage shows what is left (plugins#385)
opencode-qoder-auth 0.2.37 (npm view --prefer-online: 0.2.37) reads a
QwenWork personal account's account-context quota, whose total and used
are null, as a balance of the credits left, with the daily, monthly and
long-term pools from /api/v1/adapter/user/wallets, as QwenWorkCN.app
1.2.1's own client reads them. 0.2.36 called every such account "the
account reports no credits".

Run: go test ./internal/provider -count=1 ok (141.6s); go vet
./internal/provider for darwin, linux and windows; gofmt -l clean.
2026-10-25 17:41:33 +08:00
yetone 180cfb565e redact: an evaluation of the masking, with the rules, the model and both
TestMaskEval scores 38 made-up texts of the kinds agents send (prose,
code, logs, tool results, JSON, CSV, Chinese) with 34 values to mask
and 40 to keep. The cases start from what users reported masked
wrongly (#3144, #3143, #3029, #3538, #3577, d3db461bb, 611b9e173,
#1977) and add the values masking is for. It logs, by kind, how many
each way masked of those to mask and, wrongly, of those to keep:
the rules alone, the local model as it said it, and both with the
checks on what the model found, and lists every value one way got
wrong.

What the real model said is recorded in testdata/eval-model.json, so
the test replays "both" with no model and no network, and fails when
a value comes out wrong, or a Known one right. MAGPIE_EVAL_CACHE
points it at a downloaded model to record again.

Baseline (privacy-filter q8, M4 Pro):
  rules  16/34 masked, 0/40 wrongly
  model  32/34 masked, 8/40 wrongly
  both   30/34 masked, 0/40 wrongly
The checks take all 8 of the model's wrong ones off. Of the 4 misses,
3 are phones the model found with the delimiter before them
(`":"+86 …`, `,+81 …`), which the PHONE check turns down (#3591),
and 1 is 刘洋, which the model doesn't find (#3592). Both are Known.

Run: MAGPIE_EVAL_CACHE=$HOME/.cache go test -run TestMaskEval -v
./internal/redact against the installed model (recorded); go test
./internal/redact ./internal/pii ok; go vet for darwin, linux,
windows; gofmt -l clean. internal/proc's TestNoCommandBypassesProc is
red, on origin/main too: internal/tui/keep.go (#3567).
Broken by hand: modelFits off: 4 keeps masked and the 3 #3591 phones
reported right, red. A case's text changed: red, the recording is
stale. Taking snakeWord, epochNumber or madeID's SECRET check off
alone stays green: the model makes neither mistake on these texts,
or a second check catches it.
Not tried: the model on Linux or Windows, or on the CPU.
2026-10-25 17:41:10 +08:00
yetone 5f17c5a38e gui: a request's tool results are orange in its context, not pink
The owner found the context map's colours a little off (10-25, the
Routing card). Tool results, often the biggest tile, took the palette's
pink, which at the map's 11% tint sinks to a maroon between violet,
sky and slate. Of the drafts shown (current, results orange, equal
lightness, stronger tint) the owner picked results orange.

--k-results is #fdba74 in dark mode and #ea580c in light, deep enough
there to stand apart from memory's amber (#f59e0b). Colorblind mode
keeps its palette's --c5, as every other part does. Nothing else
changes: the tint, edges, text mixes and the other parts' colours.

Run (darwin): go test ./internal/gui ok; GUI in chromium and webkit:
context-map 22/22, routing-context-fold 24/24, context-window 24/24.
Not run: the whole GUI suite; no screenshot of light mode in the app.
2026-10-25 17:32:25 +08:00
yetone 1dfa284840 usage: a plugin's row of text alone shows its text, not "· 100% left"
AutoClaw's 积分余额, Cline's balance, Cursor's Auto + Composer note and
the other plugin rows that are only words come to magpie as a window set
aside with a display and nothing counted (used 0, no amount, no limit).
Every surface read that used 0 as a share: the usage card said
"1,234 积分 · 100% left" (or "· 0% used") beside an empty meter, the
panel drew an empty ring, the TUI an empty bar, `magpie accounts` and
`magpie quota` "积分余额 0% (1,234 积分)", and the status line
"积分余额 0%".

provider: QuotaWindow.Text (json "text") marks such a row in
quotaOfPlugin: aside, a display, used/amount/limit all 0. Aside is
required: Cursor's On-demand "$0 / $20" isn't set aside and is a real
0%. QuotaSpan carries it to /api/quotas.
GUI (app.js): quotaText gives the display alone; the account row's
meter, the Usage page's track and the panel's rings leave the row out;
a panel card with only such rows shows their text on its line, as an
Unlimited card does. The tray's menu-bar text already skips aside rows.
TUI quotaCell, the CLI's quotaCell (accounts, quota) and statuslineCard
write the name and the text.

app.js stays under its budget (1,322,289, not raised; now 1,322,275):
to make room, the 8 copies of Math.max(0, Math.min(100, x)) are one
to100(x), and 8 one-line [..].filter(Boolean).join("\n") tooltips are
tipLines(..). Same results; the GUI files below cover those callers.

Readings cached before this release have no text flag and show as
before until the account is read again (a minute's cache, or Refresh).

Run, at this commit's tree (rebased on origin/main 9dc7d6eb8):
- internal/gui/tests/quota-text-row.test.cjs (new): a text row alone
  and beside a counted window, through accountQuota, panelQuotaCard,
  quotaWindows and quotaText; chromium and webkit, en and zh: 4 of 4.
- the GUI files the change reaches (quota*, usage*, panel*, tray*,
  profile*, plugin-plan, plugin-quota*, plugin-panels, api-key-usage,
  claude-usage, gateway-key-quotas, glm/opencode-go quota errors,
  routing-quota-left, gui-de/ja/zh-TW, i18n-keys; 114 files, both
  engines, 4 wide, load 130 to 200): 1433 of 1467. The reds, rerun
  alone here and with 9dc7d6eb8's own app.js: quota-count-wrap (webkit,
  #3404 #2228), usage-agents-hide (#3414 #2276), usage-checkin's Qoder
  tab (webkit, #2549), usage-fold (#3415 #2163) and usage-ledger's
  return-to-live (#3104) fail the same at both; api-key-usage failed
  once 4 wide and passes alone at both (#3589).
- go test -timeout 45m ./internal/gui/ ./internal/cli/ ./internal/tui/
  ./internal/provider/: ok (TestCoreScriptBudget included).
- gofmt -l internal/ clean; go vet on darwin, linux (nogui) and windows
  for provider, cli, tui (and gui on darwin): clean.
Broken by hand:
- app.js at HEAD under the new GUI test: red, quotaText gave
  "1,234 积分 · 0% used" / "1,234 积分 · 已用 0%".
- quotaOfPlugin's Text line removed: TestPluginTextRowIsText red.
- the CLI's quotaCell at HEAD: TestQuotaCell red ("积分余额 0% (1,234 积分)");
  statuslineCard at HEAD: red ("autoclaw-plugin 积分余额 0% 5h 40%").
- the TUI's quotaCell at HEAD: TestTextQuotaCell red
  ("积分余额 ░░░░░░░░ 1,234 积分 · 0% used").
Not tried: a real AutoClaw, Cline, Cursor, Factory or ZCode account in
the app (fixtures follow the plugins' own window shapes); the full
`go test ./...` and the whole GUI suite; the Linux and Windows apps.
2026-10-25 17:26:38 +08:00
yetone 99de8e1ad1 gui: the warm-up's whole-history reads hold Go to the memory it held when they began (#3493)
A cold build of the request index (after any update that changes
internal/usage) reads every session again and allocates ~1.2 GB to keep
~40 MB more. Even under GOGC 25 the heap overshot its goal into pages it
kept, so a cold start peaked ~70 MB over a warm one. underTightGC now also
sets a soft memory limit at what Go holds of the system's memory when its
read begins (total mapped less released), and puts the old limit back
after. A lower limit the user set is kept, and GOGC off gets none.

Real data, 15.7k sessions (sbpairs: copies of the real cache/config, the
real Claude Code and Codex session folders linked read-only), harness
TestZZWarm running warmSteps under sessions.Warm, phys_footprint_peak,
old = 9dc7d6eb8, alternated:
  cold (requests-v1.bin removed): old 313/308/320/323 MB, new 251/241/247/249
  warm: old 247/255/250, new 211/225/228
  at rest after: unchanged (old 186-200, new 174-190)
  user CPU, cold run: old 4.8-5.9 s, new 6.0-12.8 s (load 120-200 on the
  box, wall time the same: 2.8-4.9 s vs 3.0-5.9 s)
Fixed 220/200 MB limits were tried first: 200 doubled CPU; a limit relative
to what is held scales to other histories.

Run: go test -count=1 ./internal/gui ok (132s); the first full run had one
red, TestRestartHandsTheGatewayOver (handover, #3451, commented), green 3 of
3 alone. GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui ok,
gofmt clean.
Broken by hand, TestUnderTightGCLimitsMemory red each time: no limit set;
a limit under GOGC off; the user's lower limit replaced.
Not tried: Windows with real sessions (the box has none); a history much
larger than 15.7k sessions.
2026-10-25 17:14:38 +08:00
yetone 54b198c5c1 gui: a plugin's page grows to its README on a spring, not in one jump
A plugin's page (Plugins › Discover) opens with a skeleton for its
README, and when the README came in the dialog took its new height in
one frame. Now detail()'s fill() measures the dialog, puts the README
in, re-centres it (holdModal), and animates height and top together
from the old box to the new on SPRING, the curve the dialog opened on
(570ms, 1.5% over), clipped while it grows; the README fades in over
it. Height and top move on one curve, so the dialog keeps the middle
in every frame. The same for the error note when npm or GitHub
doesn't answer. Reduced motion: no animation, as before.

Budget: the core 1,530,050 -> 1,530,631, the 581 bytes of fill(), the
Plugins page's own, no room added.

Run at this head (rebased on 9277c2567):
- modal-centred-late.test.cjs, a new test sampling every frame from
  the README's arrival: heights in between the two and centred within
  2px in each frame, at 820px and 560px (README taller than the
  window), Chromium and WebKit: 12/12. With the plugin GUI files
  (plugin-market, -github, -local, -git, -folder-path, -own-icon,
  -card-update): 80/80 at 9dc7d6eb8, before the rebase onto two
  commits that touch Codex's card and the masking page only.
- go test -run Budget ./internal/gui ok; gofmt -l clean.
- Frames seeked to 0/80/160/280/570ms and looked at.

Broken by hand: fill() returning before the animation turns the new
test red in both sizes ("grew over frames: [674,674,674,674]").

Not run: the whole GUI suite and go test ./... (only plugins.js and a
test changed); not tried in the real app on WebKitGTK or Windows.
2026-10-25 17:08:20 +08:00
yetone 9277c25673 masking: under the number, the flow's middle takes the card's width, and sits further from the chart
The owner's screenshot of Insights › 脱敏 with the band stacked: the
animation stayed narrow, as each of the flow's three columns kept a
third of the card, and it sat 16px under the chart.

Under 780px the names now take what they need (fit-content, up to 150px,
120px under 640px) and the middle the rest; the gap is 28px. Measured in
Chromium, the middle's width before → after: 760px window 386 → 452,
640px 189 → 365, 560px 162 → 285, 480px 135 → 205. 820px and up (the
flow beside the number) is unchanged.

Run: screenshots at 760, 640 and 560 in Chromium and WebKit, before and
after; GUI masking-records 52/52, privacy-usage-stats 4/4, mask-actions
20/20, i18n-keys 4/4, click-scroll 22/22; privacy-model 23/24 in that
run, beside a Go test run, and 24/24 three times alone after it (the
failing test's name wasn't kept); go test -tags nogui -run Budget
./internal/gui ok.
Not tried: the whole GUI suite; the real Linux app (WebKitGTK).
2026-10-25 17:05:38 +08:00
yetone 3ee37aea64 gui: Codex's card has no subagent-model or memories square beside its settings rows
Codex's sheet has "Codex subagent model" and "Codex memories model" as
named rows (renderCodexSubagentModel, renderCodexMemories), just under
the card, and the card also drew a square for each: the same setting
twice (the owner, 10-25, a screenshot of the notebook square beside the
memories row). The squares are no longer drawn for the Codex those rows
read (id "codex", not gateway mode); they are left out of the extras
count and of the extras toggle too. A Codex in WSL, which the rows don't
read, keeps its squares.

Tests: codex-memories and codex-subagent-model run the square on a WSL
Codex and check Codex's own card has none; codex-subagent-model picks
and resets through #codexSubagentModelRow; codex-memories-settings
resets through the row instead of the square.

Run: GUI codex-memories, codex-memories-settings, codex-subagent-model,
codex-subagents-lead, desktop-subagent-model, Chromium and WebKit, every
language and width they have: 82 of 82. Earlier run of these plus
codex-start-model-field, subagent-effort, agent-prefs, agent-tweak-fold,
gateway-mode and mobile-web at concurrency 4: only the expected square
reds plus two page.goto/click timeouts under load (codex-subagents-lead
webkit zh-TW 560, desktop-subagent-model webkit zh 1100), both green in
the 82-of-82 run. After the rebase on origin/main the change was trimmed (one sq helper
for the extras toggle and count) and the budgets raised to its size:
app.js 1,322,537, core 1,530,050, with no room added (TestCoreScriptBudget
ok). Rerun at that tree: codex-memories, codex-memories-settings,
codex-subagent-model, agent-tweak-fold, gateway-mode, 58 of 60; the two
reds are gateway-mode's masking tab, red the same on origin/main
9dc7d6eb8 run alone (#3586). Not run: the full GUI suite or go test ./....
2026-10-25 17:04:02 +08:00
yetone 9dc7d6eb84 usage: a large build's archives are held in a spill file as they are made (#3493)
A cold build (first start, or after an update that changes internal/usage)
kept every chunk's archive on the heap until save had written
requests-v1.bin and swapped them for the file's pages: 31MB for 15.7k
sessions, the largest thing a cold peak held over a warm start's.

Now a build that wants requestDiskLeast or more files written writes each
archive to requests-*.spill as the chunk is made, lets go of the heap copy,
and maps the file once the build is done (unlinked at once). save then
swaps the spill's pages for requests-v1.bin's as before: pagesRank orders
heap < spill < file, and keep and save take the later. A spill that can't
be written or mapped has each of its chunks made again from its source, so
none is left without an archive. Windows maps no file, so nothing changes
there.

Run, real data (15.7k Claude Code + Codex sessions, sandbox HOME, copies of
the call shards, requests-v1.bin removed before each run), the gui warm-up
harness alternating old (cbbf3163c) and new, 4 rounds each:
  phys_footprint_peak old 396 353 346 352 MB, new 319 322 329 329 MB
  peak live (gctrace) old 209-259 MB, new 188-205 MB
  at rest unchanged (184-205 MB), warm-up time in the same range.
  gctrace: cold max live after mark is now 187MB against warm's 173MB; what
  is left of the gap is allocation churn (1.2GB allocated in the cold
  build against 280MB warm), not held data.
go test ./internal/usage ./internal/gui ok; -race -count=3 of the disk and
spill tests ok; GOOS=linux and windows go vet -tags nogui ok; gofmt clean.
Broken by hand: no spill put -> TestRequestDiskBuildSpills red; done not
making a chunk again -> TestArchiveSpillFailedMadeAgain red; the spill
ranked as the file -> TestRequestDiskBuildSpills red after the save.
Not tried: Windows (no mapping, path unchanged), a disk that fills while
spilling (the made-again path is covered by the unit test only).
2026-10-25 16:56:02 +08:00
yetone e4809a150a redact: a key of digits only after 密钥为, token 是, apikey:… is masked; PIN码, 安全码, 授权码 join the names (CyberCaius on Discord)
"密钥为12231241" in Settings → Masking's 试一试 came back "这里没有需要脱敏的
内容". ee715c2e0's key rules (a CJK name for a key or token, or an English
one before 为/為/是/:) asked for letters in the value, so that
"RSA 密钥为 2048 位" stays; an all-digit key went as written. 密码/口令 took
digits already (714ab8e8b).

Now:
- After a key's name and 为, 為, 是, :, :, =, は or 는, a value of six digits
  or more is masked as SECRET, by the CJK names (密钥, 秘钥, 令牌, 金鑰, トークン,
  토큰…) and the English ones (token 为, apikey:, API Key 是, secret 為).
  Not when a unit follows it (位, 字节, 个, 次, 秒, 毫秒, 天, ms, byte…), with
  no 为/是/: between (密钥 12345678), or under six digits.
- New names: PIN码, PIN碼, PIN 码, 安全码, 安全碼, 暗証番号, 비번 for a password
  (any value of four or more, digits too, as 密码 has); 授权码, 授權碼 for a
  key; pin and pin code before 为/是/: in English (six digits or more, a
  word boundary first, so "spin 是 …" stays). The CJK names are matched in
  any case (pin码).

Left as they were (tested): RSA 密钥为 2048 位, 密钥为 12345, 令牌有效期是 86400,
令牌是 300000 毫秒, 密钥长度为 4096000 位, token 是 3600000 ms,
key 是 1048576 byte, 令牌桶容量为 100000, 密钥 55661237, pin 为 1934,
const token = 44102939;, {"token": 44102939}, maxTokens: 128000, and every
case of TestCJKPasswordMasked, TestCJKSecretNamesMasked and 511c4a765's
code tests (code_test.go).

Run at this head:
- go test ./internal/redact ./internal/pii ./internal/settings
  ./internal/otlp ./internal/sessions ./internal/gui -count=1: ok
- go test ./internal/gateway -run 'CJK|Mask|Redact|Privacy|PII|Secret': ok
- go test ./internal/redact -run 'CJK|Code' -count=3 -shuffle=on: ok
- gofmt -l, go vet, GOOS=windows go vet, GOOS=linux go vet -tags nogui
  ./internal/redact: clean
- Broken by hand: with the parent's redact.go, TestCJKDigitKeysMasked
  fails 19 of its 21 masked cases (密码为/口令: already masked).
- With Shape on, 密钥为12231241 goes as a made-up 8-hex key and comes back.

Not tried: the GUI try box in a running magpie (no GUI file changed), and
the full suite.
2026-10-25 16:55:06 +08:00
yetone 4b1994ad31 agent: AionUi, added through its add-provider link
seven7032 on Discord asked how to connect AionUi to magpie. AionUi
keeps its providers in its own SQLite database
(<userData>/aionui/aionui-backend.db, WAL mode), each key encrypted, so
there is no config file for magpie to write. The one supported way in
is its deeplink. AionUi 2.2.2's main process parses it
(parseDeepLinkUrl), and its renderer opens Settings -> Model with the
add form filled in, which the user confirms:

  aionui://add-provider?api_key=magpie-aionui&base_url=<gw>/v1&name=magpie&platform=custom

The AionUi row works the way Cindy's and Lody's do:
- Add magpie opens that link. /api/open allows the aionui://add-provider?
  prefix only. `magpie aionui add` opens it from the CLI.
- The key is agentKeyAt("aionui"), so it becomes the LAN key while
  sharing is on (added to TestPinnedGatewayKeyForEveryWriter).
- "custom" is AionUi's OpenAI-compatible platform. Its base URLs end in
  /v1, as its own OpenAI preset's does.
- Added reads providers.base_url for the gateway's address without
  touching the database (sessions.OpenUntouched, from the previous
  commit). A database that can't be read is unknown, never "not added".
  The last read is kept while the database and its log keep their size
  and time, for 15s at most, so the Agents poll doesn't copy a running
  AionUi's database every time.
- It is detected by userData/aionui (os.UserConfigDir()/AionUi on every
  OS).
- As with Cindy and Lody, the TUI leaves the row out (nothing to pick).

Tests:
- TestAionUiLink: the link's exact bytes.
- TestAionUiLinkParsedAs2_2_2: runs the link through
  testdata/aionui/deeplink-2.2.2.js, which is parseDeepLinkUrl copied
  byte for byte from 2.2.2's app.asar (out/main/index.js 50995-51021)
  plus the renderer's add-provider mapping and the form prefill. The
  result is action add-provider, route /settings/model, and the form gets
  platform custom, the /v1 base URL and the key.
- TestAionUiHas: a fixture database built from 2.2.2's real providers
  schema (taken from the database 2.2.2 made at first start). It covers
  none, another gateway, a row present only in the log of a running app,
  and a closed app, and checks that AionUi's folder is unchanged each
  time.
- TestAionUiUnreadableIsUnknown, TestAionUiStatusRereadsOnChange,
  TestAionUiDetect, TestAionUiImportRow (GUI: the row, unknown status,
  and /api/open refusing other aionui:// links).
- import-row.test.cjs gains the AionUi row (icon, known status in each
  language, the click opens the exact link, and it fits at 420px), in
  chromium and webkit across en, zh, zh-TW, ja and de. The same file
  now waits for the rows to settle before its alignment check: under
  load 105 one run caught Cindy's button mid-resize at 193.4px beside
  the picker's 194.4px. The old file passed 3/3 alone, so it is a
  timing assumption, not a layout bug.

Run at 18041fc5b (this change on origin/main 714ab8e8b):
- go test ./... -timeout 45m, through the suite lock: every package ok
  except internal/proc's TestNoCommandBypassesProc, red on
  internal/tui/keep.go:102 from 75e78a5a0 on main (#3567, which has a
  fix on skygunner's fork).
- gofmt -l clean; GOOS=linux go vet -tags nogui ./... and GOOS=windows
  go vet of agent, gui, cli and sessions clean.
- import-row.test.cjs: 20/20 in chromium and webkit.
- The whole GUI suite (make test-ui, 882 files) was still running at
  push, so it is not recorded here.
Rebased onto cbbf3163c, which changes GUI assets and api.go. At the
pushed head: go vet of the four packages is clean; go test
./internal/gui ok; the AionUi, Cindy and pinned-key agent tests are ok.
import-row.test.cjs at load ~210: one run had 19/20, and that run's
output wasn't kept, so I can't name the failing case. The next three
runs were 20/20.

Tried: magpie built at this commit with -tags nogui under a sandbox
HOME. `magpie aionui` printed "magpie aionui add  to add magpie" with
AionUi's folder and no database. With a copy of the real 2.2.2 database
holding one row at the gateway's /v1, it printed "magpie added".

Broken by hand:
- Dropping the aionui prefix from /api/open: TestAionUiImportRow red
  ("AionUi's link was not handed to the desktop").
- The reader put back to a plain mode=ro open: TestAionUiHas red
  ("AionUi's folder changed: aionui-backend.db ->
  aionui-backend.db,aionui-backend.db-shm,aionui-backend.db-wal").
Both were restored and are green.

Not tried: the add form, the saved row and gateway traffic. The
released AionUi 2.2.2 desktop app asks for an aionui.com sign-in before
any page, Settings included. That sign-in was not faked, and no
aionui.com account was available, so the link has never been opened in
a signed-in AionUi end to end. Also not tried: what AionUi saves for
platform custom when it is confirmed, AionUi's User-Agent (so none is
matched), and the aionui:// handler on Linux and Windows (Electron's
setAsDefaultProtocolClient, unverified there).
2026-10-25 16:49:29 +08:00
yetone c26a418d23 agent: an import app's status magpie can't read is unknown, not "not added"
Agent.Added now returns (added, known). Cindy's reader turned any
failure (a locked, corrupt or unreadable cindy-local-v1.db) into "Not
added", which told a user who had added magpie that they hadn't. Now
an unreadable database is unknown: /api/agents leaves `added` out and
the row shows the "confirm it there" hint, as it does for Lody. A
stopped WSL distro's app is unknown too, not "not added".

Cindy's database is also read without writing beside it. A mode=ro
open of a WAL database while Cindy was closed made cindy-local-v1.db-wal
and -shm in Cindy's own folder. It now goes through
sessions.OpenUntouched, which is what the Cursor reader already did
(immutable with no log, from a copy with one), moved out of
openCursorStore so both share it.

The CLI's list still offers `magpie cindy add` when the status is
unknown; it never said magpie was missing.

Run: go test ./internal/agent ./internal/sessions ./internal/cli ok;
go test ./internal/gui -run 'Import|Lody|Cindy|Agents' ok.

Broken by hand: Cindy's reader put back on the mode=ro open made
TestCindyHasClosedWALAndUnreadable red ("Cindy's folder changed:
cindy-local-v1.db -> cindy-local-v1.db,cindy-local-v1.db-shm,
cindy-local-v1.db-wal"); api.go ignoring `known` made
TestImportStatusUnreadableIsUnknown red. Both restored, both green.

Not tried: a real Cindy install; the read is tested on fixture
databases only.
2026-10-25 16:49:29 +08:00
yetone faa79ea2f5 redact: a Unix time the local model takes for a phone is not masked (#3577)
id.null (v0.1.1483) saw a tool result's "timestamp": 1792903687 go as
"timestamp": {{PHONE_c2ukh7gk}}. The PHONE rule needs eleven digits, so
the local model found it; v0.1.1457's check leaves a bare number alone
unless a cue is before it, but cues match inside words, and a log's
"tool_call" (or "telemetry") is "call" (or "tel").

A ten-digit time, or a thirteen-digit one in milliseconds, starting with
1 and nothing else, is now never a phone, cued or not: a North American
area code starts with 2 to 9, and a Chinese mobile is eleven digits.
The loose cues themselves are #3585.

Run: go test ./internal/redact ok; go vet darwin, linux, windows; gofmt
clean. Broken by hand: without the epochNumber check
TestModelPhoneKeepsUnixTime is red with the reporter's line masked.
Not tried: the real model on the reporter's whole tool result (their
screenshot only has the one line); the full Go suite.
2026-10-25 16:48:07 +08:00
yetone fc91e58ba4 redact: a bare JSON number ("timestamp": 17929036837) is not masked as a phone (id.null on Discord)
The 脱敏 before/after view showed a tool result holding a session file's
JSONL line, and its "timestamp": 17929036837 went as {{PHONE_…}}. The
PHONE rule is 1[3-9]\d{9} bounded by digits, so any 11-digit number
starting 13-19 is a CN mobile wherever it sits. A phone, a card or an ID
number in JSON is a string; a bare number there is a count, an id or a
time.

Now a personal kind's value that is all of a bare JSON number is left,
judged by where it sits and its form, not by the key's name: digits only,
after "key": (an object's value) or inside an array of numbers, with only
, } ] or the text's end after it. It sits beside the decimal check
(noDecimals, now noNumbers), so it holds for what the rules, the model
and values known before find alike. A BANK_CARD (Luhn-valid snowflake)
and an ID_CARD's digits as JSON numbers are left the same way.

Still masked (tested): "phone": "13800138000", ["13800138000"],
phone:13800138000, "call 13800138000, thanks", 我的号码 13800138000,谢谢,
"numbers 13900139000, 13800138000]" (no [ before), a phone inside a JSON
string's text, "card": "4111111111111111", and every case of
TestStandaloneNumbersStillMasked. "phone": 13800138000 as a number is
left too; that is the cost of not going by the key's name.

Run at this head:
- go test ./internal/redact ./internal/pii ./internal/settings
  ./internal/masking ./internal/otlp ./internal/sessions ./internal/gui
  -count=1: ok
- go test ./internal/gateway -run 'CJK|Mask|Redact|Privacy|PII|Secret': ok
- gofmt -l, go vet, GOOS=windows go vet, GOOS=linux go vet -tags nogui
  ./internal/redact: clean
- Broken by hand: with origin/main's redact.go, TestBareJSONNumberNotMasked
  fails 7 cases (the reporter's line, {"n": 13800138000}, a spread-out
  object, two arrays, the card and the ID number). The 10- and 13-digit
  epochs were not masked before either; they are in the test to stay so.

Not tried: the GUI before/after view in a running magpie, and the full suite.
2026-10-25 16:47:29 +08:00
yetone 0152f66966 provider: a Remote magpie's model list follows the other magpie's, fetched every 10m (6igsteven on Discord)
6igsteven (Discord, 10-24/10-25): GLM-5.3-Trial and GLM-5.3-Flash-Trial
are listed on the magpie that runs the ZCode plugin, and not on the
magpie that uses it as a Remote magpie. The trial entries come from the
ZCode plugin once it reads the account's gift (zcode 0.1.26), and the
other magpie's /v1/models lists them as it lists every catalog entry.
But a Remote magpie is a provider of keys: its list was fetched when it
was added and then only when Fetch models was pressed in its editor
(KeepListsFresh asks only providers with a RefreshEvery, FetchNew only
accounts). So anything listed there later (the trial models, a new
provider, plugin or routing group) never reached this magpie.

A Remote magpie with no RefreshEvery now has a 10m schedule
(RemoteMagpieEvery, RefreshSchedule), so KeepListsFresh refetches it
through the same Refetch as Fetch models. `magpie provider refresh-every
<id> off` on a Remote magpie is kept as "off" rather than "" so the
user's off isn't read as unset. CLI show/refresh-every print the
schedule in force. Other providers are unchanged: no schedule means
only when asked.

Run: TestRemoteMagpieListFollowsTheOtherMagpie (new) with
TestKeepListsFreshFetchesWhatIsDue, TestParseRefreshEvery,
TestSaveKeepsTheListsScheduleAndRules: ok, sandbox HOME, Go caches
pinned. Broken by hand: RefreshSchedule returning RefreshEvery alone
(the old behaviour) fails the new test with "asked [], want [office]";
restored, ok. gofmt -l clean.
Then, at this commit: go test ./internal/provider ./internal/cli ok
(140s, 58s); go vet ./... on darwin, GOOS=linux -tags nogui and
GOOS=windows ok; darwin, linux (nogui) and windows builds ok.
Not run: go test ./... - the machine's disk had under 1GB free
(other sessions' work) and load ~200, so a full suite would not fit.
Not tried: a real two-computer setup with a live ZCode gift. A Remote
magpie whose user curated its picks (left a listed model unpicked)
still doesn't take new models by itself (withNewlyListed, by design).
2026-10-25 16:30:48 +08:00
yetone c490165b14 gui: a menu of actions keeps no empty tick column, so its items line up with its heading
Sessions' "Continue in" menu (a screenshot from the owner) drew each
agent's logo and name about 21px right of its heading. The menu is a
list of actions with nothing ticked, but the shared menu reserved its
14px tick column anyway. The same happens in Usage's "Count this
client's calls as", Library's "Copy config…" and Routing's "Add a
condition".

app.css now hides .pm-tick in a menu with no ticked item and no
checkbox item. A choice menu (something ticked) and a multi-pick menu
(menuitemcheckbox, where a tick can appear later) keep the column. The
rule is CSS only: an app.js version put the core 209 bytes over its
budget, which is not raised for this.

Run at cbbf3163c + this:
- sessions-convert, usage-count-client, library-mcp-copy-config,
  purpose-filter, routing-purpose-state, routing-request-metrics: 46/46
  (Chromium and WebKit, every language the files run)
- go test ./internal/gui -run Budget: ok
- measured: the logo went from x=571 to 550, the heading's text start

Broken by hand: the old app.css fails sessions-convert's new "the logo
lines up with the heading (571 vs 550)" in Chromium and WebKit.

Not tried: the whole GUI suite (load ~270 and a nearly full disk on the
machine), and the real Linux (WebKitGTK) and Windows apps.
2026-10-25 16:30:29 +08:00