Commit Graph
7946 Commits
Author SHA1 Message Date
yetone 382c8c0bdf proc: magpie serve reaps the processes it adopts (Kling__Lab on X)
254 <defunct> children of `magpie serve` after 7 days, growing ~9 an hour
(magpie, uv, node, npm, magpie-bun, code-review-graph), only a restart
cleared them. Every command magpie starts is waited for (the AST guard
TestEveryStartedCommandIsWaited holds, and I read each Start site and
Output/StartTree/StartReaped by hand: none is missed). The zombies are the
grandchildren: an agent CLI's MCP servers whose parent ended are adopted by
magpie where it is PID 1 (a container) or a child subreaper, and nothing
waits for a process it never started.

proc.KeepReaping (Linux, from serve) does nothing unless magpie adopts
(PID 1 or PR_GET_CHILD_SUBREAPER), and then reaps a child of its own that
was a zombie at two looks 5s apart. Not tried: the reporter's container;
the cause (PID 1 / subreaper) is inferred from the report, not seen.

Run: TestAdoptedOrphansAreReaped (subreaper test process, 6 orphans) and
the proc package through wsl-run on magpie-desktop: ok. Broken by hand
(KeepReaping returning at once): 6 adopted zombies left, red.
2026-11-13 10:29:07 +08:00
yetone 422f90e80b davsync: WebDAV answers a Digest challenge, MD5 and SHA-256 (caelum1990 on X)
Sync signed in with Basic only, so a server that takes Digest only (Apache
mod_auth_digest, some NAS and nginx setups) answered 401 and magpie said
the password was wrong. digestTransport (RFC 7616, qop=auth, -sess too)
wraps the dav client: a 401 with a Digest challenge is sent again with a
Digest header made from the same user name and password, SHA-256 chosen
over MD5 when both are offered, and the challenge is kept, so the
requests after it carry Digest with a rising nc and Basic is not sent to
that server again. A PUT's body is made again from GetBody. A Basic
server is untouched.

Run: go test ./internal/davsync under mote-run, ok; vet darwin, linux
nogui and windows on the package. New: TestDAVDigest (MD5, SHA-256 against
a fake Digest-only server that checks response, nc replay, opaque, uri and
the PUT body), TestDAVDigestWrongPassword (still reads as a wrong
password; a Basic server is left alone).
Broken by hand: newDAV without the transport, TestDAVDigest red with
"refused the user name or password (HTTP 401)".
Not tried: a real Digest server (only the fake, built from the RFC's
formula); auth-int and SHA-512-256 are not answered. The first request of
a connection still carries Basic, as before, so a Digest-only server over
plain http sees the password once; nothing else was changed in that path.
2026-11-13 10:23:47 +08:00
yetone efc3e1e56b remote quotas: a Remote with no picks tells every card, a usage-only provider's included (fcooji on X)
On 0.1.3959 Claude Code set to usage only on the remote magpie showed no
usage on the local magpie that added it as a Remote. A usage-only provider
lists no model there, so a Remote with nothing picked here exposes only
what the remote lists, and cfd49e36a/93b855d90's filter by enabled models
dropped the Claude card. Only the user's own picks (Provider.Models) narrow
cards now; no picks, or Select none, tells all of them.

Run (mote): TestRemoteUsageOnlyProviderStillShowsItsCard is red with the
new rule turned off by hand (map[office/codex:true]), green with it;
-run 'Remote|Quota|Card' in internal/provider and internal/gateway ok; go vet
darwin/linux/windows of internal/provider ok; gofmt clean.
Not tried: two real magpies in sandbox HOMEs (a fake peer and list server in
the test), the GUI suite (Go only), the full Go suite (started after the tag).
2026-11-13 10:22:01 +08:00
yetone e6eaf4d69c site: a mirrors page in en, zh and ja
/docs/mirrors says how magpie downloads from China: the Plugins page's
Mirrors in China switch (npm at registry.npmmirror.com, Bun at
npmmirror's binary mirror, the plugin list at jsDelivr, bun add pointed
at npmmirror unless a registry is set), --proxy and --mirror for the
installer and magpie update, magpie update mirror and Settings' Download
source, the MAGPIE_MIRRORS fallback with MAGPIE_NPM_REGISTRY and
MAGPIE_GITHUB_MIRROR, and what is checked: update files against
usemagpie.ai's SHA-256, Bun's zip and npm integrity, credentialed
requests never mirrored. Every claim is from docs/reference.md (Mirrors,
the install and update section), internal/source/source.go and
internal/cli/update_cli.go, with the labels' zh and ja from i18n.js.
Linked from each language's troubleshooting page; in the sitemap,
llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a download through the mirrors from China for this page; it
names only what magpie's reference and source say.
2026-11-13 10:15:28 +08:00
yetone 2ae8e61a4f usage: an upgrade reads session files again only when the code of their rows changed (#2278)
requests-v1.bin and log-v1.bin were keyed on a hash of every .go file in
internal/usage, so nearly every release that touched the package threw
both away. The first start after such an upgrade read all ~24k call
shards again: on the owner's real accounts (mote, acctp sandbox) that is
13.8s of CPU and ~3.4GB allocated before the page settles, against 2.4s
warm.

Each file now keys on the source its rows are made, written and read
through: rowSource (15 files) and logSource (23 files), embedded by name.
The row pricer and a file's chunk builder are lifted out of
readRequestBlocks (sessionRowPricer, sessionChunk) so they can be roots.
TestRequestDiskNamesTheCodeOfItsRows type-checks the package and walks
every declaration reached from those roots (uses, package vars assigned
elsewhere, interface calls, encoding/String/sort methods); it fails when
a reached file is not embedded or an embedded one is not reached.
Of the last six usage-changing releases, four (3962, 3958, 3941, 3908)
would have kept the cache.

Run:
- go test -count=1 ./internal/usage on mote: ok 51.9s.
- go vet ./internal/usage for darwin, windows, linux on mica: ok.
- Broken by hand: session_provider.go left out of rowSource's embed ->
  "rowSource: session_provider.go is reached but isn't in its go:embed",
  FAIL; restored.
- Real accounts on mote (pageheap.sh, page open, CPU at mark):
  w47v first start after an older binary 13.80s, numGC 217 (rebuild,
  expected); w47v again 2.45s; w48v (w47v plus a live init() in
  effort_split.go, a different binary) 2.59s, numGC 56; back to w47v
  2.43s. Before, the same swap cost ~14s.
Not tried: Windows or Linux real start.
2026-11-13 10:09:27 +08:00
yetone 1f4f1874b5 site: a sync page in en, zh and ja
/docs/sync says how magpie keeps computers in sync: what the sealed file
holds (providers and keys, settings, profiles, agents' models, the
library, npm and git plugins, gateway keys) and what it doesn't
(subscriptions' sign-ins), WebDAV (坚果云, Nextcloud, Synology), S3
(R2, B2, MinIO, path-style, OSS without conditional writes) and private
GitHub repos, every 3 minutes with merged conditional writes, Kept on
this computer and Follow the others, and the one-off magpie backup and
restore with AES-256-GCM and PBKDF2-SHA256. Every claim is from
docs/reference.md (Moving to another machine, Keeping machines in sync),
with the labels' zh and ja from i18n.js and the commands checked in
internal/cli/main.go. Linked from each language's start page; in the
sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real WebDAV, S3 or GitHub sync for this page; it names
only what magpie's reference says.
2026-11-13 09:40:15 +08:00
yetone dbb2e5dd29 site: an OpenCode Go and ClinePass page in en, zh and ja
/docs/coding-plans says how magpie serves the two monthly plans for
open coding models in any agent: OpenCode Go's three endpoints as Go's
docs give them, each model sent on the protocol Go serves it on as
OpenCode does (no more "Model does not support this protocol"), old
addresses moved, and its 5-hour, 7-day and monthly windows on Quota;
ClinePass at api.cline.bot with the plan's and Cline's free models from
the list Cline's clients use, the free ones apart from the plan's quota
and asked with the desktop app's headers. Every claim is from
internal/provider (presets.go, opencode_endpoints.go, planquota.go,
cline.go, models.go), with the labels' zh and ja from i18n.js. Linked
from each language's opencode-models page; in the sitemap, llms.txt and
llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real OpenCode Go or ClinePass key for this page; it names
only what magpie's source says.
2026-11-13 09:06:26 +08:00
yetoneandvincent 363adb3528 plugin: the auth-lock test checks the loop ran while the lock was held, not how often a timer ticked (#5271)
TestAuthLockWaitDoesNotFreezeTheHost counted a 20ms setInterval over a
300ms sleep and wanted 8 ticks. A loaded runner fires the timer late and
counts fewer while the loop is free all the same: 7 of 8 on mote (#5271),
6 on ubuntu CI at f28787b39 (run 43328831902). It measured the scheduler,
not the freeze it is named for.

Ported from skygunner's fork commit 94d8550c8 (on #5271): a setImmediate
registered before changeAuth checks, from the event loop itself, that the
other host's lock is still there and the change not yet written, then lets
the lock go; the test awaits that and the change. A host that waits with
Atomics.wait (#5112) never reaches the check while the lock is held. The
300/600ms sleeps, the tick count and the 5s bound go; the 20 concurrent
changes and the stale-lock takeover are kept as they were.

Run at this tree (origin/main 1e2ce2463 plus this):
- Linux (wsl-run): go vet ./internal/plugin; -count=20 -run of the test: ok.
- macOS (mote-run): the same, ok.
- gofmt -l: nothing.

Broken by hand on Linux: host.js's sleep made a blocking Atomics.wait. The
test went red at 10.1s, "the event loop ran while the other host still
held the lock"; host.js put back.

Not run: the full suite, and Windows.

Co-authored-by: vincent <webmaster@palmit.com.au>
2026-11-13 08:52:12 +08:00
yetone 6af6ae9885 usage: a log of MCP calls and probes keeps its blocks on disk too (#2278)
log-v1.bin was written only once a gateway block had filled. A log of
MCP tool calls and probes has none (the real-account sandbox's 8.3 MB
log is 25,223 MCP lines and 2,539 probes, 54 probe blocks, 0 gateway
blocks), so full.n stayed 0, the file was never written, and every
start parsed all 27k lines again: readLogSnapshot took 60 MB of the
start's allocations. The probes that were kept went as JSON and were
parsed back a record at a time.

A full point is now marked too when a probe block fills while no
gateway row stands after the full blocks, and it records how many probe
blocks were full there (logFull.probes). Those go to the file as binary
entries, as the gateway blocks do, read from its mapped pages; only the
probes after them, up to the full point, still go as records. The file
is written again when its full point reaches further (by offset, not
the gateway block count). The magic is magpie-log-v2, so a v1 file is
parsed over once.

Run:
- go vet ./internal/usage; go test ./internal/usage ./internal/gateway
  (mica, -timeout 45m): ok usage 31s, ok gateway 859s.
- TestStartReadsKeptProbeBlocks (new): an MCP-only log of 3 blocks + 100
  is kept, a start reads 3 blocks from the file, and reads as a whole
  parse. Broken by hand (no probe full point): red, "a log of probes
  wasn't kept".
- Real-account sandbox on mote (acctp, page open 2.5 min, version
  0.1.3961 builds): log-v1.bin written on the first start (645 KB);
  warm starts, w45v (v0.1.3961) against this:
    CPU at mark  3.21s, 3.00s  ->  2.50s, 2.39s
    allocated    701 MB        ->  646 MB, 629 MB
    readLogSnapshot cum 60 MB  ->  2.6 MB
    numGC        66            ->  56
  Footprint 128-133 MB -> 132-135 MB, liveHeap ~80 MB both: the same
  within noise.

Not tried: a log with both gateway and probe blocks across a v1 -> v2
start on a real account (the unit test's mixed log covers the format).
2026-11-13 08:51:24 +08:00
yetone 1e2ce24631 site: a free models page in en, zh and ja
/docs/free-models says how magpie serves free models: OpenCode Zen's
-free models and big-pickle with no key, asked for as OpenCode asks;
Kilo Gateway's :free models with no key, anonymous by IP at 200 requests
an hour, a key for the rest; the free mark in pickers (PricedFree: that
provider's $0 price on every count, not a maker's free tier or a plan's
list, a price the user set wins); free models first in a routing group;
and a deprecated model leaving the lists until answered or a week.
Every claim is from internal/provider (presets.go, kilo.go, models.go)
and docs/reference.md, with the label's zh and ja from i18n.js. Linked
from each language's nvidia page; in the sitemap, llms.txt and
llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real OpenCode Zen or Kilo request for this page; it names
only what magpie's source says.
2026-11-13 08:32:42 +08:00
yetone 235ed22eb1 LESSONS: 11-13, a budget's pass recorded at a tree it wasn't run at 2026-11-13 08:18:51 +08:00
yetone 5a44051eb5 gui: Discover's long-list hook moves into plugingrid.js, and the core budget carries the rest
TestCoreScriptBudget has been red on main since 5a0e0378c (06:00): the
core's scripts were 1,265,848 bytes against 1,265,544. 5a0e0378c added
344 bytes of code to plugins.js, and its body says the budget passed at
7583ed65c, but at 7583ed65c the core had only 40 bytes of room. CI's
first full run after it (e9e63c6d7, run 43323956017) went red on ubuntu
and macOS with those numbers.

The redraw that followed the import, and the threshold, now live in
plugingrid.js: pmVirtualGrids(page, card, body, draw) draws Discover's
body again from a microtask, once plugins.js holds what it returned, when
a list of VMIN cards or more was drawn whole before the import came. It
returns min, so plugins.js reads the threshold from it. plugins.js keeps
only the import, cardGrid and the three now() calls: 136 bytes out. The
budget carries the other 168, with why in its comment. The comment also
had ee1553913's "+1,112 for Codex's Open button" twice; the budget was
raised by 1,112 once (1,264,432 to 1,265,544), so one copy goes.

Run on mote at this tree (origin/main 390dd407b plus this), mote-run:
- go vet ./internal/gui; go test -run 'TestCoreScriptBudget|TestAppScript'
  ./internal/gui: ok. gofmt -l: nothing. node --check on both files.
- plugin-discover-virtual 22 of 22, plugin-market 6, plugin-kinds-discover
  22, plugins-more-discover 6, plugin-progressive 6, i18n-keys 4: all pass.
- old-webkit: 2 reds, the known ones (headerpresets.js #6030, :has()
  #5919), as 5a0e0378c recorded.
- Recomputed the budget's measure at 7583ed65c, 5a0e0378c and this tree
  with a copy of codeBytes: 1,265,504, 1,265,848, 1,265,712.

Broken by hand: with the microtask redraw taken out,
plugin-discover-virtual still passes 22 of 22, so the "drawn whole before
the import" redraw has no test, before this change and after it.

Not tried: the real app; a long list drawn before plugingrid.js arrives.
2026-11-13 08:18:10 +08:00
yetone 390dd407b9 site: a Fireworks and Fireworks Nexus page in en, zh and ja
/docs/fireworks says how magpie serves Fireworks AI and Fireworks
Nexus: the fireworks preset on Chat Completions at
api.fireworks.ai/inference/v1 with models.dev's fireworks-ai list, the
agents' other APIs translated; the fireworks-nexus preset with keys from
nexus.fireworks.ai on Chat, Responses and Messages, auto as its list
since Pro and Team refuse an open model with a 403, Enterprise models
typed in, and Claude and GPT through the x-anthropic-api-key and
x-openai-api-key headers the editor offers (HeaderHints) or set with
magpie provider set header.<Name>=. Every claim is from
internal/provider/presets.go and docs/reference.md, with the labels' zh
and ja from i18n.js. Linked from each language's groq page; in the
sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real Fireworks or Nexus key for this page; it names only
what magpie's source says.
2026-11-13 07:58:54 +08:00
yetone abacab7207 provider: a model's listing providers share one copy of each provider
listedBy, the providers listing each model (for a model no catalog entry
has), appended a copy of the whole Provider (1.3KB) for every model of
every provider. It now keeps one copy per provider and every model points
at it; the one caller copies the provider it returns, as before.

Measured on mote with a real-account sandbox HOME (network blocked),
2.5 min with the usage page open, alloc_space of listedBy:
  w44 (5a0e0378c) 29.56 MB, w45 (this) 10.81 MB; total 809.5 -> 790.3 MB.
liveHeap 81.2 -> 81.0 MB (the map is rebuilt, not held long).

Run at this tree on mote: go vet ./internal/provider; go test
./internal/provider (ok 138.6s) ./internal/gateway/... (ok 906.9s);
gofmt -l clean. Not added: a test for the sharing itself.
2026-11-13 07:52:48 +08:00
yetone f28787b396 site: an API relay page in en, zh and ja
/docs/relay says how magpie serves an API relay as a provider: the
relay presets (AiHubMix, PipeLLM, 302.AI, CherryIN, 鱼鱼连线 and its
three lines) and a custom one by url=, anthropic= and responses=; a
Claude model sent on Messages when the relay has an Anthropic address,
since relays drop cache_control on Chat (MessagesFirst, OnMessages,
#997); magpie model price for a relay's real prices and the renamed
model's price; magpie model wire, context and output; and
refresh-every and auto-include for the list. Every claim is from
docs/reference.md and internal/provider/presets.go and provider.go,
with the label's zh and ja from i18n.js. Linked from each language's
openrouter page; in the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real relay key for this page; it names only what magpie's
source and reference say.
2026-11-13 07:25:59 +08:00
yetone 61be687ffa claudetui: /usage's saved figures are not told when the refreshed panel's redraw stalls (#6376)
TestShimWaitsPastSavedUsage/refreshed went red on macOS CI at 7583ed65c
(run 43313397426): the shim told the figures of the "Refreshing…"
screen, the ones Claude Code saved, as today's.

The look of the panel kept while "Refreshing…" was on screen stayed
kept after Claude Code cleared the screen to draw the refreshed panel.
When that redraw stalled a second after its clear, as on a loaded
runner or a busy machine, the screen no longer said "Refreshing…", the
kept look counted as figures, the screen had stood still for
commandSettle, and the saved figures were told.

Now a look saying "Refreshing…" is not kept, the looks kept before it
are dropped once it is drawn, and after it only the screen as it is now
(or a look kept since) counts as figures or as the panel drawn.

Run on mote:
- the new subtest "refreshed after a stall" (the fake clears the screen,
  then waits 2s before the figures) on the old tui.go: red with CI's
  exact output (8% / Nov 8 told as today's)
- with the fix: go test -count=3 -run 'TestShimWaitsPastSavedUsage|
  TestShim.*Usage' ./internal/claudetui ok; go test ./internal/claudetui
  ok; go vet for darwin, windows and linux ok; gofmt -l clean

Not tried: a real Claude Code /usage that refreshes; Windows' pseudo
console run of the package.

Fixes #6376
2026-11-13 07:15:55 +08:00
yetone 482653868b gui: a provider row's read-once test measures the row's own work apart (#6375)
TestProviderInfoReadsTheListOnce was red on main since e6184b368 on
ubuntu and macOS CI (10367939 bytes against a list of 1015856, bound
5 lists). The row still reads the list once. e6184b368 made p.Available()
8x cheaper (8572862 to 1015856 bytes on mote) while each model's own
price, window and protocol look-ups stayed at ~5.4 MB, so a bar of
"5 lists" stopped meaning anything.

The test now measures three things: the list (p.Available()), the
listing a row is built from (p.Listing()), and the row's own work with
the listing handed in (providerInfoWith). A row reading the list once
takes listing + rest; the bound leaves half a list of room, so one more
read of the list is red.

Run on mote at origin/main e9e63c6d7 + this:
- go test -run TestProviderInfoReadsTheListOnce -count=5 ./internal/gui:
  ok, a row 10358027..10447395 bytes against listing + rest
  10400727..10417507.
- Broken by hand: an extra p.Available() in providerInfo makes it red
  (11411529 against a bound of 10947066). The old bound let that pass.
- Bisected at 66f98d9d6 and ac15036ab (green, list 8.57 MB) against
  e6184b368 (red, list 1.02 MB).
- go vet ./internal/gui ok, gofmt -l clean.

Not tried: Linux. The WSL box has no gtk4/webkitgtk-6.0 dev packages,
so internal/gui doesn't build there; ubuntu CI ran the same numbers as
mote before this. Not run: the rest of internal/gui (test-only change
to this one file). TestShimWaitsPastSavedUsage/refreshed, red on macOS
CI in the same run, is a separate test and not touched here.

Fixes #6375
2026-11-13 07:05:00 +08:00
yetone e9e63c6d77 site: an NVIDIA NIM page in en, zh and ja
/docs/nvidia says how magpie's nvidia preset serves NVIDIA NIM with one
build.nvidia.com key: Chat Completions alone at
integrate.api.nvidia.com/v1, since NIM's /v1/responses answers for few
models (#197), with Claude Code's and Codex's requests translated;
nvidia/<model> ids; the free badge for models NIM prices at 0, scoped to
NIM (PricedFree, catalog.go); imported per-key copies folded into one
provider (FoldCopies, fold.go); OpenCode's nvidia provider imported as
the preset; and that magpie doesn't say how a NIM key bills
(unsaidPresets). Every claim is from internal/provider and
internal/catalog, with the labels' zh and ja from i18n.js. Linked from
each language's modelscope page; in the sitemap, llms.txt and
llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real NVIDIA NIM key for this page; it names only what
magpie's source says.
2026-11-13 06:52:49 +08:00
yetone aa3fe0c79b site: a Vercel AI Gateway page in en, zh and ja
/docs/vercel says how magpie's vercel preset serves Vercel's AI Gateway
with one key: Chat Completions and Responses at ai-gateway.vercel.sh/v1
and Anthropic Messages at its root, maker/model ids, a Claude model sent
on Messages whatever the agent spoke so cache_control holds
(MessagesFirst, OnMessages, #997), and the model list sorted by Vercel's
own row types: chat models with context_window, image, video,
embedding, reranking, speech and transcription models to their APIs,
evaluation models, realtime voices and -batch ids left out. Every claim
is from internal/provider/presets.go and provider.go and
internal/catalog/live.go, with the label's zh and ja from i18n.js.
Linked from each language's openrouter page; in the sitemap, llms.txt
and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real Vercel AI Gateway key for this page; it names only
what magpie's source says.
2026-11-13 06:19:05 +08:00
yetone 5a0e0378c0 plugins: Discover draws only the cards near the view in a long list
The owner, 11-13: "这个页面有点卡,记得做列表虚拟化" (Plugins › Discover with
Subscriptions picked, 369 cards). Every redraw of Discover's body (npm's
numbers coming in, a count changing) made all of them again.

A grid of 48 cards or more (a kind picked, a search that matches hundreds,
npm's hits) now draws only its rows near the view, 700px past each edge,
and keeps the whole list's height in its padding above and below. The rows
follow the scroll and the width (a ResizeObserver on the page): columns are
read from the grid's own computed columns, so narrow widths and every
language lay out as before. Row heights are measured as they are drawn. A
card with focus stays in the page, held where it would be, so keys go on
from it. Cards are made once per list and kept, so a click lands on the
same node. A list shorter than 48 is drawn whole, as before.

The code is in plugingrid.js, imported when Plugins first draws, so the
core doesn't grow: TestCoreScriptBudget was 3,299 bytes over with it in
plugins.js. Until the import lands, a long list is drawn whole, and the
body is drawn again once it has.

Measured with plugin-discover-virtual.test.cjs's PERF=1 on mote (load
~25 to 55, so the times are high). The time is from the Subscriptions
click to the cards drawn, with a market of 503 plugins (370 subscriptions).
- Before (origin/main): chromium 69.0ms at 1180px and 56.5ms at 420px,
  webkit 77ms and 74ms. 370 cards and 9,312 nodes in #view-plugins.
- After: chromium 6.2 to 9.7ms, webkit 10 to 13ms. 30 cards and 810 nodes
  at 1180px, 10 cards and 312 nodes at 420px (de: 9 and 285).

Guard: plugin-discover-virtual.test.cjs (new), in chromium and webkit, in
en, zh, zh-TW, ja and de, at 1180px and 420px. It checks:
- at most 72 cards are drawn, and the list keeps its whole height;
- wheeling to the middle never shows an empty stretch, and the focused
  card is kept;
- at the bottom pv-369 is in view and its Install posts its spec;
- "pv-12" lists all 11 matches, and "pv" draws at most 72;
- nothing scrolls sideways, and there are no page errors.

Broken by hand: VMIN at 1e9 (every list drawn whole) turned it 22 of 22 red.

Run on mote at this tree, before the rebase (mote-run):
- go test ./internal/gui: ok (the budget too). gofmt -l: nothing.
- plugin-discover-virtual: 22 of 22.
- Every GUI file that draws plugin cards or Plugins (the 54 that grep finds
  pm-card, view=plugins or pluginAgentsTo), with i18n-keys and
  i18n-en-no-cjk: all pass, except the reds below.
Reds, the same at origin/main be8e352a2:
- settings-lines-wrap: chromium de 440px (#6353).
- old-webkit: headerpresets.js isn't in the list (#6030), and app.css
  uses :has() (#5919). Its plugingrid.js entry is added here.
- title-bar-tools: webkit ja went red once in the first run, then passed
  10 of 10 when run again (#2740, #4716).

Run again at this commit, rebased on origin/main 7583ed65c (mote-run).
plugin-discover-virtual 22 of 22. plugin-market, plugin-kinds-discover,
plugins-more-discover, plugin-progressive, i18n-keys and i18n-en-no-cjk
all pass. TestCoreScriptBudget passes. Reds, the same at 7583ed65c run
alone:
- TestProviderInfoReadsTheListOnce: a row is ~10 lists against a bound of
  5 (#6375, filed now).
- plugin-card-update: webkit red 1 of 2 on both trees (#3079).
- old-webkit: as above (#6030, #5919).

Not tried: the real app on Linux WebKitGTK, and the real market from
usemagpie.ai.
2026-11-13 06:08:46 +08:00
yetone 7583ed65ce site: a Groq page in en, zh and ja
/docs/groq says how magpie's groq preset serves Groq with one key:
adding it, Chat Completions and Responses both at api.groq.com/openai/v1,
imports from OpenCode and other apps made the preset, Claude Code
translated to Chat because Groq's Chat reports its cache
(ResponsesTellsCache), Groq's list taken as a host's and no maker's
(Hosts), a 429 naming the model resting that model alone (modelNamed),
"reduce the length of the messages" read as an overflow the agent
compacts on (tooLongRe), an "unsupported" field asked again without
(refusesField), and Whisper and playai-tts through /v1/audio. Every
claim is from internal/provider/presets.go, provider.go, models.go,
importapps.go and import_opencode.go, internal/gateway/gateway.go,
docs/reference.md and docs/subsystems/gateway-routing.md, with the
label's zh and ja from i18n.js. Linked from each language's mistral
page; in the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real Groq key for this page; it names only what magpie's
source and docs say.
2026-11-13 05:45:27 +08:00
yetone aa84b568d6 claudetui: the undrawn-Claude test leaves its fake room to start
TestShimSaysWhatAnUndrawnClaudeWaitsOn/keychain went red on macOS CI
at fa7e466ac: "showed no prompt in the 100ms its caller waits for it
... it runs no command". The test fixes the shim's deadline 3s out
before the shim and its fake start; the loaded runner spent all but
100ms of it there, and the fake had not started its Keychain read when
the shim looked. The window is now 10s for each case.

Run (wsl-run, magpie-desktop; mote and mica were over their cores):
- broken by hand: a 2.9s sleep after the deadline is set and a 300ms
  sleep before the fake starts `security`. Old 3s window: red with
  CI's own message ("in the 100ms ... it runs no command, 8 MiB
  resident"). New 10s window, same injection: ok.
- injections removed: go vet and go test -count=1 ./internal/claudetui/
  ok (133s); gofmt -l clean.
Not tried: macOS (the fake and the shim are the same on darwin; the
Keychain clause is what the injected run checks).
2026-11-13 05:37:07 +08:00
yetone 5f5307ab6d gui: each embedded file is hashed once, not on every load
revalidated read each embedded file again on every request to make its
ETag, and the page "/" read and hashed every file it names to version
their URLs. A release's files never change, so each one's sum (and the
versioned page) is now kept in a sync.Map after its first read. A dev
build (-tags dev) reads from disk and keeps nothing.

Measured: TestStaticFilesHashedOnce, 20 loads each, on mote:
  with the memo   green (app.js under 1x its size, page under 6x its)
  memo off by hand  app.js 26,516,856 B; page 165,916,424 B (~8 MB a
                    page load) - red
Run on mote: go vet ./internal/gui and -tags dev; go test -run
"StaticFilesHashedOnce|VersionedFilesKept|WebCompresses|PageFilesRevalidate|Revalidat"
./internal/gui ok.
Not tried: the full GUI suite (no change to what is served).
2026-11-13 05:31:22 +08:00
yetone a8b0e80f65 usage: the request page's probes are made into a chunk once per change
readRequestBlocks made probeChunk again on every poll of the Requests
and Usage pages: a rowChunk holding every probe since the period's
start minus a day, interned again each time. On the real-account
sandbox it was ~45 MB of 952 MB allocated in two and a half minutes
(rowChunk.add under probeChunk, #2278).

probeChunk now keeps the last chunk it made, with the probe blocks,
since, renames and hosts it was made from. A frozen block is never
written again (a new probe reopens the tail as a copy), UsageRenames
hands back the same maps while providers.json is unchanged
(Renames.Same compares them by identity), and hosts are compared by
content, so the same inputs make the same chunk, which no reader
writes. Any of them changing makes it again.

TestProbeChunkMadeOncePerChange: the same inputs give the same chunk;
a later since, a changed host and a new probe each make a new one.


Measured on mote with the real-account sandbox (pageheap.sh, the
request page polled to the mark): probeChunk allocated 43.81 MB at the
base (w42) and 24.54 / 24.10 MB with this (w43, two runs). It is not
zero there because the sandbox's network is blocked, so every probe
fails and logs a new row, which makes the chunk again.
Run on mote: go test ./internal/usage ok (33.9s); the test is red with
the memo turned off by hand.
2026-11-13 05:31:22 +08:00
yetone e6184b368a provider: a provider's models.dev models are read, not copied three times
Provider.available, the base of every Available and Exposed, made three
copies of a provider's catalog models on each call: catalog.Provider
cloned the built list, available appended it into a list of its own to
drop an id two catalogs share, and the list without experiments and
previews was grown from nothing again. On a page open with the owner's
accounts that was 74 MB of 952 MB allocated in 2m32s, the largest flat
allocator of all.

catalog.ProviderShared is the built list itself, for a reader
(catalog.Provider still hands out a copy). available reads it through
catalogsOf, which copies only when two catalogs are joined, and sizes
the released list before filling it. The shared list is never returned:
every way out of available returns Decorate's list, the released copy
or the signed-in account's own. The built list is clipped, so an append
to it reallocates.

Run: go test ./internal/provider ./internal/catalog on mote (ok,
provider 135s). Measured on mote's real-account sandbox (acctp, the
Usage and Providers pages polled for 2m32s, pageheap.sh), w41 = the
parent, w42 = this commit: allocations 993 -> 858 MB, available's
cumulative 144.5 -> 52.3 MB, CPU at the settle mark 3.32 -> 3.18 s;
footprint 130 MB and live heap ~76.7 MB both unchanged. The parent's
full suite at d1e823d5f (same Go tree) was 99 ok, 0 FAIL; this
commit's provider and catalog packages ran again, not the full suite.
2026-11-13 05:15:44 +08:00
yetone ac15036ab4 provider: a catalog entry points at its provider instead of copying it
Entry.Provider was a Provider value, 1,328 of an Entry's 1,760 bytes,
copied into every model of every provider each time a catalog, an
agent's list or a routing group's entries were built. It is now a
*Provider: entriesOf and decide's list give every model of one provider
the same one (sharedEntry), and a group's entry points at its first
member's. It is read only; every place that hands it on as a value
(Resolve, CanFast, ownAgent, modelAllowed, …) dereferences it, so what
they get is a copy as before. entryFor keeps its signature for the one
model ServedEntryOf builds; offEntries' entries now carry their provider
too.

Measured on mote with the owner's real accounts (acctp sandbox, page
open for 2m32s, w40 = before, w41 = this, alternating):
- catalogOf's allocations 106 MB -> 67 MB, providerEntries' 88 -> 78 MB
- CPU at the page's settle mark 3.42/3.33 s -> 3.18/3.30 s
- live heap unchanged (76.3/76.1 -> 76.7/75.9 MB): the lists are
  rebuilt, not kept, so the copies were churn for the GC, not held

Run: go build and go vet ./... and the tests compiled (go test -run ^$)
on mote; the full suite at this tree (d1e823d5f) on mica: 99 packages ok, 0 FAIL (agent 317s, gateway 972s, gui 188s, provider 220s, usage 56s).
2026-11-13 05:12:30 +08:00
yetone 0fa15db1ca site: an Azure OpenAI page in en, zh and ja
/docs/azure says how magpie's azure preset serves the user's own Azure
resource: the endpoint and key from the portal (the editor's Endpoint,
or provider add azure <key> url=…), every address form AzureBase takes
moved onto the v1 API under /openai/v1 with no api-version, the key in
api-key and never a Bearer, deployments' names as the model ids and
what to type when no list comes back, an API Management gateway's URLs
kept, headers with ${sessionId}, imports made the azure preset,
content_filter read as a policy refusal (#248), Codex's bare reasoning
items left out unless store is true (#1008), and the Decisions API at
/openai/v1/decisions. Every claim is from internal/provider/azure.go
and presets.go, internal/gateway/fallback.go (policyRefusal),
internal/cli/providers_cli.go, docs/subsystems/gateway-routing.md and
providers-accounts.md, with the labels' zh and ja from i18n.js. Linked
from each language's openai page; in the sitemap, llms.txt and
llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real Azure resource for this page; it names only what
magpie's source and docs say.
2026-11-13 05:12:01 +08:00
yetone 66f98d9d65 gui: the add sheet's tools show in the title bar once scrolled out of sight
The owner, 11-12, on the Providers page's Add sheet: 向上滑动,然后这些区域
不在可视区域的时候,这些区域应该自动浮现在Header处. Beside the sidebar
(side-nav, a window 1024px wide or more), the sheet's search, Custom
provider and Import… now show in the title bar's empty right, left of its
buttons, once the sheet's head row has scrolled out of sight. They are put
there the way Library's, Plugins' and Settings' tools are: position: fixed
inside --tools-l/--tools-r/--top-h, which app.js tools() keeps out of the
crumb's way (its head query now includes #addSheet .add-tools.afloat).
Scrolled back up, they are in their row again. Close stays in the sheet;
the screenshot's box didn't cover it.

The group is pinned, never copied, so there is one search: the words typed
and the focus stay with it both ways. Each change is a 180ms fade in going
into the bar and 140ms coming back, cubic-bezier(.23, 1, .32, 1), opacity
only, so reduced motion keeps it. Nothing moves in the sheet: the head row
keeps its height while its tools are up.

Narrow (no sidebar, which covers 420px and the panel): the bar has no free
room, so the sheet's whole head (label, tools, Close) is held at the top of
the page while the sheet is under it, the way Settings' head is in a narrow
window. It has the same blur strip and a hairline once stuck. At 760px and
under, the tools take a line of their own under the label.

The code is in a new addfloat.js, which renderAdd imports the first time the
sheet opens. In app.js it took TestCoreScriptBudget 487 bytes over
(1266031 > 1265544); with the move the budget passes and isn't raised.
old-webkit's list of scripts loaded on demand names it.

Run at 39ac4fafe (on origin/main 2d2333cfa), then again after rebasing on be8e352a2:
- New add-sheet-float.test.cjs: 22/22 (chromium and webkit; en, zh, zh-TW,
  ja, de; 1100px and 420px). It scrolls with the real wheel. In the bar,
  it checks the search is in the title bar left of its buttons and right
  of the crumb, with Custom provider and Import… there too; narrow, that
  the head is held at the top. Then: the search is clear to press, a click
  scrolls nothing and takes the focus, typing "Relay 2" filters the tiles
  with one search kept, and scrolling back puts it in its row with the
  words and focus.
- Red on the old code (git archive of the base's internal/gui): 0/22, on
  "in the bar once out of sight" (wide) and "the head held at the page's
  top" (narrow).
- go test ./internal/gui -run Budget: ok (mica).
- Related GUI files on mote, both engines, 380 tests, 376 pass: add-sheet,
  add-sheet-custom, add-button, add-partners-shine, add-sponsor-me, the six
  providers-*, i18n-keys, provider-detect-draft, provider-env-paste,
  provider-add-gemini, provider-retrieval-only, provider-url-each-api,
  modal-title-drag, model-id-space, builtins, old-webkit. The four reds are
  filed and come from other changes:
  - add-sheet "quiet rows" chromium en: tlscerts.js reads a null draft's
    serverPin (#6216). It was red in en, and in zh after the rebase, both times
    beside other files. Alone, chromium, 2/2 green on origin/main and 2/2 here;
  - old-webkit: headerpresets.js isn't in its list (#6030);
  - old-webkit: .side-foot:has() in app.css (#5919).
- After rebasing on be8e352a2: Budget ok; add-sheet-float, add-sheet,
  old-webkit and i18n-keys 34/38, the same three filed reds.
- i18n-keys first ran out of memory under mote-run -C internal/gui: it
  walks ../../.., which there is all of ~/runs. Run from the tree's root:
  4/4.

Not tried: the real app (Wails on macOS, WebKitGTK on Linux, WebView2 on
Windows). Only Playwright's engines were run, so the title bar's dragging
around the pinned tools (--wails-draggable) wasn't checked in a real
window.
2026-11-13 05:08:10 +08:00
yetone 046a131304 gui: an agent's Long conversations is one row, and its context window is picked
The owner (11-12): an agent's sheet showed Long conversations twice, every
agent's row above the agent's own, which read as the same setting twice.
Now the sheet shows one row, the agent's own (.own-compact hides
#fullContextRow there). It shows the agent's own value, else every agent's,
and a change posts settings/agent-compact {agent, own: true, full, at}, so
it is that agent's alone. Settings keeps every agent's row for when no agent
holds one. The Context card's note says "Long conversations in {agent}" when
the agent holds its own value (context.js), in en/zh/zh-TW/ja/de.

The agent's context window (agentwindow.js) is picked, never typed as a
syntax: one size for all its models from the app's menu (Each model's own,
128K to 1M, Other size… typed as 300k), and "Set a model apart" adds a
model from the agent's model picker with its own size, a line each, with a
remove button.

Tests rewritten to the one row, keeping what each guarded:
- compact-one-value: Tuned for you and Long conversations are one window,
  now through the agent's own value and its post.
- codex-compact-held: Codex's held values are under the agent's row.
- agent-prefs: what an agent's opened row and its panel sheet show
  (#fullContextRow hidden, .row.agent-compact visible).
- compact-at: a typed size posts settings/agent-compact for Claude Code,
  and never settings/full-context.
- codex-memories-settings "no Codex, no memories row": waits on the
  merged row, lists the visible rows in its message.
- agent-compact, agent-window: the new row and the picker.

Run on mote (macOS, Playwright 1.62.0, chromium + webkit, every language
each file covers, narrow and wide), at f9bc297a5 + this change; origin/main
then rebased (main has since changed app.css and app.js; see below):
- go test -run 'TestCoreScriptBudget|TestAssetBudget' ./internal/gui: ok
- agent-window 20/20, agent-compact 8/8, compact-one-value 12/12,
  codex-compact-held 20/20, agent-prefs 56/56, claude-cache 8/8,
  context-tune 284/284, compact-at 8/8, settings-general 20/20,
  i18n-keys 4/4, i18n-en-no-cjk 4/4
- codex-memories-settings 8 pass / 10 fail; after the no-Codex fix that
  subtest passes 2/2. The other 8 (chromium "picking a model scrolled the
  page 944 !== 1056") fail the same on origin/main dbaf9d68c: #6372.
- agent-details-ready 4 pass / 32 fail, the same on origin/main dbaf9d68c
  ("Details must end without a height jump: 772.98 -> 852.92"): #6373
  (#6369 is the late-settings subtest).

Again at this commit on be8e352a2: the budgets ok, agent-window 20/20,
agent-compact 8/8, compact-one-value 12/12, codex-compact-held 20/20,
agent-prefs 56/56, compact-at 8/8, i18n-keys 4/4.

Broken by hand, each red, then put back:
- .own-compact > #fullContextRow removed and the card note back to the
  shared words: compact-one-value 12/12 red, agent-prefs red (en/zh, 1100
  and 440, panel). codex-compact-held stayed green; it checks the held
  values sit in the agent's row, which still holds them.
- own: true dropped from the agent-compact post: compact-at 4/8 red,
  agent-compact red, compact-one-value red.
- "Set a model apart" not drawn: agent-window red.

Not tried: the real app, and a real Codex or Claude Code session reading
the agent's own compaction size.
2026-11-13 05:07:32 +08:00
yetone be8e352a20 editor: Proxy takes no room unless Custom is picked
The owner (11-12, "这些空白看起来好难受"): the Custom address and its login
were visibility:hidden while not picked, so each account kept an empty
strip (43px) between its proxy segs and the next account's name. They are
display:none now, so the gaps are even. proxy-gaps measures the segs'
bottom to the next element's top at 900 and 420 in every language;
account-proxy's no-move check now covers the lines above the pick.

Run (mica, mica-run, both engines, en de ja zh zh-TW where a file takes
languages; mote was over 18 load every check):
- The four changes together: account-weight, account-proxy, routing-js
  26/26; routing-advanced, proxy-gaps, login-export, routing-save,
  key-weight green; account-arrange red as on main (#6010).
- About 40 files around the editor (prefs, check-in, warm-up, proxy,
  routing, export): 698/730. The same reds on origin/main 2d2333cfa:
  checkin-now-account (#6029), editor-advanced-align (#4615),
  settings-lines-wrap chromium de 440 (#6353), account-arrange (#6010).
  Flakes under the concurrent run: ResizeObserver page errors in
  checkin-account and codex-auto-reset-settings (commented on #6108),
  provider-advanced-fold webkit zh growth (#2552, #5417),
  proxy-login-fields chromium zh click (#6374, 5/5 alone here and on
  main). Two passes over those five files again: only proxy-login-fields
  chromium zh, once.
- i18n-keys green (no strings added).

Broken by hand, each red:
- dialog: without `.row.pref { position: relative }` account-weight
  goes red in both engines ("the dialog scrolls beside the editor
  (945,810)").
- Routing back on the editor (ed.append): routing-advanced 10/10 red.
- Export with the plus again: login-export red ("Export has the plus").
- Proxy's .off back to visibility:hidden: proxy-gaps 20/20 red ("43px
  under the provider's options").

Not tried: the whole GUI suite (another session's full suite was on
mica, mote over load), the real Linux WebKitGTK app, Windows. No Go
changed.
2026-11-13 04:51:59 +08:00
yetone c21683cbf2 editor: Export accounts is the last account row, with an export glyph
The owner (11-12): Export accounts to a file goes last of the four account
rows, after Add an account by setup-token, and has an arrow out of a tray
instead of the plus: it adds nothing. login-export checks both.

Run (mica, mica-run, both engines, en de ja zh zh-TW where a file takes
languages; mote was over 18 load every check):
- The four changes together: account-weight, account-proxy, routing-js
  26/26; routing-advanced, proxy-gaps, login-export, routing-save,
  key-weight green; account-arrange red as on main (#6010).
- About 40 files around the editor (prefs, check-in, warm-up, proxy,
  routing, export): 698/730. The same reds on origin/main 2d2333cfa:
  checkin-now-account (#6029), editor-advanced-align (#4615),
  settings-lines-wrap chromium de 440 (#6353), account-arrange (#6010).
  Flakes under the concurrent run: ResizeObserver page errors in
  checkin-account and codex-auto-reset-settings (commented on #6108),
  provider-advanced-fold webkit zh growth (#2552, #5417),
  proxy-login-fields chromium zh click (#6374, 5/5 alone here and on
  main). Two passes over those five files again: only proxy-login-fields
  chromium zh, once.
- i18n-keys green (no strings added).

Broken by hand, each red:
- dialog: without `.row.pref { position: relative }` account-weight
  goes red in both engines ("the dialog scrolls beside the editor
  (945,810)").
- Routing back on the editor (ed.append): routing-advanced 10/10 red.
- Export with the plus again: login-export red ("Export has the plus").
- Proxy's .off back to visibility:hidden: proxy-gaps 20/20 red ("43px
  under the provider's options").

Not tried: the whole GUI suite (another session's full suite was on
mica, mote over load), the real Linux WebKitGTK app, Windows. No Go
changed.
2026-11-13 04:51:59 +08:00
yetone 8f7ddb9e06 editor: Routing, Rate limited and Stays fold under Advanced
The owner (11-12): these are changed by few, so they sit at the top of the
editor's Advanced fold, collapsed by default. The fold opens on its own
when one isn't its default (routing, affinity or sink set), unless the
user already opened or closed it for this provider. Tests that pick a
routing seg open Advanced first; routing-advanced checks where the three
sit and when the fold opens, for a subscription and a relay.

Run (mica, mica-run, both engines, en de ja zh zh-TW where a file takes
languages; mote was over 18 load every check):
- The four changes together: account-weight, account-proxy, routing-js
  26/26; routing-advanced, proxy-gaps, login-export, routing-save,
  key-weight green; account-arrange red as on main (#6010).
- About 40 files around the editor (prefs, check-in, warm-up, proxy,
  routing, export): 698/730. The same reds on origin/main 2d2333cfa:
  checkin-now-account (#6029), editor-advanced-align (#4615),
  settings-lines-wrap chromium de 440 (#6353), account-arrange (#6010).
  Flakes under the concurrent run: ResizeObserver page errors in
  checkin-account and codex-auto-reset-settings (commented on #6108),
  provider-advanced-fold webkit zh growth (#2552, #5417),
  proxy-login-fields chromium zh click (#6374, 5/5 alone here and on
  main). Two passes over those five files again: only proxy-login-fields
  chromium zh, once.
- i18n-keys green (no strings added).

Broken by hand, each red:
- dialog: without `.row.pref { position: relative }` account-weight
  goes red in both engines ("the dialog scrolls beside the editor
  (945,810)").
- Routing back on the editor (ed.append): routing-advanced 10/10 red.
- Export with the plus again: login-export red ("Export has the plus").
- Proxy's .off back to visibility:hidden: proxy-gaps 20/20 red ("43px
  under the provider's options").

Not tried: the whole GUI suite (another session's full suite was on
mica, mote over load), the real Linux WebKitGTK app, Windows. No Go
changed.
2026-11-13 04:51:59 +08:00
yetone 62044305e3 editor: a check-in or warm-up row holds its hidden line, so the dialog grows no second scrollbar
A provider's check-in and warm-up rows keep a .sub line out of sight,
position:absolute under hover. Their .who is display:contents and has no
box, so the line was held against the .dialog: with Advanced open the
dialog grew a scroll of its own (e.g. 1117 over 810) beside the editor's,
and in WebKit every row was 8px narrower (de 560 "Gewicht 3 · 75%" ran
2px past its row). Happens on main whenever Advanced is opened. The row
is now the line's containing block. account-weight opens Advanced and
checks the dialog doesn't scroll.

Run (mica, mica-run, both engines, en de ja zh zh-TW where a file takes
languages; mote was over 18 load every check):
- The four changes together: account-weight, account-proxy, routing-js
  26/26; routing-advanced, proxy-gaps, login-export, routing-save,
  key-weight green; account-arrange red as on main (#6010).
- About 40 files around the editor (prefs, check-in, warm-up, proxy,
  routing, export): 698/730. The same reds on origin/main 2d2333cfa:
  checkin-now-account (#6029), editor-advanced-align (#4615),
  settings-lines-wrap chromium de 440 (#6353), account-arrange (#6010).
  Flakes under the concurrent run: ResizeObserver page errors in
  checkin-account and codex-auto-reset-settings (commented on #6108),
  provider-advanced-fold webkit zh growth (#2552, #5417),
  proxy-login-fields chromium zh click (#6374, 5/5 alone here and on
  main). Two passes over those five files again: only proxy-login-fields
  chromium zh, once.
- i18n-keys green (no strings added).

Broken by hand, each red:
- dialog: without `.row.pref { position: relative }` account-weight
  goes red in both engines ("the dialog scrolls beside the editor
  (945,810)").
- Routing back on the editor (ed.append): routing-advanced 10/10 red.
- Export with the plus again: login-export red ("Export has the plus").
- Proxy's .off back to visibility:hidden: proxy-gaps 20/20 red ("43px
  under the provider's options").

Not tried: the whole GUI suite (another session's full suite was on
mica, mote over load), the real Linux WebKitGTK app, Windows. No Go
changed.
2026-11-13 04:51:59 +08:00
yetone 2d2333cfa1 site: an Amazon Bedrock page in en, zh and ja
/docs/bedrock says how magpie's bedrock and bedrock-mantle presets serve
Claude, OpenAI's GPT models and other makers' models with one Bedrock API
key and no SigV4: adding it, region= (CLI and the editor's Region), the
runtime's given list (global. profiles for Claude and GPT, in-region ids
for the rest, geography profiles typed in), the API picked per model,
Mantle's own model list, in-region ids and two OpenAI prefixes,
Claude Code's CLAUDE_CODE_USE_BEDROCK taken out and put back, and the
anthropic-beta 400 asked again without the betas. Every claim is from
internal/provider/presets.go and provider.go, internal/cli/providers_cli.go
(applyPairs' region=), docs/subsystems/providers-accounts.md,
gateway-routing.md and agent-wiring.md, with the label's zh and ja from
i18n.js. Linked from each language's anthropic page; in the sitemap,
llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real Bedrock key for this page; it names only what magpie's
source and docs say.
2026-11-13 04:36:55 +08:00
yetone 909cd5c758 gateway tests: TestSearchQueueKeepsCodexAlive's hard cap starts at the headers
macOS CI at 9c33839de (run 43284325340) failed silent with
`Post ".../backend-api/codex/responses": context canceled`
(search_queue_test.go:112). The test's 5s hard cap, there to end a
stream of runaway pings, was armed before the request, so on a loaded
runner (internal/gateway took 1364s) it cancelled the request before
magpie's headers came. That was the path to the headers, not the stream
the cap is about.

The cap is now 60s up to the headers and 5s from them, so it still ends
a stream that never stops pinging.

Run on the Linux box (wsl-run, magpie-desktop; mote and mica at load 58
and 72), at origin/main f9bc297a5 + this change:
- go test -tags nogui -count=10 -run '^TestSearchQueueKeepsCodexAlive$' ./internal/gateway/: ok
Broken by hand: a 6s sleep before the gateway's handler in silent mode
(the loaded runner's slow headers) gives the CI error on the old test,
`context canceled` at :112, and passes with this change.
Not run: the whole gateway package; only this test's file changed.
2026-11-13 04:26:25 +08:00
yetone f9bc297a5e gui tests: TestPluginPageReadsWhatItDeclared's limiter check passes on every -count round
The check called pageSetAllowed with the fixed key "x", and its last call
stored "now + 2s" in the package's limiter. The next -count round's first
call, under a second later than that, was refused, so the test was red on
every round after the first ("pageSetAllowed"). The check now uses a key
of its own run.

Run on the Linux box (wsl-run, magpie-desktop; mote and mica were at load
58 and 72), at origin/main dbaf9d68c + this change:
- go test -tags nogui -count=30 -run 'PluginPage|PageService' ./internal/gui/: ok
Broken by hand: with the old key, the same run had 27 of 30 rounds red on
this test.
Not touched: TestPluginPageServiceProxied's ubuntu CI red at 9c33839de
(the stream ended after its first event). It passed 300 rounds alone and
30 together with the plugin page tests here; filed separately.
2026-11-13 04:23:20 +08:00
yetone 3d4c8edcea gui: Open the Codex app is in Codex's row menu, not a button on its row
ee1553913 (Yink88564391 on X) put an Open button on Codex's Agents row,
between its Details and its model picker, so that row's Details sat
further left than every other row's (the owner, 11-13: "导致整个页面在
视觉上不是对齐的"). The button is gone. Codex's row menu, beside Open in
terminal, has "Open the Codex app" where the desktop app is installed
and Open Codex with doesn't say Terminal (openApp); it posts agents/open
with the id alone as the button did. With no app, Open in terminal is
the menu's only way, as before the button. The tray panel and the web
build have neither. Its CSS and the "Open Codex in a terminal" words go;
comments and the setting's error say "Open Codex with", not the button.

codex-open-button.test.cjs now opens the menu, and checks every
connected row's Details and model picker start at one x.

Run (mica): GUI codex-open-button 62/62, agent-open-terminal 24/24,
agent-prefs 56/56, i18n-keys, i18n-en-no-cjk, chromium and webkit,
en/zh/zh-TW/ja/de, 900 and 400px; go vet internal/gui, settings,
provider; go test internal/gui, settings, provider, agent -run
"Codex|Budget|Settings" ok; gofmt clean.
Broken by hand: the button put back on the row turns the line-up check
red (codex 479 vs claude 532 at 900px, every language).
Again at 5c1c38f63 after the rebase onto dbaf9d68c (mica): codex-open-button 62/62,
i18n-keys, go test internal/gui -run "Budget|Codex" ok.
Not tried: a real Codex app open from the menu; Windows and Linux.
2026-11-13 04:22:45 +08:00
yetone dbaf9d68cc edit: TOMLTables' list is kept with the file's other answers
The Codex agent's drift lists its config's tables on every look
(TOMLTables), and the list came from the whole parse. Over a Codex
config.toml with ~11k projects, the drift polls of an open page kept that
parse (3 to 5 MB) alive and it was never let go. GetTOMLTop and
GetTOMLTable answers were already kept beside the parse. The table list
is now kept there too, copied out of the file's text, so the idle drop
can let the parse go while a page is open.

Run (mote, at 648cd3fdb + this; mote's load was ~29 on 18 cores and
mica's ~31 on 12, so neither had room and the run went to mote):
- go vet ./internal/edit; go test -count=1 ./internal/edit
  ./internal/agent ./internal/library: ok.
- New TestTOMLTablesKeptWhenIdle: red on the old toml.go ("listing the
  tables parsed the file 1 times"), green with this.
- Real-account sandbox with the owner's real probe history, web mode, page
  open in Playwright Chromium, heap at 2m32s, alternating builds:
  w39 (before) live heap 80.2 / 80.8 MB, tomlFileOf holding 6 MB;
  w40 (this) live heap 76.4 / 76.7 MB, no tomlFileOf in the heap.
  The footprint is noise (127-136 MB in both).
Not run: the full suite and the GUI suite (no GUI change).
2026-11-13 04:09:59 +08:00
yetone 1281046a02 gui: the Library's Variables tab is called Environment variables
What it holds are environment variables an agent starts with, and
"Variables" alone read as something else (the owner: 应该叫环境变量).
The tab, its empty line, its add buttons and the new item's sheet say
environment variable in en, zh, zh-TW, ja and de (环境变量 / 環境變數 /
環境変数 / Umgebungsvariablen). "Environment variables" moves into the
core i18n.js: otel's page uses the same words, and i18n-keys keeps a
plugin's words its own.

Run (mote, at origin/main ff8b43711 plus this change): library-env 12,
library-hooks 12, library-loading 6, library-subagents 12, i18n-keys 4,
i18n-en-no-cjk 4, all ok, chromium and webkit, every language.
Broken by hand: client.js back to t("Variables") turns library-env 12
of 12 and library-loading 2 of 6 red.
library-loading was red on main before this (#6204, the Claude plugins
tab); fixed in its own commit ff8b43711.
Not tried: the whole GUI suite, the real app.
2026-11-13 04:09:39 +08:00
yetone 32d6be0d05 gui: Memory has a brain of its own, in the sidebar and on its requests
The owner (11-12): Memory should have its own icon, a brain. The
Library's Memory tab had a bookmark, and Memory's own requests (the
conversations it reads into memories, made as memdistill.Agent
"memory") were drawn in Routing's graph, Usage and Sessions with the
generic cube under their raw id, since "memory" was no client.

- icons/memory.svg: a brain, 16-grid, stroke 1.4 with round caps and
  joins, as the sidebar's marks are; drawn as a one-tone mask.
- navicons.js: the Library's Memory tab draws the same path.
- agent.others: a client "memory", named Memory, with that icon, so
  /api/state's clients and agent.Looks (Usage, Sessions) name and draw
  it. It has no User-Agent: its requests are known by their token.
- TestEveryClientHasNameAndIcon: memdistill.Agent is among the ids the
  gateway records, so it must be a client with a real icon.
- tests/memory-icon.test.cjs: the sidebar's Memory tab draws the path
  icons/memory.svg has (and no other tab does), and a request from
  "memory" in Routing is drawn with the memory mask, not the cube.
  Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and 420px (no sidebar at
  420px, so there the request only).

Run on the tree rebased onto ff8b43711 (same five-file diff; the go packages and the four GUI files first ran at fa7e466ac and again here: TestEveryClientHasNameAndIcon ok, 42 of 42) (mote; mote was at load ~27 and mica ~43, mote was the less loaded):
- go test ./internal/agent ./internal/gui ./internal/memdistill
  ./internal/usageapi: ok.
- node --test memory-icon nav-sub-icons routing-client-icons i18n-keys:
  42 of 42 ok, both engines.
- go vet: darwin agent+gui; GOOS=linux agent (gui needs cgo for wails
  on linux); GOOS=windows agent+gui: ok. gofmt -l clean.

Broken by hand (origin/main fa7e466ac with the new tests):
- TestEveryClientHasNameAndIcon: "the gateway records requests as
  memory, which isn't among the clients".
- memory-icon.test.cjs with no icons/memory.svg: 2 of 2 red; with the
  svg but the old bookmark path: 12 of 22 red, every 1100px case.

Not tried: the real app on any OS; Codex's own memories model row
(MEMORIES in app.js) keeps its notebook, as it is Codex's memories, not
Magpie Memory. The Magpie Memory MCP server keeps magpie's favicon, as
magpie's other servers do.
2026-11-13 04:08:39 +08:00
yetone ff8b437117 gui tests: library-loading's tab lists include Claude plugins (#6204)
6af54dc9a gave the Library a Claude plugins tab after Subagents, always
shown, and library-loading's two tab lists were not brought along, so
the test was red in chromium and webkit on main since 11-11.

Run (mote): library-loading 6/6 ok, chromium and webkit, 980px and
420px. Before the change, at origin/main af7edcc02: 2 of 6 red (the two
tab lists), the same red #6204 names.
Not tried: the rest of the GUI suite; only this test file changed.
2026-11-13 04:05:42 +08:00
yetone 0e181b6f88 gui: the saved-proxy form's fields are the app's own, and no field falls back to the browser's
The owner, 11-12, on Settings › Network › Proxies › Add (Name,
http://127.0.0.1:7890, Username (optional), Password (optional)): "输入框
太简陋了。根本就不是我们整个产品的输入框组件。" proxyFormRow gave its
four fields only the class proxy-credential, which sizes them in
.proxy-form and styles them nowhere, so they drew as the browser's white
inset boxes on either theme. They are input.words now, the same field as
the gateway address and the share password on that page.

The class: app.css gets a :where() base rule (zero specificity) for every
text input and textarea: 1px var(--line) border, 7px radius,
var(--card) background. Any rule that names a field still wins, so a
field only takes it where it had the browser's look before.

input-look.test.cjs opens every Settings part (Network with the
saved-proxy form open and each Custom proxy pressed), a custom provider's
editor and a signed-in Codex editor (every fold open, each Custom proxy
pressed), and a routing group's editor (every fold open). No visible
text field may have an inset/outset border, or a white background on the
dark theme, and an input no rule names, put into the group editor, must
not be inset. Chromium and WebKit, en zh zh-TW ja de, 1100 and 420px,
light and dark.

Run on mote (mote-run), at 648cd3fdb plus this change:
- node --test input-look saved-proxies settings-proxy-auth
  proxy-login-fields provider-proxy account-proxy checkbox-look
  i18n-keys: 108 of 108 ok (input-look 20 of 20, both engines).
- Computed styles (background, border, radius, padding, size) of every
  visible input on the pages above, and of every view's inputs (agents,
  providers, groups, gateway, usage, redact, library, plugins, sessions,
  routing) in dark Chromium, diffed before and after: only the four proxy
  fields changed, and the Plugins search (borderless, transparent) took a
  7px radius that draws nothing. One group-editor pattern field's width
  moved by 10px, beside a button; no field rule changed there.

Again after rebasing onto 1729e1193 (the group editor's keys and masking
moved under Advanced): input-look, i18n-keys, group-redact and
saved-proxies, 74 of 74 ok.

Broken by hand: app.css and proxies.js put back to 648cd3fdb, the test
red at en 1100px: the four proxy fields inset and white in dark and
light, and the unnamed probe field inset.

Not tried: the real app's WebKitGTK and WebView2; the TUI has no such
form. Sheets outside those listed (agent settings, sign-in sheets) are
covered by the base rule but not opened by the test.
2026-11-13 04:05:37 +08:00
yetone af7edcc02a gui: the Library's project section is titled by what it holds
The owner (11-12): the MCP tab's 项目中 ("In projects") read oddly over
the servers a project gets. The heading now says what the section is:
"Project servers" on the MCP tab and "Project skills" on the Skills tab,
which shares the section (项目服务器 / 项目技能, 專案伺服器 / 專案技能,
プロジェクトのサーバー / プロジェクトのスキル, Projektserver /
Projekt-Skills).

Run on mica, at this tree: project-servers, project-skills-groups,
project-scope, library-mcp-agentless, library-all, i18n-keys and
i18n-en-no-cjk, chromium and webkit: all ok (6, 12, 6, 22, 26, 4, 4).
project-servers checks the heading in en and zh, project-skills-groups
in every language. Broken by hand (t("In projects") back): both go red,
6 of 6 and 12 of 12.

Not tried: the real app; the change is the heading's words.
2026-11-13 04:03:55 +08:00
yetone 1729e1193a site: a Google Vertex AI page in en, zh and ja
/docs/vertex says how magpie's google-vertex preset serves Gemini, partner
models (DeepSeek, GLM, gpt-oss) and Claude from the user's own Google Cloud
project with no API key: turning on aiplatform.googleapis.com, gcloud
application-default login or a key file, project=, location=,
credentials= and impersonate= (with the GUI fields' labels), the models
each location lists and typing in others, Model Garden and testing a
partner or Claude model on its own, Claude on Messages API as with
CLAUDE_CODE_USE_VERTEX, the Priority/Flex PayGo headers, and the errors
reference.md lists. Every claim is from docs/reference.md (Google Vertex
AI) and the CLI usage, with the labels' zh and ja from i18n.js. Linked
from each language's gemini page; in the sitemap, llms.txt and
llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real Vertex AI project for this page; it names only what
magpie's docs and source say.
2026-11-13 04:02:44 +08:00
yetone 5c00da3b25 gui: a group's note says it is optional
The owner (11-12): the note field under a group's name read as one more
thing to fill in. Its placeholder now starts with "Optional", in every
language: 可选,例如:给工作 Key 用 and the like.

Run on mica, at this tree: group-note, group-keys, group-redact and
i18n-keys in chromium and webkit, every language, 1100 and 420px: 86 of
86 ok. Broken by hand (the old placeholder back): group-note goes red.

Not tried: nothing beyond the GUI tests; the change is the placeholder's
words.
2026-11-13 03:59:08 +08:00
yetone 109559913a gui: a group's gateway keys and masking sit under Advanced
The owner (11-12): few people bind a group to gateway keys or change how
it is masked, so the group form showed two rows most never touch. Both
rows now sit in the group's Advanced fold with the rest of what is set
rarely, and the fold opens by itself when either is set, so a bound or
masked group still shows it.

Run on mica, at this tree: group-keys, group-redact, group-note and
i18n-keys in chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 420px:
86 of 86 ok. Broken by hand (the two rows back at the form's top level):
the keys, redact and note tests fail, 50 of 82 red.

group-redact now reaches its chip with reader.cjs reach(): Playwright's
scrollIntoViewIfNeeded is put back by the app's scroll hold at 420px,
which made it click the wrong place there. It also checks the click does
not move the page.

Not tried: the real app with real gateway keys.
2026-11-13 03:59:08 +08:00
yetone fa7e466acd gui: Settings' gateway row is titled a port when a port is what it takes
The owner (11-12): the row over a field that takes 3425 read 网关地址
(Gateway address). Only the port is typed there; it is titled Gateway
port (网关端口, 閘道連接埠, ゲートウェイのポート, Port des
Zugangspunkts), and the field's aria-label with it. With MAGPIE_ADDR set
the field shows the whole host:port, off, and the row keeps Gateway
address, as Chicring asked before.

Run (mote, both engines): gateway-port, i18n-keys, i18n-en-no-cjk, 14
of 14 ok.
Broken by hand: settings.js put back as on origin/main, gateway-port red
in both engines (expected 'Gateway port').
Not tried: the real app.
2026-11-13 03:55:09 +08:00
yetone 648cd3fdbb gateway: the management API leaves other keys that manage magpie alone
727e23637 added /v1/magpie/admin/ and left admin-key out of it so that "a
key can't give another more than it was given". But rotate-key was served
on any key: a key allowed to manage magpie from this computer only
(Admin local) could rotate a key allowed from anywhere (Admin any) and was
handed its new secret, or set one of its own choosing ("secret" in the
body). It then held a key that manages magpie from the network. It could
also turn off or remove that key, locking its owner out.

- internal/gui/admin.go adminMayChangeKey: a POST /gateway-keys/{action}
  naming another key that has Admin is 403. The caller's own key, keys
  without Admin and add-key go on as before. A gateway-keys file that
  can't be read is refused (unknown), not let through.
- docs/subsystems/gateway-routing.md says so.

Run (mote, at 2bcbae35e + this change):
- go test -count=1 -timeout 45m ./internal/gui/: ok 138.6s
- go vet ./internal/gui/ darwin, GOOS=linux -tags nogui, GOOS=windows: clean
- gofmt -l clean
Broken by hand: with the check skipped, TestAdminAPILeavesOtherManagingKeys
is red. A local key rotated the any key and got its secret
(sk-magpie-key-…), set "chosen-by-the-caller-1234" as its secret, turned it
off and removed it.
Not tried: a real gateway run over HTTP. The test drives serveAdmin with
the caller's identity in the context, as the gateway's admin() passes it on.
2026-11-13 03:49:41 +08:00
yetone 2bcbae35ef gui: Partners' heading in the Add sheet ends in "Become a sponsor"
The owner asked for an elegant sponsor button at the right of the Add
sheet's Partners heading (在右边加上一个优雅精致的我要赞助的按钮). It is a
quiet pill with an accent heart outline: 我要赞助 / 我要贊助 /
スポンサーになる / Sponsor werden. Hover changes colour and border with
`ease`, gated to a fine pointer, and :active scales to .97.

A click opens the same mail usemagpie.ai's "Become a sponsor" writes
(mailto:yetoneful@gmail.com?subject=Sponsoring%20magpie). /api/open lets
through that one exact link (sponsorMail), not mailto: at large. Web mode
sets location to it.

The heading and the button share a .kind-row. The heading keeps its own
box, so the Partners shine still wraps only the words. The shine test now
finds the tiles after that row.

Run on mica (mote was at load 33-57):
- node --test add-sponsor-me, add-partners-shine, add-sheet: Chromium and
  WebKit, en/zh/ja/de at 900 and 440px. The new file and the shine file
  are green.
- add-sheet chromium is red 1 of 3 with "Cannot read properties of null
  (reading 'serverPin')". It is red 1 of 3 on untouched origin/main
  f0571d7da too, and is filed as #6216.
- i18n-keys and i18n-en-no-cjk pass.
- go test ./internal/gui -run 'Budget|Sponsor|LoginNeeds' passes
  (TestCoreScriptBudget included).
- go vet ./internal/gui passes on darwin, on GOOS=windows, and on
  GOOS=linux with -tags nogui. gofmt -l is empty.
- Screenshots: zh light and dark at 900, en and de at 440, at rest and
  on hover.

Broken by hand, on mica at the rebased head (1f9d2c36c):
- With the allow taken out of /api/open and the constant changed,
  TestSponsorMailOpensThatAddressOnly goes red. It reports that the link
  opened nothing and that app.js doesn't name the link.
- Its cases also check that another address, a changed subject, an
  appended body and MAILTO in capitals stay closed.
- At the rebased head, go test -run 'Budget|Sponsor|LoginNeeds' passes
  again.

Not run: the whole GUI suite. mica was running another session's suite
and mote was over its cores. Not tried in the real Wails app: whether
the system's mail client opens.
2026-11-13 03:43:10 +08:00
yetone 1f9d2c36c6 edit: the YAML looks keep a slim tree, not yaml.v3's nodes
GetYAML, GetYAMLMap and GetYAMLList read the file through filememo,
which kept yaml.v3's whole node tree for as long as magpie runs: ~160
bytes a node behind a pointer, with a tag, styles, comments and places
that no look reads. For dsh's 68 KB settings.yaml, read by RenameLegacy
at start and by dshGet on every poll, plus Hermes' config.yaml, that
tree was the largest thing left in an idle tray's heap. The looks now
keep a yamlLook instead: a node's kind, a scalar's value, and the nodes
under it held inline. GetYAMLText still marshals yaml.v3's tree, so it
keeps one under its own memo kind; only MiniMax's file is read that way.

Run (pushed head's tree, on mica and mote):
- go vet ./internal/edit ./internal/agent; go test ./internal/edit ok;
  go test ./internal/agent ok (190s, mica).
- TestYAMLLooksReadAsTheNodeTree holds every key path of a file with
  anchors, aliases, merge keys, flow and block lists, complex keys and
  comments to what lookupYAML on yaml.v3's tree reads. Broken by hand
  (a mapping key copied as its tag, not its value), it goes red.
- Idle tray, real account sandbox with the owner's 25,379 probe lines,
  at 150 s, three alternating runs: live heap 9.21 MB (w38, v0.1.3941)
  vs 8.39 and 8.41 MB (this); footprint 77 vs 75 and 74 MB.
  edit.parseYAMLRoot is gone from the inuse top.

Not tried: Windows or Linux (no OS-specific code here).
2026-11-13 03:33:44 +08:00