Commit Graph
666 Commits
Author SHA1 Message Date
yetone bc8b01d603 claude: the short system prompt is set in the Claude Code editor, not Settings › Replies
The scattered settings audit after netube99 on X. Short Claude system
prompt and Claude Code's interactive mode changed only Claude
subscription runs, yet sat in Settings › Models › Replies, while the
Claude Code editor already had its own "Claude Code runs as" switch for
the second, whose card said "Switched here or in Settings › Models ›
Replies".

Both rows now go in a claudeRunList in the Claude editor (PROV_PREFS), so
Settings' search still finds them and Open goes to the editor. In the app
the editor's own "runs as" switch is the one shown, and the duplicate
interactive mode row is hidden by CSS; in magpie web as a gateway, where
that switch is disabled, the row shows (the list gets a gw class from
renderReplies: body.gateway-mode is set only on a change, not at boot).
provPrefsField lets Claude's run list through in gateway mode, without
the warm-ups, which are this computer's. The card and the "off" reason
no longer name Settings (zh, zh-TW, ja, de written with them), and the
bridge's subsystem page names the editor.

Run (mote, mote-run, origin/main ddd6c649b as BASE_REF):
- claude-lean-prompt-setting, claude-tui-setting, claude-mode,
  provider-prefs, settings-places, i18n-keys, bare-ids and mobile-web,
  both engines: 170 of 170.
- go test -run 'Budget|I18n|Strings' ./internal/gui: ok.

Broken by hand (chromium):
- both rows back in Replies: claude-lean-prompt-setting and
  provider-prefs 18 of 18 red;
- the editor's duplicate row not hidden: claude-tui-setting 8 of 8 red;
- no gw class in gateway mode: claude-tui-setting 8 of 8 red.

Not tried: the real app with a real Claude subscription.
2026-11-09 23:14:57 +08:00
yetone 39569d5604 claude desktop: an optional Claude Magpie app beside your own Claude (#5671)
baranwang on X asked to keep Claude Desktop's own (1P, Anthropic) sign-in
while using magpie. Turning on "Separate app" in Claude Desktop's row on
the Agents page (or `magpie claude-desktop launcher add`) moves magpie's
3P wiring into ~/Library/Application Support/Claude-Magpie-3p and adds
~/Applications/Claude Magpie.app. That launcher opens Claude.app with
--user-data-dir on that folder, so it runs side by side with the user's
own Claude.app. Its icon is Claude's icon with a magpie badge. Off is the
default, and turning it off (`launcher remove`) moves the wiring back
and removes the app. It is macOS only: Desktop's packaged app strips
CLAUDE_USER_DATA_DIR, and on Windows it hardcodes LOCALAPPDATA\Claude-3p.
The folder ends in -3p because Desktop adds -3p to any other name.
Restarting the isolated app ends only its own process (pkill on its
--user-data-dir) and opens the launcher again.

Run at 1b25cda26 (this change on origin/main be9dbce02); rebased onto
fdabddeb4 (catalog only), then go build ./..., vet and the budget and
launcher tests again: ok. All
on mote:
- gofmt -l clean; go vet ./internal/...; GOOS=linux go vet -tags nogui
  and GOOS=windows go vet on agent, cli, desktopiso, desktopdir, gui.
- go test (whole packages) desktopiso, desktopdir, settings, settingsapi,
  proc: ok. -run Isolated|TestDesktopInstance|TestAddStartsDesktopOnTheFolder|
  TestScript|TestAddLeavesTheirs|ClaudeDesktop|Restart in agent;
  TestClaudeDesktopLauncher|TestEveryRouteHasACommandOrIsNamed|Help in cli;
  TestCoreScriptBudget|TestSettingsSaveKeepsWhatItDoesNotSend|Budget|Desktop
  in gui and gateway: ok.
- An earlier full `go test ./...` at fef23255f had four reds, all from
  this change and fixed here: the route without a command (now in
  notYet), settings_keep's DesktopIsolated, os/exec instead of proc, and
  the core script budget (paid by sharing the switch helper with the
  largest-window line and cutting comments; no raise). A second full run
  of the touched packages queued ~7h on mote's suite lock behind other
  sessions and was stopped; the targeted runs above replace it.
- GUI on mote, both engines: desktop-isolated (new; en, zh, zh-TW, ja,
  de; 1100 and 640; aria-checked, posts, status text, no scroll, no
  select, absent without `isolated`), desktop-longest, click-scroll,
  plain-names, i18n-keys: ok. page-width-steady, panel-fold and
  zero-priced-free are red, the same 33 tests at origin/main be9dbce02
  (diffed): #4541/#5013, #5796, #5262. i18n-keys' "a plugin's words are
  its own" is red on main too (#5332).
- Whole GUI suite on WSL at an older head: 400 of 22778 red across
  ~100 files of other pages, in line with #5559 (478 of 21666 on main
  there). Not rerun on mote.

Real use, on mote in a sandbox HOME with Claude.app 4.23118 linked in:
`claude-desktop magpie`, then `launcher add`, moved the wiring to
Claude-Magpie-3p (deploymentMode 3p, mcpServers and locale carried).
Opening Claude Magpie.app started Claude with
--user-data-dir=.../Claude-Magpie-3p; it wrote configLibrary and
model-catalog there (3P mode) and no -3p-3p folder. A second, 1P Claude
ran beside it on its own sandbox folder. Opening the launcher again
kept one instance; the pkill pattern matched only the isolated pid; both
quit on SIGTERM. `launcher remove` put the wiring back and removed the
app.

Broken by hand: a folder without -3p (Desktop made -3p-3p), the
CLAUDE_USER_DATA_DIR env route (ignored by the packaged app), os/exec in
the quit (TestNoCommandBypassesProc red).

Not tried: a screenshot of the running app (screencapture fails over
ssh); a model request through a gateway from the isolated app; Windows
and Linux (not offered there). Known: the Dock shows Claude's own icon
for the running isolated app, and Chrome pairing is off in a moved
userData folder.
2026-11-09 22:31:16 +08:00
yetone 88b541a25c images: every pointer names Settings › Models › Images, where the page is
The image models moved under Settings › Models, but the Library's Magpie
Image sheet, the MCP server's instructions to agents, the gateway's
"no image model" errors, the video tool's text and the docs still sent
users to "Settings › Images", a tab that no longer exists (the scattered
settings audit after netube99 on X). Every user-facing string now names
Settings › Models › Images in en, zh, zh-TW, ja and de, as do the site's
Qwen docs (en, zh, ja), llms-full.txt, the subsystem pages and comments.

Run in the tree with this change and the rest of the audit's fixes
(mote, base cd0ba05c2):
- go vet ./internal/gui ./internal/gateway ./internal/agent
  ./internal/provider ./internal/settingsapi: ok
- go test -run 'Image|Draw|Video|Hidden|Group|Settings' ./internal/gui
  ./internal/gateway ./internal/settingsapi: ok; ./internal/imagemcp,
  ./internal/library, ./internal/catalog: ok
- GUI: i18n-keys, i18n-en-no-cjk, image-models-hide,
  library-browser-setup: pass in Chromium and WebKit
- gofmt -l: nothing
Not tried: a real agent reading the new MCP instructions (text only).
2026-11-09 21:51:53 +08:00
yetone ffbc45eac5 usage: a breakdown row's second line wraps at every width, not cut at 180px
In a wide window a Usage breakdown row's name column is a fixed 180px
and the line under the name (the sign-in, calls, credits, failures,
TTFT, speed) was one line cut with an ellipsis there, so everything after
the provider was hidden. Only the narrow web layout let it wrap. It now
wraps at every width; the narrow rule that did the same is gone.

Reported-by: shusoyo (Discord #general, 11-09)

Run (mote): usage-stat-sub-wrap.test.cjs 8/8 (chromium, webkit; en, zh;
1440 and 1000px). Broken by hand: with the old app.css it is 0/8 ("the
line wraps, not cut").
2026-11-09 21:40:13 +08:00
yetone c7ebb6f8d9 settings: Video generation picks the model Magpie Image makes videos with
The same Discord (#feedback) user: a custom provider's video model still
couldn't be chosen. A custom provider's video model was already found
(seedance, kling, veo, wan, hailuo ids by name, or marked by hand with
right-click › Makes › Video model, #1399), but generate_video always used
AutoVideomaker's pick, the first video model of the first provider, with
nowhere to choose another, as Settings › Images does for images.

settings.VideoGen (provider/model or a routing group) is now the model a
request that names none makes its video with, while it resolves; else
AutoVideomaker's, as before. Image generation turned off turns video off
with it, as before. Settings › Models › Images gets a Video generation
row under Image generation: Automatic (naming the automatic pick) and
every model Magpie Image can make videos with. A pick that no longer
makes videos (provider gone or off, model unmarked) says so and the
automatic one is used in its place; the settings API refuses a model
that makes none, and keeps the pick when a save doesn't send it.

The row is drawn by videogen.js, imported when Settings draws Image
generation, with one call in app.js: drawn in app.js it put the core
scripts 616 bytes over TestCoreScriptBudget (1,534,418 > 1,533,802, found
by the first full run), and the budget is not raised.

Run on mote:
- At this change on bceeabd93 (rebased onto c630d9a29, which changes
  only the gateway key page): gofmt -l clean; GOOS=windows go vet and
  GOOS=linux go vet -tags nogui of the changed packages: ok. go test -run
  'Budget|VideoGen|Videomaker|TestSettingsSave|TestKeysAreWhatTheSaveWrites'
  in settings, settingsapi, gateway, gui: ok. GUI: video-gen-pick
  (32 subtests: chromium and webkit; en, zh, zh-TW, ja, de at 1100px, en
  and zh at 400px), old-webkit, i18n-en-no-cjk and the six image/Settings
  files (image-timeout-setting, images-codex-one, images-library-way,
  images-missing, image-models-hide, image-mcp): 220 of 220 ok.
- At 95a3fa3e0 (the change before the videogen.js move and the rebase):
  go test -timeout 45m ./internal/settings ./internal/settingsapi
  ./internal/gateway ./internal/gui: ok except TestCoreScriptBudget
  (fixed above). i18n-keys at 4394ea1b9: only the known plugin-words red
  (#5332).
- Not run at this head: the whole of those four packages and the 183 GUI
  files a Settings change reaches; the suite lock on mote was an hour
  deep in other sessions' suites.

Broken by hand, each red:
- videomaker ignoring VideoGen: TestVideoGenPicksAMarkedModel.
- settingsapi not keeping a pick a save doesn't send:
  TestVideoGenCheckedAndKept.
- No Video generation row: video-gen-pick.test.cjs, 30 of 32.
- videoGen left out of the Settings page's prefsKeep:
  TestSettingsSaveKeepsWhatItDoesNotSend ("VideoGen: not sent by the
  Settings page"), found before it was added.

Not tried: a real video generation with a custom provider's model (the
gateway tests hold the vendor's replies).
2026-11-09 14:25:55 +08:00
yetone bceeabd93a gui: a subscription's warm-up, check-in and resets are in its provider's editor
The owner, 11-07: "这些配置难道不是应该在对应的Provider那个弹窗里面吗?为什么会散落在Settings里?"

Settings › Allowances no longer holds Codex's auto-use resets and how
early before one expires, Codex's and Claude's warm-ups, or the daily
check-in of WorkBuddy, Trae CN, MiniMax, Qoder and the plugins that check
in themselves. Each is in its own provider's editor (PROV_PREFS: the lists
move from a hidden holder into the editor's .prov-prefs box and back).
Settings' search still finds them, each a row whose Open goes to the
editor. Task-done alerts stay in Settings. "Codex: auto-use resets" and
"Codex: how early before one expires" lose their "Codex:" in the editor.

In the editor a press inside a part that redraws moved the page: the
modal hold moved the dialog, which can't move once it meets the window's
edge, and lost a pressed element a redraw replaced. The hold now scrolls
the editor's body by what is left, and finds the replacement by its path
or by tag, class and text under its id'd ancestor. In a browser the
editor's body keeps its bar's room, as the app's already did: WebKit kept
the grid's columns from before a bar that came with a grown field, and
the editor scrolled 10px sideways.

Budget: app.js grew with the editor's parts; paid for by comments cut
(curlOf, scrollCloses, unrollSheet, quotaRange, ledGroupSpeed, the
Settings tabs, the warm-up and fold notes), no raise.

Run at this head (704fd85f3 before this message, on origin/main):
- mote: go test -count=1 ./internal/gui/ ok (TestCoreScriptBudget
  included); go vet ./..., GOOS=windows go vet ./... and GOOS=linux go vet
  -tags nogui ./... clean.
- mote: settings-groups and i18n-keys GUI files. i18n-keys' "a plugin's
  words are its own" fails the same on origin/main (#5332, #5327, #5482).
- WSL, both engines, the files this can reach, mine vs origin/main
  8544d5fdb: before the rebase, settings-groups was the one red only here
  (fixed: it now asserts the pressed field stays under the pointer). The
  nine files of account, Codex and editor tests rerun at load ~60 fail on
  both sides with WebKit "access control checks" page errors and measured
  sizes; the sets differ by which language/width hit the load, none by a
  cause in this change. editor-advanced-align is red on main too.
- Broken by hand: the hold following the pressed element itself
  (models-fold and names-fold moved +402px), and updating modalHold.y before
  the cap (provider-remove kept the dialog at 5.89px); both reverted.
Not run: the whole GUI suite to the end (stopped after ~4500 tests at
load 61 on WSL; mote dropped ssh mid-run).
2026-11-09 13:20:30 +08:00
yetone 26e9c95665 settings: the LAN address row has no blank band under it
The owner (11-08): in Settings › Network, under Share on local network,
the Address row had an empty band under the address, so the card's
spacing was uneven. The row places its controls in a fixed height (50px).
With a pointer that hovers, 8e9b048b6 made Settings' rows content-box,
so the row's 24px of padding was added under that height: 75px, its
controls in the top 51. The row now stays border-box, 51px like the
rows around it; the two-line narrow layout is 81px, 13 under its second
line as over its first (it was 7-8 even before).

lan-address-height.test.cjs: the room under the controls equals the room
over them, and wide, the row is as tall as the one above it. One address
and several, 1300px and 560px, en and zh, Chromium and WebKit.

Run on mote, at this tree:
- lan-address-height, lan-public, lan-docker: 55 of 60 pass; the 5
  WebKit lan-docker reds are browserType.launch timeouts (mote's load at
  ~650). Those 5 pass in the run before at this same CSS, whose own reds
  were launch timeouts too.
Broken by hand: the new test at the base (no fix), Chromium: 8 of 8 red,
row 75px (101 narrow), 36px under the controls and 13 over.
Not tried: the real app; the full GUI suite (only the LAN files reach
this row's CSS).
2026-11-09 08:39:05 +08:00
yetone 3ab10b2649 gui: the Partners light runs round the partners' tiles too, with the heading
The owner asked for the add sheet's whole Partners block to light when it
opens, not only its heading (除了合作伙伴这个标题有流光动画之外……这整块位置
是不是也要有一个流光动画), and picked, from three mockups, the outline that
runs round the block the way it runs round the heading. Their notes on it:
the two play together (标题跟这一块要一起播放); they must not touch, but the
sheet's spacing must not change (视觉上这个间隙没有做任何的更改,但是播放流光
动画的时候,它们俩是不挨在一起的); the block's outline starts where the
heading's does and has as much room above its words as below.

shinePartners now takes the tiles' grid as well as the heading, gives both a
glow and a ring, and lights both on the same frame. Both are absolutely
placed layers, so nothing on the sheet moves. The tiles' ring sits on the
grid's edge (about 9px over and under the names, 8px beside the icons, its
left edge on the heading's). There is only 6px between the heading's words'
box and the tiles, so the heading's ring now sits 2px closer to its words
(inset 19px 0 4px, was 17px 0 1px), which leaves about 4px between the two
lines. Same 1.8s trace and glow, a 5% glow under the tiles; none with
reduced motion, the system's or Settings'.

add-partners-shine.test.cjs now also checks, in Chromium and WebKit, en, zh,
ja, de, at 900px and 440px: the tiles' outline plays with the heading's,
sits on the grid's edge, starts at the heading outline's left, is at least
3px from it, and that taking both lights away moves neither the heading's
words nor any tile (measured after the sheet's own entrance settles); a
search's redraw doesn't play it, a reopening does, reduced motion draws no
layer in the grid.

Run on mote at ac043ffcc + this change, then again after the rebase onto
4f3ec591a (browser-extension reload; no add-sheet files):
- add-partners-shine.test.cjs: 22/22 pass. With app.css and app.js at
  ac043ffcc it fails 18 of 22 (no outline on the tiles).
- every GUI file that opens the add sheet (67 files): still
  running when this was pushed; of the first 48 engine runs, one
  red: add-button's WebKit en, a 3000ms waitForFunction under load (#4792).
  add-button alone passes 6/6 here and 6/6 at ac043ffcc.
- go test ./internal/gui/: every test passes, size budgets included, except
  TestDockJoinLeadsCommandTab, killed at its 30s deadline with mote at load
  316 under another session's full GUI suite (#2645, #4125). It opens a real
  AppKit window and doesn't read these assets.
- after the rebase, at the pushed head: add-partners-shine 22/22, and
  go test -run 'Budget|Size' ./internal/gui ok. Four more runs with mote at
  load 25 to 100 under other sessions' GUI suites went red only at
  browserType.launch (180s) or the first click on #addProvider (30s); no
  shine assertion failed in any of them.
- gofmt -l: clean.

Not run: the whole GUI suite, because another session's was already running
on mote at load ~316 (one full suite per machine). Not tried in the real app
or in WebKitGTK; the effect is the same @property conic ring the heading
has used since 33af28ed6.
2026-11-09 07:55:24 +08:00
yetone e5b5397c96 providers: a model's context window and max output are set in its Model settings row
sayagoodbyeplz on Discord: WorkBuddy's deepseek-v4.1-flash replies 128000
tokens, not the 384000 models.dev lists, and there was no visible place
to set that for one model. The editor's Advanced Context window and Max
output already took "model=size", but a user looking at the model never
saw them.

Each model's row in Model settings now has a Context window box and a
Max output box beside "Listed as". The placeholder is the listed value
(the vendor's list, else models.dev's, within the window), or the "*"
value from Advanced when one is set. A value typed there is staged as
model=size in Advanced's field, so both say the same thing, and the Save
sends it in contexts/outputs as before. An empty box drops the model's
own value. A bad value is refused with Advanced's message. Restore
default clears both, and its title says so in every language. A
classifier-only provider has neither box, as in Advanced.
/api/providers gives each model a listedOutput (its reply limit without
the user's Max output) so the placeholder doesn't show the user's own
value back.

The boxes are drawn by modellimits.js, imported when the editor draws a
model's row (like keyspend.js), and nine comments in app.js are cut, so
the core stays in its budget with no raise (1,533,541 of 1,533,802 on a5c97cd83).

Run (mote before the modellimits.js move; WSL magpie-desktop, Go 1.26.8,
at this tree, after it, since mote went down):
- go vet ./... (mote, darwin; again on internal/gui, agent and provider
  at the rebased head on a5c97cd83); GOOS=windows go vet ./... and
  GOOS=linux go vet -tags nogui ./... (WSL): ok
- go test ./internal/gui/ ./internal/agent/ ./internal/provider/ (mote): ok,
  except the real-window AppKit tests TestCoveredWindowStaysUp and
  TestClosingWindowMarksPageOutOfSight killed at their deadlines (#4924,
  #2645); WSL, -tags nogui: TestProviderModelOutput*|Budget ok
- TestProviderModelOutputSaid gains a check that listedOutput is
  models.dev's 131072 while the user's 100000 is set
- node --test internal/gui/tests/model-limits.test.cjs (new): 20/20,
  Chromium and WebKit, en/zh/zh-TW/ja/de, 1200 and 420px: placeholder
  384K, 128k typed -> Advanced "deepseek-v4.1-flash=128k" and unsaved,
  a bad value refused, Advanced's "*" becomes the placeholder, the Save
  body's outputs/contexts, Restore default clears the model's own
- WSL, at this tree: model-limits, model-headers, model-price-tiers,
  model-api-preset, provider-detect, provider-listed-as,
  provider-same-as, provider-max-output, provider-output-picks,
  old-webkit, i18n-keys: 105/106, the one red i18n-keys' "a plugin's
  words are its own", red at a46190e1f too (#5332, #5426);
  TestCoreScriptBudget ok. Before that, every model-*, provider-*,
  editor-*, context-picks/tune*, i18n-*, menu-scroll, click-scroll and
  old-webkit file (2325 tests): the reds in model-chip-steady,
  model-copy-id, provider-models-rest, provider-picks-stay,
  provider-fetch-again, provider-typed, model-suffix-own, model-load,
  editor-advanced-align and click-scroll are red the same at a46190e1f on
  WSL (#4388, #4621, #4396, #4397, #5232, #4673, #4962, #4615, #4385).
  That run found two of this change's own: the rows' hooks kept on the
  draft made an untouched editor read as unsaved (model-price-tiers,
  model-api-preset), and a row filled after an await moved the page
  (provider-detect); the hooks are left out of the draft's value and a
  row is filled at once once modellimits.js is loaded.
Broken by hand: model-limits.test.cjs on origin/main's assets fails at
once (no .mlimit row).
Not tried: the real app window; the full GUI suite.
Full suite not run at push.

Reported-by: sayagoodbyeplz (Discord)
2026-11-08 19:05:36 +08:00
yetone b0926e81a2 import: a link can say where its key's balance is read (balance=, balance_path=, balance_method=)
A relay's "Add to magpie" link can now name the URL that tells a key its
balance, where the amount sits in the reply, and GET or POST. magpie
takes it only on the host of one of the link's own base URLs, over
https, with no userinfo or fragment, so a link can't send the key
anywhere its requests don't already go; anything else refuses the whole
link. balance_path or balance_method without balance is an error. No
header or token is taken from a link: an account-wide token is worth
more than a key, and a URL stays in browser history.

- provider.ParseImport: linkBalance checks and sets BalanceURL,
  BalancePath and BalanceMethod.
- CLI: the import preview shows the balance URL and doesn't ask it
  before yes (showProviderAsking).
- GUI: the import dialog shows method, URL and field (.imp-bal).
- Docs: docs/import in en, zh and ja (table rows, a note on headers,
  the builder's three fields with the same host check, a security
  bullet); docs/reference.md's parameter table.

Run on mote at this tree (rebased on 8fa3c60f8):
- go test -count=1 ./internal/provider ./internal/gui: ok
  (TestParseImportBalance, TestCoreScriptBudget in it).
- go test ./internal/cli: ok but TestEveryRouteHasACommandOrIsNamed,
  red on main since f418edffc (GET /api/context/session); fixed in the
  next commit, and ok there with -run 'TestEveryRoute…|Import'
  (TestImportPreviewAsksNoBalance).
- GUI import-link-balance, import-link-gemini, i18n-keys: 43/44. The
  red is i18n-keys "a plugin's words are its own", the same three
  strings on an origin/main 8fa3c60f8 copy (#5327, #5426, #5482).
- GOOS=linux go vet -tags nogui and GOOS=windows go vet of provider,
  cli, gui: ok. gofmt -l: clean.

Not tried: a real link with balance= imported into the app and read
against a real relay's balance endpoint.
2026-11-08 18:37:41 +08:00
yetone e215d335a6 gateway: a gateway key can cap its requests at once; the rest wait their turn
young02036 on Discord: a provider can be given a concurrency, so why
can't a gateway key? A key now has an optional MaxConcurrency, from 1
to 1000. Left unset (every key today), nothing changes.

- access: Key and Change get MaxConcurrency, and Identity carries it, the
  issuer's cap included. The concurrency-key action refuses a value
  below 0 or above 1000.
- gateway (key_slots.go): every route that asks a model is held to the
  key's cap, however the request came (loopback, LAN, a Remote magpie, a
  Responses socket's turn). One request too many waits in the key's
  queue in arrival order. It shows as "slot" in Active, and its wait goes
  into the try's Queued. A request whose agent goes away while it waits
  leaves the queue and sends nothing. A stream holds its slot until it
  ends. serve's routes (chat, responses, messages, ollama, gemini, the
  Codex backend) wait inside the try, after keepQueued, so a streaming
  agent gets keepalives while it waits. The other model routes (images,
  embeddings, rerank, audio, videos, search, decisions, native) wait
  before their handler runs. forward and codexUpstreamOn take the slot
  too, so nothing reaches a vendor without one. A key issued under
  another waits for its own slot, then for its issuer's.
  /v1/magpie/concurrency lists each capped key under "keys", and counts
  its waiters in "waiting". A key's limit (key_limit) reports the cap.
  Not held, as a provider's MaxConcurrency doesn't hold them: GET,
  HEAD, OPTIONS, count_tokens, :countTokens and MCP.
  TestKeySlotEveryRoute fails when a route is judged neither held nor
  free.
- cli: magpie gateway-key concurrency <id> [<n>|off]. It refuses 0, a
  negative, over 1000, a fraction, a word, --help or an extra argument
  with its usage.
- gui: the key row gets a badge in the provider concurrency badge's
  style. It opens the app's menu with No limit, 1/2/3/5/10 and Other…,
  and Other… takes a number typed in place. A value that isn't a whole
  number up to 1000 is refused and nothing is sent. Browser and
  read-only keys have no badge. Strings are in en, zh, zh-TW, ja and
  de. An unset badge, which a hover shows, gives way before the masked
  key (flex-shrink 8). Without that, at 420px in en and de, the extra
  badge squeezed the key until its copy button slid under the pointer
  that came to drag the row, and gateway-key-arrange went red.
- docs/subsystems/gateway-routing.md describes it.

Run (on mote, at this tree on origin/main 0f8c3d867; rebased onto 627fd1a3b,
which touches none of these files, and the budgets were run again):
- go test -timeout 45m ./internal/access ./internal/gateway ./internal/cli
  ./internal/gui: access, gateway (839s) and cli ok. gui had one red,
  TestGatewayModeStatsNameTheGatewaySessions, run at 00:40 PST: its
  record an hour back falls on yesterday in a day's first hour. It
  passes from 01:09, so it is unrelated; filed as #5690. The Budget/Size
  tests were run again after the CSS change: ok.
- gofmt -l: clean. go vet for darwin, plus GOOS=linux and GOOS=windows
  (-tags nogui), on those packages: ok.
- GUI (node --test, Chromium and WebKit, 1100 and 420 wide, en, zh,
  zh-TW, ja and de): every file that loads the gateway keys (59) plus
  i18n-keys and i18n-en-no-cjk. The reds left are the same on
  origin/main and already filed: gateway-key-models en (#5233, #4081),
  i18n-keys "a plugin's words are its own" (#5332), phone-connect-menu
  at 420 (#4706, #4707). After the flex-shrink fix:
  gateway-connect-keys, gateway-key-arrange, -concurrency, -mcp,
  -own-rotate and -quotas passed 104/104 in both engines, against
  84/84 on base.
- The tests:
  - TestKeyConcurrency, over LAN with cap 2: 2 of 3 requests reach the
    vendor and the third is shown as "slot". Another key isn't held. A
    cancelled waiter leaves the queue and never reaches the vendor. The
    third goes once one ends, every lane is given back, and its Queued
    is at least 40ms.
  - TestKeyConcurrencyKeepsStreamAlive: a waiting stream gets 200 and
    keepalives.
  - TestKeyConcurrencyEager: on embeddings an issued key waits on its
    parent's lane, a cancelled waiter leaves, never more than 1 runs at
    once, and a GET takes no slot.
- A real `serve` in a sandbox HOME (built from this tree, MAGPIE_ADDR
  127.0.0.1:38612) against a fake slow SSE upstream. Steps: `provider
  add fake url=…`, `gateway-key add`, `gateway-key concurrency <id> 1`,
  then three concurrent keyed streams. /v1/magpie/concurrency showed the
  key at busy 1, waiting 2, limit 1 (two in "slot"). The upstream's
  most at once was 1, and it saw 3 requests one after another (200s at
  1.9s, 3.7s and 5.5s, each with [DONE]). Afterwards "keys" was empty.
  `concurrency <id> 2000` exited 1 with its usage.

Broken by hand (each went red, then restored):
- keySlot returns nil: TestKeyConcurrency ("timed out waiting for c
  queued") and KeepsStreamAlive.
- The issuer's lane skipped: TestKeyConcurrencyEager.
- The eager take skipped: TestKeyConcurrencyEager.
- The CLI's bounds check removed: "accepted [concurrency id 0]".
- The GUI's bounds check removed: gateway-key-concurrency.
- Without the flex-shrink line: gateway-key-arrange chromium/webkit en
  and de 420px.

Not tried / not done:
- Full suite not run at push (neither `go test ./...` nor the whole GUI
  suite).
- Not tried with a real vendor account or a second computer on the LAN.
  The LAN path is covered by TestKeyConcurrency's lanServer.
- The key's badge shows the cap, not live running or waiting counts.
  /v1/magpie/concurrency has those.

Reported-by: young02036 (Discord)
2026-11-08 17:52:09 +08:00
yetone 37df73b1bb balance: a key holds several credits that expire, each added and removed on its own
tenacious_eagle_96548 (Discord, 11-08) has two promotional credits on one
key, one ending tomorrow and one the day after. v0.1.3305 kept one grant
per key, and its form showed the date only after Enter or a blur, with no
button to confirm.

- OwnBalance.Expiring is now a list (`expirings`, up to 20). Spending
  goes to the grant that ends soonest first (ties by when it was typed),
  and each grant drops out at its day. A write prunes ended grants.
- The pill and the menu say "Expires in N days" per grant, amber from 7
  days. The menu has a Remove item per grant, "Add credit that
  expires…" and "No credit that expires" to clear them all.
- The form shows the amount and the last day together, the day filled in
  30 days ahead, with an Add button; Enter adds, Escape cancels, a bad
  amount or a past day is refused in place. The app's own menu, no
  native select, no stripes. A pill with two or more grants wraps at a
  grant on a narrow row (a class, not :has(), for Safari before 15.4).
- CLI: `--expiring amount@day` can be given several times, `--expiring
  off` clears all, `--expiring-remove [amount@]day` removes one. --help
  prints usage; a day that isn't a date, or is past, is refused.
- /api/provider/keyexpiring adds `{expiring:{amount,until}}`, removes
  `{expiring:{at,until},remove:true}`, clears `{expiring:null}`.

Old data: a v0.1.3305 single `expiring` grant is read as the first grant
and saved as `expirings` on the next write, for every user. An older
magpie reading the new file sees no grants (the balance itself stays).

Run on mote at 1d5b5dc2d plus this change:
- go test -run 'Budget|Balance|Expir|KeyOwn' ./internal/gui
  ./internal/provider ./internal/cli: ok (TestCoreScriptBudget passes,
  not raised). gofmt -l clean. GOOS=linux go vet -tags nogui and
  GOOS=windows go vet on provider, cli, gui: ok.
- GUI (Chromium + WebKit, 900/400px, en zh zh-TW ja de):
  key-balance-expiring, key-own-balance, key-balance-card,
  key-row-steady, key-row-chips-fit, account-rows-fit, old-webkit,
  i18n-en-no-cjk, balance-parts, balance-quota-left: 203/203. A broader
  run (key-*, balance-*, i18n-keys, panel-balance-order) had reds that
  are red on origin/main 04ed05733 too: i18n-keys "a plugin's words are
  its own" (#5332, #5482, #5426) and key-replace WebKit 420px (#4126).
- Real app on mote, sandbox HOME, `serve --web`: the CLI set ¥40 plus
  ¥5 to tomorrow and ¥8 to the day after and printed about ¥53.00 left;
  providers.json has `expirings`. --help, `5@yesterday` and removing a
  credit the key doesn't have each answered as above. In Chromium (en)
  and WebKit (zh) at 900 and 400px: the pill, the menu, the form (day
  2026-12-07), Add ¥3 by Enter, then Remove ¥3 from the menu, each
  checked by text and screenshot.

After a rebase on 437580535, on mote: the same go test
-run (TestCoreScriptBudget included): ok; key-balance-expiring,
old-webkit, key-own-balance: 46/46. Rebased again on 8f6298fb5 (Go
only, no asset changed): the go test -run plus Signin: ok.

Broken by hand, each went red: sorting grants by when typed
(TestTypedBalanceGrantsSoonestFirst); no migration in UnmarshalJSON
(TestTypedBalanceOneGrantMigrated); no Enter handler (GUI en 900); no
wrap rule (GUI en 400, row past the window's edge); Remove sending the
first grant (GUI, at/until mismatch).

Not tried: Full suite: not run at push. No real vendor account (the
grants are typed by the user). The Linux and Windows desktop apps.

Reported-by: tenacious_eagle_96548 (Discord)
2026-11-08 15:27:14 +08:00
yetone c3a9574de4 gui: a key's row keeps its controls shown and stays put under the pointer
tenacious_eagle_96548 (Discord, #general): in a provider's editor a key's
row showed its controls only under the pointer, so it kept growing and
shrinking, and moving away to fill in something else collapsed it.

Cause: app.css (#841) gave a key's unset controls (No limit at once, No
spend cap, Set balance, Switch off, Remove) no room off the pointer. A
hover made the row wrap from 38px to 59px and pushed the rows below
down. With Set balance open and typed into, moving the pointer to the
Name field collapsed the other pills, and the field moved 158px right
and 25px up under the caret (real magpie web, sandbox HOME on mote).

Fix: the list is drawn only in the provider's editor, where every key is
there to be set, so a key's row now shows every control, laid out the
same under the pointer as off it, as a phone's already did. The name and
the masked key stay whole; what doesn't fit beside them goes under the
row's first line. The "held" class that kept a clicked row open is gone
with what it worked around. Subscription accounts' rows (opacity only,
no shift), grips and the ⋯ menu are unchanged.

New key-row-steady.test.cjs: chromium and webkit, en/zh/zh-TW/ja/de, app
560/1000px and tab 420/1000px. Every control is shown off the pointer,
nothing in any row moves with the pointer over any row, and a balance
being typed keeps its place, caret and "100" when the pointer goes to the
Name field. key-row-chips-fit's "one line when not hovered" became "laid
out the same hovered or not"; stale hover comments updated in
key-own-balance, key-spend-cap, key-switch, key-gemini and key-plan.

Run (mote, through mote-run, at this head on origin/main c736906b1):
- go test ./internal/gui -run Budget: ok. gofmt -l internal/gui: clean.
- GUI key-*.test.cjs (44 files, both engines): 457 pass, 5 red:
  key-replace webkit 420px "Change key puts the new value" in all five
  languages, red the same on origin/main c736906b1 (#4126, ebody holds).
- key-row-steady: 40/40.
- Real app: rows 58/59/59px with the pointer off and over each row; the
  balance field's rect unchanged and focused after the pointer left.

Broken by hand: with origin/main's app.css and app.js, key-row-steady and
key-row-chips-fit failed 80 of 100 ("Set balance is hidden off the
pointer", "no proto shown"); with those visibility checks taken out,
"the pointer over k1 moved k1's row" 15 of 15. The 420px tab passed
either way (a phone already showed everything). A first cut let the
masked key shrink: key-weight-fit at 900px went red ("its masked key is
cut"), fixed here by keeping it whole.

Not run at push: the full Go suite and the full GUI suite (queued on
mote behind other sessions' suites under suite.lock; reds go to issues).
Not tried: Linux WebKitGTK and Windows WebView2 apps (CSS only, no new
API or motion).

Sibling left alone: a gateway key's unset quotas badge takes room only
under the pointer on the Gateway page (#5676).

Reported-by: tenacious_eagle_96548
2026-11-08 14:11:10 +08:00
yetone c736906b17 providers: part of a key's typed balance may expire on a day
tenacious_eagle_96548 (Discord, #general): some vendors split a balance
into money that stays and credit good until a date. A key's balance typed
by hand can now carry that part (`expiring`: {amount, until, at}, in the
balance's currency, until = the last day it counts).

- Spending order: the expiring part is spent first, as DeepSeek spends
  its granted balance before money topped up. It takes the spend from its
  `at` up to its end (midnight after `until`, local time) or now; only
  what it took after `From` comes off the rest, so a refill or typing the
  balance again doesn't count it twice.
- Left is the whole balance. From its end the remainder counts no more,
  and unspent credit is gone.
- Typing the balance again keeps the part in the same currency and drops
  it in the other, where its amount would mean another sum.
- A balance saved before has no part and reads exactly as it did
  (TestTypedBalanceSavedBeforeExpiring).
- Set from the pill's menu: "Credit that expires…" asks the amount, then
  the last day (a day gone by, or the other currency's sign, refused);
  "No credit that expires" takes it off. GUI route provider/keyexpiring;
  CLI `magpie provider key-balance <id> <key> --expiring amount@yyyy-mm-dd|off`.
- Shown: the pill "≈$100.00 left · $30.00 expires in 30 days", the Usage
  page and panel line "Expires in 30 days ≈$30.00", amber from 7 days;
  TUI and `magpie quota` "($30.00 until Dec 7)". New strings in zh,
  zh-TW, ja and de.

Run (mote):
- go test of internal/provider, internal/gui, internal/cli (with
  TestCoreScriptBudget: the days' lines in app.js are paid for by five
  balance comments cut there, no raise; core 1,533,559 of 1,533,802); the new tests
  again with TZ=UTC and TZ=Pacific/Kiritimati (every clock held);
  gofmt -l clean; GOOS=linux and GOOS=windows go vet of those packages.
- GUI: key-balance-expiring.test.cjs 20/20 (chromium and webkit, 400px,
  en/zh/zh-TW/ja/de), with every balance-*, key-*, i18n-* file: 768
  pass, 6 red, each red the same alone on origin/main 691a10446:
  i18n-keys "a plugin's words are its own" (#5327) and key-replace's
  five webkit 420px cases (#4126, numbers added there).
- A real sandbox (own HOME, -tags nogui binary, ports 3591/3592): set
  $70 + $30 until +30d and ¥40 + ¥5 for +3d through the CLI, then
  through the pill's menu in the real page (¥8 for +6d, then removed);
  a past date shows the part no longer counting; retyping in USD dropped
  the CNY part; `magpie quota` shows the split. No page errors.

Broken by hand, each red:
- Go (TestTypedBalanceExpires): part not spent first; end taken in UTC
  (red under Kiritimati); part kept after its end; part kept across a
  currency change.
- GUI (key-balance-expiring): no soon class; soon only from 2 days; a
  past day accepted; the other currency's sign accepted.

Not tried: a real vendor's spend priced against the part; the GUI on
Windows or Linux. The full Go and GUI suites were queued on mote's
suite lock behind other sessions' and had not run when this was pushed.

Reported-by: tenacious_eagle_96548
2026-11-08 13:39:32 +08:00
yetone 5a27348058 providers: a key's balance picks its currency beside the field, the number kept
Changing a key's balance from $ to ¥ meant clearing the balance, switching
Settings' currency, then typing it again (a bare number kept the old
balance's currency). The balance field now has a currency button beside it
(USD/CNY, the app's menu, not a native select). It starts at the balance's
own currency, else Settings' one, which stays the default for new
balances. Picking keeps the typed number and posts nothing; Enter or
leaving the field saves, and the pill then reads ≈¥40.00 left. A typed ¥
or $ flips the button as you type. Nothing is reinterpreted: Settings'
currency still never touches a saved balance, and usage and cost displays
are unchanged. No server or API change; keybalance.js is lazy-loaded, so
app.js and the core budget are untouched.

Run (mote):
- key-own-balance.test.cjs: 20 of 20 ok (chromium + webkit, narrow width,
  every language), with new cases: $40 → CNY picked → Enter posts
  {balance:40,currency:"cny"}; ¥100 → Escape posts nothing; → USD, Tab
  away posts {balance:100}; no row runs past the window.
- Whole GUI suite (earlier run at this change): every file ok except
  i18n-keys "a plugin's words are its own", red on main already and filed
  (#5327, #5332, #5426, #5482).
- Real GUI, sandbox HOME on mote (go build -tags nogui, ports 3591/3592):
  typed 40 → ≈$40.00 left; Enter balance…, picked CNY, field kept 40,
  Enter → ≈¥40.00 left, no page errors; `magpie provider key-balance`
  read ¥40.00 typed. Screenshots taken.

Broken by hand: the old keybalance.js against the new test times out
waiting for the currency button; dropping the blur guard (saving when
focus moves to the button) makes the menu pick time out because the field
saved and redrew under it (chromium and webkit). Both red, restored.

Not run to the end: the full Go and GUI suites are queued under
suite.lock on mote behind ~20 other sessions' suites (~/runs/bc-suite);
no Go file changed. Not tried: the real desktop window, WebKitGTK on
Linux, Windows.

Reported-by: tenacious_eagle_96548
2026-11-08 12:54:13 +08:00
yetone d0ce551344 providers: a browser editor keeps its place through a refetch
In a browser (web mode) WebKit gave the editor's redrawn body its scroll
bar a frame late; with "Model settings" a word shorter than the old
label, the foot wrapped differently, the body grew 48px and a place kept
at the bottom was clamped (provider-fetch-holds, webkit zh 420px, red at
the stack's head only). The body keeps its bar in a browser too, as it
already did in the Windows and Linux apps.

Broken by hand: without the rule provider-fetch-holds is red in webkit
zh 420px; with it provider-fetch-holds and model-api-preset pass 16 of
16 on mote.

Run, on this stack over origin/main 0fc3455e2 (mote's suite lock had
hours of queue, so the suites ran on WSL magpie-desktop under flock):
- go test -timeout 45m ./internal/{provider,gateway,gui,cli,settings,fx}
  on WSL, ok; ./internal/codexcat on mote, ok; gofmt -l clean;
  go vet on mac, GOOS=linux -tags nogui and GOOS=windows on mote, ok;
  TestCoreScriptBudget ok (paid by cutting comments, no raise).
- GUI, both engines, every language, on WSL at the pushed head and at
  0fc3455e2: every touched test file plus the provider-editor files a
  first run found red. No red at head that isn't red at 0fc3455e2. The
  shared reds have issues: i18n-keys #5332, model-chip-steady #4388,
  model-copy-id #4621, models-works-only #4391, plugin-move-unserved
  #4392, provider-fetch-again #5232, provider-levels-save #4394,
  provider-levels-scroll #4395, provider-models-rest #4396,
  provider-picks-stay #4397, provider-typed #4673, remote-magpie #4398,
  zero-priced-free #5262, model-reasonless (webkit de) #4100,
  name-suffix-no-names #1937.
- Rebased on origin/main 4ab1191bc (gateway.go moved under it) and run
  again at the pushed head: gateway and provider ok on WSL, gofmt,
  vet (mac, linux nogui, windows) and the budget ok, i18n-keys,
  model-headers and routing-groups-back with only #5332's red.
Not run at push: the whole GUI suite (1277 files).

Not tried: the macOS app (its body has no bar rule; unchanged).

Reported-by: axelburks (Discord)
2026-11-08 11:28:55 +08:00
yetone 7a6211d047 providers: a model's own headers, in Model settings
axelburks on Discord: a vendor routes one model by a header of its own.
A key's provider (built-in or custom) can give each model headers
(settings.ModelHeaders["pid/model"]). They go on that provider's
requests for that model alone, after the provider's headers and after
auth: a name both have is sent once, as the model's, so a user's value
is never overridden by the provider's or magpie's key header. The
gateway names the model (provider.WithModel) on every route that asks
one: chat on each API, translated and streamed, count_tokens, System
One's decision, embeddings, images, videos and the model test. A
fallback provider serving the same model id gets its own headers only.
Accounts and plugins carry their sign-in's headers and take none.

The editor's "Name, price and reasoning level" panel is now "Model
settings" (every language), with + Add header per model, staged and
made with the Save; Restore default takes them away.
The rows being typed are kept out of the draft's
compare, so an untouched editor still closes without asking.

Broken by hand: dropping WithModel from gateway.go turns
TestModelHeadersReachTheirModelOnEveryRoute red; dropping the provider
id check in modelOf turns TestModelHeadersStayWithTheirProvider red.

Run, on this stack over origin/main 0fc3455e2 (mote's suite lock had
hours of queue, so the suites ran on WSL magpie-desktop under flock):
- go test -timeout 45m ./internal/{provider,gateway,gui,cli,settings,fx}
  on WSL, ok; ./internal/codexcat on mote, ok; gofmt -l clean;
  go vet on mac, GOOS=linux -tags nogui and GOOS=windows on mote, ok;
  TestCoreScriptBudget ok (paid by cutting comments, no raise).
- GUI, both engines, every language, on WSL at the pushed head and at
  0fc3455e2: every touched test file plus the provider-editor files a
  first run found red. No red at head that isn't red at 0fc3455e2. The
  shared reds have issues: i18n-keys #5332, model-chip-steady #4388,
  model-copy-id #4621, models-works-only #4391, plugin-move-unserved
  #4392, provider-fetch-again #5232, provider-levels-save #4394,
  provider-levels-scroll #4395, provider-models-rest #4396,
  provider-picks-stay #4397, provider-typed #4673, remote-magpie #4398,
  zero-priced-free #5262, model-reasonless (webkit de) #4100,
  name-suffix-no-names #1937.
- Rebased on origin/main 4ab1191bc (gateway.go moved under it) and run
  again at the pushed head: gateway and provider ok on WSL, gofmt,
  vet (mac, linux nogui, windows) and the budget ok, i18n-keys,
  model-headers and routing-groups-back with only #5332's red.
Not run at push: the whole GUI suite (1277 files).

Not tried: a real vendor that routes by header (Ark); fake vendors only.

Reported-by: axelburks (Discord)
2026-11-08 11:28:54 +08:00
yetone b77400826a usage: the Overview read again keeps its cards and its place, and shows it is reading
jiabubu on Discord: a refresh of the Usage page's Overview showed nothing
while it read, flashed the page and dropped cards for a moment, and
pressing Usage again while on the Overview flashed it or moved its scroll.

- Pressing Usage again (show() calls the plugin's open, loadUsage(true))
  put the skeleton up, which hid the sections, collapsed the page and
  clamped its scrollTop. loadUsage now puts the skeleton up only for a
  first read or another period or zone (usageFor/usageKey); a page that
  already shows that read reads again quietly through refreshUsage, so
  nothing is blanked and the scroll stays.
- The refresh beside the period turns while such a read is out
  (#usageReload.reading, after 200ms), and while every card is read
  (loadQuotas) each card's refresh turns (#subscriptionUsage.reading,
  quotaReading in page.js). A card's own busy turn is left to its own
  animation (:not(.busy)). No turning under reduced motion.
- renderQuotas draws the cards again in one go, as their reset
  countdowns need, but now keeps their logo nodes (keepIcons), and the
  Overview's lists do too: a logo made afresh blinked out while its
  picture loaded.
- app.js stays in its budget: a three-line comment in renderQuotas cut
  to one. Core 1,533,507 of 1,533,802 before the rebase on 0b4cda048.

Tests:
- New usage-quiet-refresh.test.cjs: Usage pressed again at the top,
  halfway and at the foot, with the read held: no skeleton, chart not
  hidden, scrollTop the same, the refresh turning, then the same figure,
  row and logo nodes; and Refresh with the allowances held: every card
  stays, each card's refresh is shown and turning, the logos kept.
  Chromium and WebKit, en and zh, 1180 and 560px. Red on the old assets
  (8 of 8 per part: "nothing blanked while it reads ['skeleton','chart
  hidden']", "the cards' logos are the ones drawn before: false,false,
  false"), green on the new.
- usage-quota-head.test.cjs waited for the skeleton on Agents -> Usage;
  it now waits for the quiet read (the page kept, the refresh turning).
- usage-stale-answer.test.cjs lifts loadUsage out of page.js; it now
  lifts usageFor/usageKey with it and stubs the page's loading state.

Run on mote (mote-run), at the rebased head 344cdcde3: go test -run
TestCoreScriptBudget ./internal/gui ok; gofmt -l clean; the nine usage,
quota and panel files above plus panel-fit-tabs, panel-usage and
panel-quota-refresh: 140 of 140. Before the rebase (at d32a7a70c's base,
same change less the stale-answer stub): go test ./internal/gui ok apart
from TestSettingsSaveKeepsWhatItDoesNotSend, fixed on main by c7c05dcf2;
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./... clean;
every GUI file named usage, quota, allowance, click-scroll, sidebar or
last-page (129 files, 1880 tests): red only in files red on main too or
filed: usage-agents-hide (#2276, #3414, red at d32a7a70c alone),
usage-fold (#3415, red at d32a7a70c alone), usage-ledger's Requests
(#5048), and usage-compact-counts' zh-TW 420px tip under load (#5648,
30 of 30 alone); usage-stale-answer's reds there are fixed here (11 of
11).

Not tried: the whole GUI suite (1,274 files; mote at load 60 to 80
from other sessions), the real app and WebKitGTK, languages beyond en
and zh in the new test (no new strings), and the other pages' re-open
by probe (Sessions, Library, Gateway and Masking were read: none puts a
skeleton up over a page already drawn).

Reported-by: jiabubu (Discord)
2026-11-08 03:57:04 +08:00
yetone f8525323dd providers: a key with no balance URL takes a balance typed by hand, counted down by magpie's own usage
Some API-key providers tell no balance magpie can read (no Balance URL,
no relay query found), so their keys showed none. Now the user types what
the vendor's page says is left, on the key's row in the provider editor
(Set balance) or with `magpie provider key-balance <id> [key [usd|off]]`.
The key's card shows that less what magpie's usage priced the calls it
sent on the key since it was typed (usage.KeySpent, the spend caps'
count), marked as an estimate: "≈$12.50", the pill "≈$12.50 left", its
title saying what was typed, when, and what was counted since. Typing it
again counts from then; No balance takes it off.

A balance the vendor tells always wins: a provider with a Balance URL, a
plan source, Cline's or OpenCode Zen's card takes none typed, and a relay
whose query is found shows its own; when the probe finds none
(errNoBalance) the typed one is shown. A typed balance stays saved as the
user left it: the editor's save keeps it, a key's replaced value carries
it. An estimate is never kept in the balance history and tells routing
nothing (the routing allowances cache is left alone).

keybalance.js is loaded by keyspend.js (itself loaded when the editor
draws a key) for a provider that takes one, so app.js and the core's
script budget are unchanged. Words in zh, zh-TW, ja and de.

Run at this tree (mote):
- go vet ./... (darwin), GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./... at base 46b10af87; at this tree go vet of
  gui, provider, cli and usage;
- go test -tags nogui -count=1 ./internal/gui ./internal/provider
  ./internal/cli ./internal/usage: provider and usage ok; gui and cli
  red only on #5644 below; TestCoreScriptBudget ok (1,533,747, as main)
- the provider tests under -race -count=3;
- GUI: key-own-balance (new: Chromium and WebKit, en zh zh-TW ja de,
  900 and 400px, 20/20), key-spend-cap, old-webkit, i18n-keys, gui-de,
  gui-ja, gui-zh-tw, balance-found, key-balance-card, i18n-en-no-cjk:
  104 pass, 1 fail, i18n-keys "a plugin's words are its own", red the
  same on origin/main 7a2946caf (#5327, #5332, #5482, #5426).

Broken by hand, each went red:
- estimates kept in the balance history: TestTypedBalanceCountsDown;
- no fallback to the typed balance on errNoBalance:
  TestToldBalanceWinsOverTyped;
- the editor's save dropping KeyOwnBalances: TestKeyOwnBalanceRoutes.

Red on main, not this change: TestSettingsSaveKeepsWhatItDoesNotSend
and TestSettingsCLISetsWhatTheWindowSaves (groupSink, groupFirstToken,
groupPatience from 6b7ee4a98), filed as #5644.

Not tried: a real relay account with no balance URL (the cost counted is
magpie's own estimate, so a vendor pricing differently drifts until the
balance is typed again); the full Go and GUI suites before the push (run
after it, under the suite lock); the GUI in the real Windows and Linux
apps; routing does not use the estimate.

Reported-by: tenacious_eagle (Discord)
2026-11-08 02:54:25 +08:00
yetone 2d5d1c1d25 gui: a long menu scrolls under the page's thin thumb on a Mac too
The owner: Settings' Search API menu showed a thick dark scrollbar on a
Mac. The thin thumb on a Mac covered pages, dialogs, framed editors and
the heatmap only; a menu (.pop.proto-menu, .pop.row-menu) and a picker's
list (.pop ul) were left to the system's bar, which with a mouse or
"Show scroll bars: Always" is the classic wide one with a dark track.
They now take the same 8px thumb. Windows and Linux had it already.

Run at this head (rebased on f4179b781) on mote:
menu-scrollbar.test.cjs 4/4 (both engines). The 17 GUI files the full
suite had red were run at main and at this branch: no red is this
change's. menu-input-scroll's webkit cases are red at the parent and at
origin/main 60cb1bd9e too (3 of 3, #3402); the others moved between
runs in both directions (key-replace, gateway-key-models, account-eye).
Not tried: a real mouse on a Mac (the test forces body.mac and checks
the computed scrollbar width).
2026-11-08 02:44:20 +08:00
yetone 60cb1bd9e1 usage: Hide accounts and Used/Left stand apart in the Allowances head
The owner's screenshot: 「账号打码」 sat flush against the Used/Left
segments (这两个之间竟然没有空隙,贴在一起了). Only the trend's range had a
margin; the mask button, added beside it later, had none. The head is now
spaced by a gap of 8px between each control, in place of that one margin.

Run (mote, at 2b3f76d88; the new test again 20/20 rebased on 30b7a1732): the new usage-quota-head-gap.test.cjs, both
engines, en/zh/zh-TW/ja/de at 1100 and 420px, 20/20; with usage-fold and
account-mask, 30/34. The 4 reds are usage-fold's (#3415, #4790), red
the same at the base, which also had account-mask and usage-fold's
chromium zh red in that run.
Broken by hand: app.css at origin/main, the new test is red 18 of 20
(de 420px wraps the segments onto their own line, so nothing touches).
Not tried: the real macOS app.
2026-11-08 02:41:08 +08:00
yetone 784113472d gui: motion answers sooner: strong ease-out, folds and popovers under 300ms, no scale(0)
The owner asked for every animation to follow Emil Kowalski's "make your
app feel faster" rules (x.com/emilkowalski/status/2118687605776597482):
ease-out for anything the user starts, a strong curve over the stock one,
and UI motion under ~300ms. Spinners, attention flashes, decorative loops
and the chart intros are left as they were.

- New token --ease-out: cubic-bezier(.23, 1, .32, 1); --morph-ease is now
  the strong ease-in-out (.77, 0, .175, 1).
- Agents' fold, and the panel's edge that moves with it (UNROLL/ROLLUP):
  .62s/.42s -> .34s/.26s on --ease-out; its rows .56s with a 48ms stagger
  -> .32s with 24ms.
- An agent row's details (ROW_OPEN/ROW_CLOSE, .ag-open, .ag-body):
  .48s/.40s -> .32s/.26s. The curve stays the gentle-start spring the
  comment chose so the panel's edge keeps up; only the time is shorter.
- Hover reveal of a row's menu: up to .52s -> .28s. Chevrons .3-.5s ->
  .22-.32s.
- Popovers: pop-in .42s -> .24s; pop-out was .22s on an ease-in curve,
  now .15s ease-out.
- The new-dot started from scale(0); it starts at scale(.5), opacity 0.
- Sheets, sidebar sub-lists, modals (.57s -> .44s open, .38s -> .30s
  close), Context tiles and fades, plugin cards: 460-620ms -> 240-400ms.
- Theme crossfade .35s -> .25s; copied/new-account pops .36-.5s -> .26-.3s.

Run on the Linux VM (magpie-desktop, WSL), both engines, every language:
- Whole GUI suite at this change: 21559 pass, 431 fail of 21990. The run
  overlapped another session's suite (15-minute load 39). #5559 has 478
  of 21666 red on this VM at main.
- 17 files that touch the changed motion (model-chip-steady,
  page-width-steady, zero-priced-free, segs-press-redraw, rest-try-now,
  provider-fetch-again, codex-predictions, side-toggle, tray-cell-click,
  menu-input-scroll, agent-details-ready, agent-expand-steady,
  held-animations, group-morph, header-centre, inner-scroll-contain,
  recovered-file), concurrency 2, at the parent e6cdeac9c and at this
  change: 230 pass / 154 fail on both, and the 128 failing test names are
  identical (diff empty). They are filed: #4388, #4600, #4689, #2624,
  #3479, #5559.
- i18n-keys' "a plugin's words are its own" is red at the parent too
  (plugin i18n strings also said in Go files); not touched here.

At the pushed head (rebased on 999ba6a00): go test -run Budget|Asset|Embed
./internal/gui ok on mote.

Not run: a clean whole-suite baseline at the parent on an idle machine
(mote was running two other sessions' suites), and nothing on macOS
WebKit or the real tray panel; the feel was not watched in the real app.
2026-11-07 22:04:06 +08:00
yetone c8eb7b3877 search: a search API's keys are a list, each switched off, moved and removed on its own
Web search took one key per API in one field (辰林鸭~ on Discord: only one
Tavily key). Settings › Models › Web search now lists an API's keys under
it as a provider's accounts are: each masked on its own row with a tick
(off / on), Show, Copy and Remove; several pasted at once (commas,
semicolons, lines), the reply saying how many were new and how many it
had; the order changed by dragging or Alt+↑/↓. A resting key says why and
until when on its row ("asked last until 14:05: rate limited"), from the
gateway's rest (SearchKeyRest, SearchQuota.Ref); rotation on 401/403,
402/432/433 and 429 (#1477) is unchanged.

provider.SearchAPI keeps Key as the keys on, comma-joined, so the gateway
and an older magpie never ask one switched off; keyList is written only
while a key is off. A Key that differs from the list (an older magpie, a
sync) wins, its keys on in its order, the list's off keys after. The last
key on can't be switched off or removed. The GUI names a key by
SearchKeyRef (a hash): POST /api/settings/search-keys (add, ref+on,
ref+remove, arrange) and /api/settings/search-key with ref. Saving an API
with no key keeps its keys, off ones too. Backup and WebDAV sync carry
the off keys, or leave them out with the rest. `magpie search` says
"+N off". docs/subsystems/gateway-routing.md has "The keys as a list".

Run (mote, at this tree, base 3441035a2):
- go test -count=1 ./internal/gui ./internal/provider ./internal/backup
  ./internal/davsync ./internal/cli: ok but gui's
  TestPanelHiddenByWailsMarksPageOutOfSight (#5322, mote, untouched) and
  cli's TestEveryRouteHasACommandOrIsNamed, then fixed (search-keys named
  S2) and run again: ok. ./internal/gateway search tests ok earlier.
- node --test search-key-list, search-keys, search-api, search-signs-in,
  search-order: 84/84, Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and
  420px (search-api/order at their own widths). i18n-keys: only "a
  plugin's words are its own" red, as on main (#5332, #5426, #5482).
- go build ./..., go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...: ok. gofmt -l: clean.

Broken by hand, each red then restored:
- SetSearchAPI drops KeyList: provider and gui tests red.
- backup clears Key only / davsync merges Key only: their tests red.
- off keys still put in Key: provider, gui, backup and gateway red.
- the whole key in /api/state: TestSearchKeyListFromSettings red.
- no last-key-on check: TestSearchKeyList red.
- settings.js at HEAD: search-key-list.test.cjs red.

Not tried: a real Tavily account with several keys (the vendor is faked;
no test reaches the network); the real app window (the GUI ran in
Playwright only); Windows and Linux runs of the tests (vet only). The
full Go and GUI suites run after the push, under mote's suite lock.

Reported-by: 辰林鸭~ (Discord)
2026-11-07 21:21:48 +08:00
yetone 9072e2b888 settings: Sync's backup versions fold under Versions, its count and newest in sight (chen2652)
Settings › Sync › Back up by itself listed every kept version, each a row
with Restore…, and the list grows with Versions kept (up to 30). Now the
Versions row folds them: its name carries a chevron (turned down while
open), its name or the line under it opens and folds the list in place,
and the fold is kept over Sync's redraws for the window's life (closed at
first). The keyboard's focus stays on the fold over the redraw. Restore…,
Back up now and the restore's report are as before.

That line, "{n} backups · newest {when}", was one of the hint lines
Settings hides on a hover screen since 11-02, so on a desktop the count
and newest showed nowhere; it is a state, so it carries .say and stays in
sight. No new strings (the fold's text is Versions). Chevron turns in
.15s ease-out, none under reduced motion; no select, borders or gradients.
docs/subsystems/sync-backup.md says it.

Run on mote:
- auto-backup.test.cjs and sync-signins.test.cjs: 42 of 42 pass
  (Chromium and WebKit, 1100 and 420px, en zh zh-TW ja de). The new
  checks: the Versions line is in sight, the list folded at first, opened
  by its line with the page not moving (view scrollTop and the row's top
  the same 300ms on), folded by the chevron, opened by Enter with focus
  kept.
- Broken by hand: origin/main's autobackup.js and app.css under the new
  test: 11 of 11 red in Chromium (the line is a 1x1 hint, no fold).
- Full GUI suite, go vet ./... and go test -timeout 45m ./... (under
  lockf ~/suite.lock): not a valid run. mote's disk filled during it
  (138MiB free, 22GB in its temp folder): 8,673 ENOSPC failures, vet and
  go test could not write their builds. The reds that weren't ENOSPC are
  in files this change doesn't touch: account-eye, codex-auto-reset,
  gateway-caller-keys, gateway-key-models, header-centre, i18n-keys ("a
  plugin's words are its own": three plugin words also in Go files) and
  key-replace; not checked on origin/main, as mote had no room.

Not tried: the real app, a touch screen (where hints aren't hidden), the
full suites (above).

Reported-by: chen2652 (Discord)
2026-11-07 21:02:36 +08:00
yetoneandmdwsk88 8de63c8b5a gateway, usage, gui, otlp: a request its agent canceled is no failure (#2398)
An agent that cancels its request before it is answered is logged 499
"the agent canceled the request": a person stops the reply, or sends the
next message while it is coming and Claude Desktop cancels it and asks
again, or Codex takes a subagent's report (#2398). The gateway already
says nobody failed (no rest, no reroute: TestCanceledRequestRestsNobody),
but Record.Failed is a status >= 400 or an error, so every page counted
it as a failure: the Requests card's "N failed" and success share, its
Failed filter, the CSV's error column, the Routing page's "errors your
agent saw", the Context page's error rate, the failed colour in the
Requests list, Routing and Recent calls, and the OTLP export's error
status. A Claude Desktop session on 2026-10-27 had four, each a message
sent mid-reply; #2398 had 91 of a day's 92 failures.

usage.CanceledBy tells the agent's cancel (499 with AgentCanceled) from
magpie's own limit on a request it asked of itself, logged 499 too and
still a failure (#2318). The cancel is logged with an error type of its
own, agent_canceled (usage.CanceledErrType, set in failedWith), so the
record says what it was and nothing guesses it from a 499, as #2398
asked. Record.Canceled reads the type, and a record logged before it by
its status and message, so the old log reads the same with nothing
migrated. A middleware's usage rows carry the type, so a module can tell
the cancel from magpie's own limit, which its rows (no error text)
couldn't.

Record.Failed leaves the cancel out; Totals counts it apart (Canceled, in
count and plus); RetriedRequest and the first-token and speed sums ask
Answered, so a canceled request is timed nowhere, as before; Codex's
memory of the last model still skips it. Routes and Recent calls say
canceled (set as a route is done and as a day's history is read, so old
days read the same); the Routing totals and the Context page's errors
leave it out. Ledger rows say canceled, and the pages show it muted, in neither the
failed nor the answered colour: the Requests list and its detail ("499 ·
canceled"), the Requests card ("N canceled", the success share of the requests not
canceled), the overview tile, the Routing page (a "gone" outcome, no
speed) and Recent calls (muted). New strings are in zh, zh-TW, ja and de.

The OTLP export: the records the gateway gives its observers for a
request and its try carry the type too (canceledAs), and a root span's
error.type follows Record.Failed, so a canceled request's span and its
try's go with status code 499, no error and no error.type.
TestOTelWaterfallFailureAndCancellation's canceled case held two failed
spans (the try the vendor refused as the agent left is recorded canceled,
as the request is); it now holds neither failed, both 499 and no
error.type. That change to the test is the point of this one.

mdwsk88's patch (aea0027fd) ran its tests at e056779a, a3768cdd,
c86fa2a3 and fcc0daa2, broke each check by hand (each red), and sent
real Claude Desktop cancels through a nogui build with a stand-in
upstream and OTLP collector. Its full record is on aea0027fd. Since
58541e5b (#4866) Codex's own-sign-in relay logs Codex gone mid-reply as
499 through canceled() too, so it counts as canceled
(TestCodexGoneMidReplyIsNoFailure). drawing_route.go still reads a
canceled request as not served when it decides whether a picture's
next request may stay on its provider: that is routing, not a count.

Ported to origin/main 400b66ec3 on 2026-11-07, reviewed line by line.
Two siblings it left on the old rule, and a colour, now covered:
- usage.Row.Floor (the Claude Code speed floor) asked !Failed, so a
  canceled row, whose Failed is now false, told a floor: "3000 tokens
  in 4000 ms" for a reply no one waited for. It asks Answered now, as
  the speed and first-token sums do. TestAgentCanceledTellsNoFloor.
- The route-events feed (activityOf, #3387) told a canceled try and
  done route as failed. It leaves usage.CanceledBy out, and still
  counts magpie's own 499 limit. TestRouteEventsCanceledIsNoFailure.
- routing.css: a canceled Routing row ("rt-req gone") had the
  answered green dot. Its dot is muted now.
  routing-canceled-row.test.cjs checks the row, its dot and the errors
  stat in Chromium and WebKit, in en, zh, zh-TW, ja and de.

Run at this tree (mote-run, macOS):
- go test -count=1 internal/usage, usageapi, otlp, settings,
  settingsapi and cli: ok. internal/gateway: ok with -timeout 45m
  (847s; the default 10m ran out under load). internal/gui: ok but
  TestMainWindowCorners/macOS_26_SDK (#3949, mote is on macOS 27).
- Broken by hand: Floor on Failed again makes
  TestAgentCanceledTellsNoFloor fail ("a canceled row tells a speed
  floor: 3000 tokens in 4000 ms"). activityOf without CanceledBy makes
  TestRouteEventsCanceledIsNoFailure fail ("a done route its agent
  canceled is told failed"). Restored, both pass.
- GUI: node --test --test-concurrency=4 over routing-*, usage-*,
  ledger-*, panel-*, call-*, search-*, searcher-*, settings-*, i18n-*
  and gui-* (Chromium and WebKit; the files cover en, zh, zh-TW, ja
  and de), with #2398 and #5545 in one tree: 4961 of 5016 ok. The 55
  reds are in 12 files. i18n-keys' "a plugin's words are its own"
  names other files' strings (#5327, #5426, #5482). The other 11 files
  were run alone at dc49feca9 (this tree without either change) and at
  this tree: 52 and 51 reds, the same tests. The one apart is
  usage-focus-steady, which flakes (#3501). Each is filed: #5392,
  #3414, #5048, #3799, #3415, #3954, #4627, #4628, #5223, #1529.
  routing-canceled-row.test.cjs: 10 of 10. With the .rt-req.gone rule
  taken out, its dot is the answered green rgb(24, 154, 88) and it
  fails. Restored, it passes.
- Not tried: a real Claude Desktop cancel through this tree; Windows
  and Linux runs.

Co-authored-by: mdwsk88 <11055210+mdwsk88@users.noreply.github.com>
Reported-by: mdwsk88 (dawei on Discord)
2026-11-07 04:03:01 +08:00
yetone 542ee03b4c usage: each request says its cache hit rate, as the Routing page's do
teenux (Discord, #feedback) saw a cache hit rate on each request in the
Routing page's list but none on the Usage page's Requests tab. Each
Usage request now has a Cache hit rate column after Cache read, worked
out as Routing's request list does (promptOf in routing/client.js): the
tokens read from the cache over the whole prompt, uncached input plus
cache reads and writes, through app.js's cacheHitOf. It is said as
Routing says it, a whole percent ("90%"), with Routing's tooltip ("Cache
hit rate: The share of the prompt read from the cache"). A vendor that
counts no cache (cache_unknown, #3464) reads "—" with "The vendor
doesn't count the cache"; a request with no prompt counted reads "—"; a
miss reads 0%. The row's own fields only: nothing new is fetched.

Folding: at the page's 1200px cap the raw cache columns are usually out
already (tight), so the hit rate folds with the first token's column
(lc-opt2, tight2) rather than with them; while it is out the row's
details say it, and while it is in they don't say it twice. Every
string already had its zh, zh-TW, ja and de, so no i18n entries were
added.

Not the same: for a request with billable retries Routing sums every
try's usage, and a Usage row holds one usage record, so the two can
differ there.

Run on mote (macOS 27), Chromium and WebKit, five languages:
- new internal/gui/tests/ledger-cache-hit.test.cjs: 12/12 ok
- 65 GUI files the change reaches (this one included) (every test touching the ledger
  table, its details or the Requests tab) plus i18n-keys and
  i18n-en-no-cjk: 1147 of 1165 ok. Reds, all filed and not from this
  change: i18n-keys "a plugin's words are its own" (#5327, #5332,
  #5426, #5482), gateway-caller-keys en at 560px (#3797),
  usage-ledger "newest live route needs no return-to-live button"
  (#3104, #4078). Two more reds were this change's and are fixed here:
  usage-ledger's header list and usage-ledger-detail's always-shown
  labels (now leaving lc-opt2 out, as they left lc-opt out);
  usage-ledger-ttft's lc-opt2 header locator now names its column.
  Rerun of usage-ledger, usage-ledger-detail and ledger-cache-hit:
  only the two filed return-to-live subtests red.
- go test -tags nogui ./internal/gui/ (TestCoreScriptBudget and the
  other budgets): ok. No Go changed, so no gofmt/vet.

Broken by hand: origin/main's page.js -> ledger-cache-hit red ("a
Cache hit rate column"); the rate as cache_read / in (Routing's
denominator dropped) -> red on the values (deepEqual).

Not tried: the real app with real history; Windows and Linux GUIs.

Reported-by: teenux (Discord)
2026-11-07 04:02:36 +08:00
yetone d55881730d gateway: a key can be held to some MCP servers and tools
wakaka on Discord (#help, 11-06) asked for gateway keys limited to some
MCP servers and tools, as keys already are to models (#882).

A key's MCP list (caller-keys.json "mcp") holds entries "server" (every
tool of it) or "server/tool"; "-" alone is no MCP server; an empty list
is every server, as before. A key issued under another is held to its
issuer's list too.

Every MCP route checks it:
- magpie's own servers (web search, vision, image, Magpie Browser, plugin
  tools) through serveMCP: initialize/tools/list/tools/call are refused
  or filtered per server and tool, and /v1/magpie/key-limits names "mcp";
- the Library hub ("magpie"): only the backing servers and tools the key
  may use are listed, and a call by name or by fallback is refused;
- /mcp/<name> and /mcp/run/<name>: the server is refused, tools/list is
  filtered in JSON and SSE replies, tools/call refused; a reply the
  filter can't read (an encoded body) is a 502, never passed through.

GUI: "MCP servers" in the key row's menu opens the app's own picker (no
native select) with All, No MCP server, each server and its tools (GET
/api/caller-keys/mcp lists magpie's own servers and the Library's). A
key held to some shows a badge saying which, that opens the same list;
a free key shows nothing more in its row, on hover either. A hover badge
was tried first: it pushed the row past 560px (gateway-caller-keys) and
squeezed the masked key under a drag at 420px (gateway-key-arrange).
CLI: magpie gateway-key mcp <id> github fs/read_file | none | all.
zh, zh-TW, ja, de strings; docs/reference.md and the gateway-routing and
library subsystem pages.

Not covered: a model's own built-in web search (a vendor tool, not MCP).

GET /api/caller-keys/mcp is named in the CLI parity test's notYet (its
list is what `magpie gateway-key mcp` takes; TestEveryRouteHasACommandOrIsNamed
caught it at the rebased head).

Run on mote (mote-run), at the pushed head:
- go test ./internal/access ./internal/cli ./internal/gui
  ./internal/library ./internal/gateway at a9c40186d (this change on
  2ce44dc28): ok except internal/gui's TestMainWindowCorners/macOS_26_SDK
  (#3949, the same message on macOS 27). After the rebase onto a9667daad
  (no file in common): TestCoreScriptBudget, TestCallerKey*,
  TestEveryRoute*, TestGatewayKey*, TestKeyMCP*, internal/access and
  go vet ./internal/... at d36f89224's tree: ok.
- gateway-caller-keys chromium en reads wider than 560px 4 of 6 runs
  alone on this branch and 4 of 6 on origin/main a9667daad: #3797,
  recorded there.
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go
  vet ./...: clean; darwin, linux (nogui) and windows builds ok; gofmt -l
  clean.
- GUI: gateway-key-mcp.test.cjs in chromium and webkit, widths 1100 and
  420, en/zh/zh-TW/ja/de: 20/20. Every gateway-key*, gateway-keys* and
  i18n* file in both engines: ok except gateway-key-models en (red on
  origin/main ecc26a339 too, #4081/#5233) and i18n-keys "a plugin's words
  are its own" (red on main, #5332).
- The whole GUI suite (both engines, every language) with the hover
  badge: 91 reds in 25 files. Rerun alone on this branch and on
  origin/main 54dc257f1: only gateway-caller-keys (560px sideways),
  gateway-key-readonly, models-fold and models-select-all-api were red
  on the branch alone; the badge moved into the row menu for the first
  two. After it, every gateway-key*, gateway-caller-keys, gateway-card,
  gateway-connect-keys, api-key-theme and i18n* file passes in both
  engines, except i18n-keys "a plugin's words are its own" (red on main,
  #5332, none of the three strings are this change's) and 1 of 20
  models-select-all-api "the click scrolled" (#4389; models-fold is
  #4071). The rest are red on origin/main too and each has an issue:
  account-weight #4644, codex-auto-reset #2360, header-centre #3479,
  images-codex-one #4618, key-replace #4126, menu-input-scroll #3402,
  mobile-web #3952, model-chip-steady #4388, model-copy-id #4621,
  models-works-only #4391, nav-timeout #4787, omarchy #4624,
  page-width-steady #5013, phone-connect-menu #4706/#4707,
  plugin-move-unserved #4392.

Broken by hand, each went red: the serveMCP server gate, call check and
list filter, the own-server list filter and key-limits "mcp"
(TestKeyMCPOwnServer); hubTools, hubServersOf, the hubToolNamed
fallback and hubMCPRun (TestKeyMCPHub); /mcp/run (TestKeyMCPRun); the
/mcp/<name> guard and filter (TestKeyMCPProxy); the GUI's "No MCP
server" being exclusive (gateway-key-mcp).
gateway-key-readonly chromium 420 ja was red with the hover badge (the
sibling run, the whole suite and its rerun; green on origin/main) and
passes with the badge in the row menu.

Not tried: a real Library server through a live gateway, the hub with a
real agent, and running on Windows or Linux (vet and build only).

Reported-by: wakaka
2026-11-07 03:21:57 +08:00
yetone 54dc257f10 gui: a Mac window out of sight 30s lets go of its layers (#5530)
A window hidden with orderOut keeps every layer's buffers in WebContent:
WebKit stops drawing a hidden page but holds what it last drew. The
reporter's hidden window held 1133 MB of graphics in 335 buffers
(140 RenderLayerBacking), and it stayed after 90s idle.

Out of sight 30s (the window only, never the tray panel), the page gets
magpie-asleep: content-visibility: hidden on body, laid out at once,
since a hidden page runs no rendering update of its own. WebKit then
drops every layer but the root's. Shown again, the class goes as the window
is told it is back, and the content and scroll positions are as they
were. Telling the page before Show was tried and left out: the page then
reads WebKit's own document.hidden, still true, as it is told it is shown
(TestPanelHiddenByWailsMarksPageOutOfSight went red). Shown within 30s, nothing
changes.

Measured on mote (macOS 27.2, 1x display, real `make app` build, sandbox
HOME, window 1470x820, 40 providers x 30 models; WebKit's occlusion check
turned off in the probe since mote's screen is locked, else the page never
draws at all):
- Plugins (688 buttons), hidden: before 50 PlatformCALayerRemote, 10
  RenderLayerBacking, 27.0 MB dirty graphics, unchanged at 70s (control,
  sleep cleared); after 30s asleep 19 / 1, 20.3 MB.
- Providers (280 buttons): 43 / 7, 14.4 MB hidden; asleep 16 / 1 but
  18.4 MB: the root tiles are drawn again blank and are no longer
  volatile, which costs about one window's tiles when a page has few
  layers. It saves every other layer's buffers, which is the reporter's
  case.
- Shown again: 50 / 10 layers, frames running, content and scroll kept.
Not reproduced: the reporter's 140 large backings; which page made them is
asked on the issue. Taking the webview out of its window while hidden
freed 5 MB more and was left out (a native change for little).

Ran on mote: window-asleep (new), window-visibility and held-animations
in chromium and webkit, all ok. Broken by hand, each red in both engines
in the test that guards it: no sleep timer (the 30s test), the panel put
asleep too (the panel test), the timer not cleared when shown (the
shown-within-30s test). go test ./internal/gui: ok but
TestMainWindowCorners, red the same at origin/main f7cf17290 (#3949);
the budgets and the AppKit visibility tests ok. go vet, GOOS=linux go
vet -tags nogui, GOOS=windows go vet, gofmt: clean. The whole GUI suite
and the full Go suite run after the push; their results go on #5530.
Not tried: a Retina display, the reporter's macOS 26.6, Linux and
Windows (the class is set only when the window is told it is hidden,
which only macOS does).

The core scripts stay in their budget with four comments in app.js cut.

Reported-by: faithleysath
Reported-by: Matrix (Discord)
2026-11-07 00:09:10 +08:00
yetone 80ae904c23 routing: routing groups get a page of their own, beside Routing
The owner asked for the groups to leave the Routing page (11-06): under
the live stage and every request they were a long scroll down, and New
group with them. The design was reviewed before this was built.

- New page, Routing groups (#view-groups), drawn by the routing plugin's
  same script (routingPage), so the editor, its dirty/discard and every
  group action are unchanged. Toolbar: filter, "N groups · M on",
  Templates, Import, Select, and New group as the filled button. The list
  is right under it, and a Settings section under the list holds Found
  groups (with Exclude providers…) and Names in agents' lists.
- No Export button: each group already has its own Copy to share.
- Routing keeps the live stage and the requests. A request's group opens
  the groups page at its row.
- The sidebar has a Routing groups tab right after Routing (from 1024
  points). The header's row has no room for one: at 860px the extra tab
  pushed the logo out (brand.test). There the tab is hidden, Routing's
  tab is lit for both pages (markNav), and Routing's head has a
  "Routing groups ›" button, hidden beside the sidebar.
- Every way in now goes to the groups page: the guide's Open routing
  groups, the panel's and the provider editor's Make a routing group
  (window/main?view=groups&newgroup=…). mainView still takes
  view=routing&newgroup from an older panel.
- Words: "Routing groups", "Open routing groups", "Once saved, make a
  group of them in Routing groups.", and the editor's names note now says
  the setting is under the list, in zh, zh-TW, ja and de. "Open Routing"
  stays for the Agents page's button.
- Docs: providers-accounts, gateway-routing, plugin-runtime, gui-shell
  and reference say "Routing groups page" where they mean the groups.
- Core budget: the core's scripts are 1,533,774 of 1,533,802, paid for
  by three show()/setGatewayMode comments cut in app.js. No raise.

Tests: routing-groups-page.test.cjs (new) covers the page in Chromium and
WebKit, en/zh/zh-TW/ja/de, at 1280, 640 (window) and 420 (web): no
groups on Routing, the tab or the head's button by width, the lit tab,
toolbar order, New group primary and in sight, list then Settings, no
sideways scroll, no native select, no left-border accent; a request's
group to its row; quotas redrawn with an open editor left alone. The
trace tests (routing-compact, -pause-folder, -rule-models, -folder) open
Routing, then show the groups; routing-editor-foot and
name-suffix-where-named scroll by wheel, as the scroll guard lets a
reader; builtins expects the groups tab beside the sidebar only.
Removed: routing-groups-jump (the head's "Routing groups ↓" that scrolled
down to them, gone with them), routing-pointer-pin and routing-steady
(the groups kept in place under requests streaming in above them: no
request is above them now). Their guarantee that what redraws leaves an
open editor and its typing alone is routing-groups-page's quotas case;
Routing's own lists keep their keepInView.

The groups page's jump: a request's group, or a pool's "Several keys"
chip, opened the groups page and scrolled the row to the centre, and the
next frame show()'s backAfterLoad put the page back where the reader
last left it, then brought the focused segment in by "nearest": in
WebKit the pool sat half under the window's foot (routing-mode-goes, 9
of its 10 WebKit cases). goRouting now jumps at once on a page it opens and
marks it arrived(). The wheel in routing-many-keys turns over the keys:
at the page's foot, now shorter, the mouse rested over the requests list
(.rt-reqs, overscroll-behavior: contain), which took every wheel up, and
the test stopped with 2 keys in sight. That is #4082's cause.
routing-days-fit's fixture has 12 requests, a day that fills the window,
since the day bar held needs room under it.

Run on mote (macOS 27, load 25 to 65), Playwright 1.62.0:
- Go: go vet, gofmt -l and go test ./... at the rebased head (650bf8412
  base) ok except TestMainWindowCorners (#3949); internal/gui again
  after the last edits: the same, TestCoreScriptBudget ok (1,533,773 of
  1,533,802, no raise).
- GUI, the 262 files a change here can reach, at the head and at the
  base: the reds at the head are the base's, with their issues:
  menu-input-scroll #3402, provider-mask #5109, context-fold and
  order-unknown (webkit) #3479, header-centre #3479, i18n-keys
  #5332/#5426/#5482, account-eye #5052/#4244, call-headers webkit de
  #5045, codex-predictions #2624, codex-auto-reset webkit de #4790,
  routing-* under load #5088, and zero-priced-free, last-page,
  reasoning-speed, routing-row-swap/-tag-whole/-story-shrinks/-steps-cap
  and routing-intent-entry, red at the base the same way.
- After the last edits: the 11 files with a way to the groups page or
  its scroll (group-*, routing-groups-page, routing-mode-goes,
  routing-groups-off, routing-provider-off, routing-many-keys,
  click-scroll), 175 of 176; the one red is routing-many-keys webkit's
  wire at the foot, red at the base in 8 of 12 (#5543). brand,
  gateway-mode-sessions, header-zoom-fit, header-centre,
  inner-scroll-contain and mobile-web: the same 11 reds at the head and
  the base (mobile-web compares with origin/main through git, which a
  mote-run copy hasn't).
- Rebased on ecc26a339, again: gofmt -l, go vet ./internal/gui and
  TestCoreScriptBudget ok; 10 GUI files (i18n-keys, routing-groups-page,
  routing-mode-goes, sidebar, brand, menu-first-second, library-bar-more,
  click-scroll, name-suffix-saved, unlisted-models) 211 of 212, the one
  red i18n-keys' "a plugin's words are its own", red the same at
  ecc26a339 (#5332/#5426/#5482).
- Broken by hand: without the groups page's CSS rule, brand and
  routing-groups-page go red (32 fails); with the old goRouting,
  routing-mode-goes is red in 9 of its 10 WebKit cases.

Not tried: the whole GUI suite on Linux (WSL magpie-desktop) at this
head; a run at an earlier head is under way and has the Linux reds
#4120/#4121 name. Not tried in the real macOS app, only Playwright's
WebKit.
2026-11-06 23:11:43 +08:00
yetone 1f439ecc5e gateway keys: a limit can count only some models or providers (zola_xynb)
zola_xynb on X asked for a cap per model or per provider under one
gateway key. A key limit can now name models (access.Limit.Models,
"<provider>/<model>" or "<provider>/*"), so one key can have, for
example, a month of $20 on openai/* next to a month for the whole key.
Limits without models still cover the whole key, as before.

- budget: sums are kept per window and scope, and count a ledger row only
  when its provider/model matches (any of the model's ids). reserve holds
  a request to a scoped limit only when the model it names is served
  there. windowsOf keeps every scope's sums, so the ledger is not read
  again on each request.
- gateway: keyLimited puts the key's spent scopes on the caller
  (withSpent), count_tokens included. A direct request for a spent model
  gets a 429 with Retry-After and no X-Magpie-Limit-Reset, so a remote
  magpie rests only that model. A routing group, a provider's fallback
  and embedding/image/video/decision groups skip spent members
  (groupKeeps, allowedCandidates) and get a 429 only when none is left.
  System One, count_tokens and magpie's own calls for the key are held
  too. Model lists are unchanged. A refusal turned away before routing
  now records its ErrType in the ledger.
- CLI: magpie gateway-key limit <id> add month --cost 20 --model openai/*
  (--model repeatable, --models a,b).
- GUI: the key limit editor has a Models field that opens the app menu
  (multi-pick: All models, every model of a provider, each model). It has
  no <select> and no new screen. The badge, line and tabs name the models.
  Strings are in every language.
- docs: reference.md and subsystems/gateway-routing.md.

Run at d52725d32 (this change on 4ef47b3f4), on mote:
- go test ./... -timeout 45m, under the shared lock, with the log kept
  whole: every package ok except three reds outside this change. None of
  the three touches what changed:
  - TestClosedBeforeSentEveryTimeSaysWhy (#5031, passes alone 3/3)
  - TestMainWindowCorners/macOS_26_SDK (#3949, red alone on macOS 27)
  - TestMoveToPlugin TempDir cleanup (filed #5524, passes alone 2/2)
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go
  vet ./..., go build ./...: ok. gofmt -l: nothing.
- GUI, chromium + webkit: gateway-key-*.test.cjs, gateway-keys-*,
  i18n-keys, i18n-en-no-cjk and usage-remote-key-limits passed 244/246.
  The new gateway-key-model-limit runs in every language at 1100 and
  420px. The two reds also fail on origin/main 3cbb7e042:
  - gateway-key-models en at 560px (#4081, #4616, #5233)
  - i18n-keys "a plugin's words are its own" (#5327, #5332, #5426, #5482)

Broken by hand; each one turned the named tests red:
- groupKeeps' spent skip removed: ItsModelsAlone and MediaGroups.
- modelAllowed's spent check removed: ItsModelsAlone and AFallback.
- withSpent on count_tokens removed: ItsModelsAlone.
- the scoped refusal sending X-Magpie-Limit-Reset: ItsModelsAlone and
  SystemOne.
- sums counting every model: ItsModelsAlone, TestScopedLimitCountsItsModels
  and TestScopedBesideTheWholeKey.
- embeddings' keyGroupRefusal back to keyModelRefusal: MediaGroups.
- the turned-away row's ErrType dropped: ItsModelsAlone.
- keyHolds not holding for Spent: ItsModelsAlone, AFallback and
  MediaGroups.
- decide.go's 429 back to a 403 stayed green. keyLimited's reserve
  refuses a direct decider first, so that line is a second guard.

Not tried:
- a real vendor account or a real remote magpie.
- the Codex backend path and a video group: they go through the same
  keyLimited/groupKeeps code, but no test of their own.
- the whole GUI suite: only the files above.
- Windows and Linux test runs: vet only.
2026-11-06 20:47:21 +08:00
yetone 251cce2059 usage: a click on All N accounts folds that provider's accounts under it (justfreefall on X)
justfreefall on X (CODEX (2), "既然已经有汇总信息了,能不能出个按钮把下面两个折叠?"):
the All N accounts strip already sums the accounts, so its accounts can go.
The strip gets the per-account card's own chevron (quota-acct-fold, aria-expanded,
Fold/Unfold title, no new strings). A click on the strip or the chevron, or
Enter/Space on the chevron, folds that provider's account cards in the Usage
page and in the tray panel's Allowances; again unfolds. Default open. Kept per
provider in localStorage magpie.usageAllFolded beside the other view choices,
and a storage event redraws the other window. The head's "Show ..." button
stays in its room, hidden and inert, so the strip does not move under the
pointer. A menu-bar cell that asks for one folded account unfolds them first
(focusQuotaCard). quotaall.js reads the choice on first use, so loading it
touches no app.js global (usage-merge runs it in a bare vm).

Core script budget: not raised. app.js +35 bytes, met by shortening comments.

Run (mote, macOS 27, unless said):
- go test -tags nogui ./internal/gui/: ok at the rebased head (130s); Budget
  tests again after the last edit: ok. gofmt -l: clean.
- usage-all-fold.test.cjs (new): 10/10, chromium + webkit x en zh zh-TW ja de,
  window 440x520 and panel 360x760. Broken by hand: with main's assets it is
  red (no .quota-all-fold).
- usage-merge, usage-all-fold, tray-cell-click, quota-caption-contrast, old-webkit
  after the last edit: all ok except tray-cell-click 4/4, red the same at
  origin/main fcc0daa23 (#5215).
- Usage/quota files alone, base fcc0daa23 vs this: usage-fold ("several accounts",
  "17 subscriptions"), usage-agents-hide, usage-compact-counts, usage-ledger
  Requests red the same on both (32 each); usage-merge was red only here
  (kept is not defined) and is fixed above.
- i18n-keys "a plugin's words are its own": red the same on base (#5332).
- account-eye webkit "Usage card's eye" on WSL: base 9/10 red, this 5/10 (#5052, #4244).
- click-scroll webkit "a wheel the page hears of after its scroll": red on base too (WSL).
- Whole GUI suite on WSL (concurrency 8) before the usage-merge fix: ~40 reds
  outside usage (Connect, Copilot GHE, gateway keys, groups, skills, routing
  headers, plugins), the class #5475 records on main; each usage/quota/panel
  red was rerun against base above.
Not run: go test ./..., cross-OS vet (assets and one .cjs only); the real app.
2026-11-06 19:27:42 +08:00
yetone 640825b09a usage: the Requests card's traffic line reads whole, and a row says how many images went by file
matrix0487 on Discord:
- The Requests card's line "↑ 13 GB · ↓ 13 MB · 图片文件省下 44…" was cut
  with an ellipsis. It was one nowrap span.
- A row's details say "图片文件省下 10 MB" and should say "10 MB(3 张)".

The card line is now made of whole parts (usageParts, the pattern the
token line has since #2378). A card too narrow for all three puts the
saving on a line of its own. A part that is wider than the card by
itself (German at 420 wide) wraps inside itself; it is never cut.

The count:
- withDeepSeekFiles counts the image blocks it puts a file id in place
  of, on each try, and upBytes keeps the most of any one try (a retry
  sends the same images again, as the saved bytes are counted).
- It goes into usage.Record as `image_files` (omitempty) beside
  image_files_saved.
- packedRow keeps Tries and ImageFiles in int16 each (clamped to
  MaxInt16), so the row stays 152 bytes. request_snapshot carries the
  new field, and heat_disk hashes Tries as before.
- The detail row says "{size} ({n} image|images)": zh "10 MB(3 张)",
  zh-TW 張, ja 枚, de "Bild/Bilder", en "image/images".
- A row from before the count was kept has no image_files and shows
  the size alone, with no parentheses. The card's period total gets no
  count.

Run on mote, at this tree:
- gofmt -l (clean), go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./..., go build ./...: ok.
- go test -run 'TestRowImageFilesKept|TestRowBytesKept|TestRowsOfOneSession|
  TestDeepSeek|Snapshot|Heat' ./internal/usage ./internal/gateway: ok.
  - TestRowImageFilesKept: the count survives pack/unpack beside Tries,
    100000 clamps to 32767, an old row reads 0, the JSON has
    "image_files":3 and leaves out 0, and packedRow is 152 bytes.
  - TestDeepSeekImageFilesCountedInRow: two images in one message and
    one again in a later message make 3 in the stored row, twice, and a
    request with no image makes 0.
- GUI, BROWSER=chromium and webkit: usage-ledger-bytes runs every
  language at 1180 and 420. The 3-image and 1-image rows read in each
  language's unit, singular in en and de, and the old row stays bare.
  The reporter's period (13 GB, 13 MB, 44 MB) at 1180, 760 and 420 has
  every part whole and inside its card.
- The 79 usage-*/led* GUI files (concurrency 2): 641 of 659 pass in
  chromium and 637 of 654 in webkit. Every red is filed and red on
  origin/main d2c29abe7 too (run alone there in chromium, the same 17
  subtests): usage-agents-hide (#2276, #3414), usage-fold (#3415, #2163;
  in webkit also a timeout in "several accounts"), usage-ledger's
  return-to-live (#4078, #5048) and usage-overview-fold (#3947).
- Broken by hand, each red:
  - The count left out of packedRow: TestRowImageFilesKept.
  - The count not kept in withDeepSeekFiles:
    TestDeepSeekImageFilesCountedInRow ("0 images by file, want 3").
  - The detail's count dropped: usage-ledger-bytes in every language
    ("expected '10 MB(3 张)', actual '10 MB'").
  - The in-part wrap dropped: "de big 420" ("cut: 0,0,0,11").

Not tried: a real DeepSeek account (the count rides the same path as the
saved bytes, which were tried for #5407), and Linux WebKitGTK.

Reported-by: matrix0487
2026-11-06 11:46:25 +08:00
yetone 07fd06b4b5 usage: a narrow Requests list says each request's first token under its duration
Requests has a TTFT column (#2522), but it is the first column a narrow
window leaves out (tight2), and then the value was only in the row's
details. unscientific9 asked to see it in the list itself.

Now, while that column is left out, each duration cell gets a second,
small, muted line: "首字 5.5 秒" / "TTFT 5.5 s" (the core's "TTFT {ms}"
string, "≈" for a time told from a session file). app.css draws it from
a data-ttft attribute with ::after. That keeps it out of the cell's text,
so readers of td.duration's textContent are unchanged. A row with no
first token (a failure, or a reply not streamed) gets nothing. A wide
window shows only the column, as before. The narrow hint now names only
what is left in the details ("Sent, Effort and the cache"). The old
"…the first token…" string is gone from all four languages.

Run on mote, at this tree:
- usage-ledger-ttft, usage-speed, usage-ledger-detail, session-identity,
  usage-ledger-bytes and i18n-keys, BROWSER=chromium and webkit: all pass
  except i18n-keys "a plugin's words are its own". That test is red on
  origin/main for "View routing" and "No session ID" (#5332, #5426),
  strings this change does not touch.
- usage-ledger-ttft runs every language (en, zh, zh-TW, ja, de) at 1600,
  760 and 420 wide. At 1600 nothing is under the duration. At 760 the line
  is the details' first token, "≈" for the Codex row, empty for a failure
  and for a reply not streamed, smaller than the duration, muted, and the
  page doesn't scroll sideways. At 420 the same holds.
- The 79 usage-*/led* GUI files in both engines (see the next commit).
- Broken by hand: with the data-ttft line skipped, usage-ledger-ttft goes
  red in every language ("expected 'TTFT 5.5 s', actual ''").

Not tried: the real app's WebKitGTK on Linux, and the Windows webview.

Reported-by: unscientific9
2026-11-06 11:46:25 +08:00
yetone 08982805eb gui: spinners stand still under reduced motion instead of flickering
_yukirock on X (0.1.3036, macOS 27.3): spinners ran far too fast. The
reduced-motion rule cut every animation to .01ms but left endless ones
endless, so a spinner restarted every few microseconds and each frame
caught it at a random angle (seen frame by frame in the reporter's
video: the arc jumps 90-180 degrees per 60fps frame). It hits anyone
with the system's Reduce Motion, or magpie's own (Settings > General).

The rule now also sets animation-iteration-count: 1, so an endless
animation runs once, ends at once and shows its base style, as the
spinners that declare `animation: none` there already did (ag-up,
quota-refresh, saving). routing.css's busy spinner asked for a 2s turn
under reduced motion; the global !important rule always overrode it, and
it now stands still with the rest.

reduce-motion.test.cjs puts a sign-in spinner in the page and waits up to
1s for its animations to finish: they do while motion is reduced, and
never otherwise. (Counting running animations two frames on was red in
Chromium at the rebased head: a compositor animation can take longer to
start.)

Run on mote (Chromium and WebKit):
- reduce-motion plus every GUI file that reads animations under reduced
  motion (33 files, 1034 tests): 1011 pass, 23 fail. The failing four
  files (context-map, found-skill-pick-remove, mobile-web,
  tray-cell-click) fail the same on origin/main a732f3c49 run alone
  (24 vs 24, context-map's chromium 420px case flips language): filed as
  #3488, #4932, #5013, #3952, #5215.
- Broken by hand: the new test on the old app.css is red (spin 1 where 0).
- go test -tags nogui ./internal/gui: ok. gofmt -l clean.
At the pushed head: reduce-motion 6 of 6 runs green in both engines,
sync-spin green; the new test red on the old app.css (0 of 2).
Not tried: the real app with macOS Reduce Motion on.
2026-11-05 17:09:10 +08:00
yetone b95a78d43c gui: the editor says where magpie found a relay's balance, with Use
A relay added by hand with no Balance URL has its balance found by
magpie, but nothing in the window said so. A user who saw a wrong amount
couldn't tell it was a guess or where to put it right. Under the Balance
URL, in Advanced, the editor now shows "Found by magpie: <url> <field>"
with Use, which copies the query into the Balance URL and Balance field
to be changed. Check balance draws the line again from what it found,
and when it found nothing it says "No balance at /v1/usage or
/api/usage/token" instead of "No Balance URL to ask".

/api/providers carries balanceFound and balanceFoundField. The check's
reply carries looked, found and foundField. The line is in balfound.js,
loaded when the editor draws a relay's balance with no Balance URL. Its
one call and the check's text in app.js are paid for by three provider
editor comments cut down, so there is no raise: the core is 1,533,452,
350 under its budget. zh, zh-TW, ja and de are translated.

Run on mote:
- go test -count=1 -timeout 45m ./internal/gui: ok, except
  TestMainWindowCorners/macOS_26_SDK, mote's macOS 27 (#3949).
- GUI, both engines: balance-found (new, 900px and 420px, every
  language) 22/22. balance-url-first, balance-fix, balance-method,
  balance-field-default, key-balance-card and old-webkit: ok.
  i18n-keys: "a plugin's words are its own" is red (#5327), as on main.

Broken by hand: with the import taken out of app.js, balance-found is
0/11 in chromium.

Not tried: the whole GUI suite at this head (run after the push), and
the real app with a real relay.
2026-11-05 14:46:23 +08:00
yetone e2aaf21f73 gui: a custom provider's Balance URL is asked above its balance token
A relay's user wanting their balance opened the editor and found
"Account balance" asking for a new-api System Access Token or a sub2api
JWT and user id, while the setting that worked (Balance URL
https://app.yylx.io/v1/usage, token left empty) sat at the foot of the
form under More endpoints (小鱼 of yylx.io, WeChat, 11-05).

The Balance URL and Balance field now sit right above Account balance in
Advanced (balSlot), and Advanced opens when a Balance URL is saved. The
token's hint says first to leave it empty, that most relays tell a key's
balance at the Balance URL above (sub2api's …/v1/usage, new-api's
…/api/usage/token), and only then what the token is for. zh, zh-TW, ja
and de have it. In Advanced's narrower column the method picker and URL
wrap, so the URL keeps at least 120px at 420px.

Run (mote, Playwright 1.62.0):
- balance-url-first (new), balance-fix, balance-method and the other
  balance-* files: 186/186 in Chromium and WebKit, at 900 and 420px,
  en/zh/zh-TW/ja/de.
- The whole GUI suite, cut short after 733 tests (it ran for hours
  beside other sessions): red only in account-eye chromium en/ja (#5052)
  and account-weight webkit ja 390 (#4644), both open and in files this
  change doesn't reach.
- i18n-keys: "a plugin's words are its own" red, the same on main
  (#5327).

TestCoreScriptBudget: the hint took the core 494 bytes over its budget;
five comments in the provider editor were cut (573 bytes), so it is 79
under, with no raise.
- go test ./internal/provider ./internal/gui ./internal/cli ./internal/tui
  at the rebased head: ok but internal/gui's TestMainWindowCorners on
  mote's macOS 27 (#3949, open) and the budget before the cut.

Broken by hand: balance-url-first on the old app.js fails at "a saved
Balance URL opens Advanced" (chromium).

Filed: #5336, Advanced is 46px too wide at 420px on main (the Rests
tick's label); the new test checks only the balance rows for it.

Not tried: the real app on Linux (WebKitGTK); no motion or new API here.
2026-11-05 14:19:28 +08:00
yetone 1826c4bd99 providers: a Remote magpie that is this magpie says so and is left out, unless kept (hanslin1666)
B uses A through a Remote magpie provider, and sync carries that
provider to A, where it points at A. Each of its models was one of A's
own, listed again beside it and taken by A's found groups, and a request
through it passed through A's gateway twice.

A fetch of a Remote magpie's list now reads its models' magpie_via: when
the magpie that listed them (the last entry) is this magpie's own
catalog.Self, remote-self.json keeps the provider id and the address it
answered at (noteSelf). Another lister, or a list with no via, takes
the record away; an empty list or a failed fetch changes nothing; a
provider moved to another address is not self until a fetch there says
so. The file is this computer's own, never in a backup or sync.

Such a provider is left out (SelfLeftOut in On, SwitchedOff and
remoteMagpies): not in /v1/models, the catalog or a found group. A
request naming one of its models, an agent's pick synced from B, is
served here with the remote's id taken off (ThroughSelf in Resolve and
ResolveRoute), once through the gateway. A 404 for it says why and how
to keep it.

The Providers row shows "This magpie" (greyed while left out), with the
reason as its title; the editor has a note and a "Use it anyway" tick
(KeepSelf, POST /api/provider/keepself). KeepSelf belongs to the user
and to this computer: Mirror and Restore keep the local value (false for
a provider new here), davsync's hashes blank it, and a provider save
keeps it. Strings in en, zh, zh-TW, ja, de.

Docs: providers-accounts.md (two magpies row), sync-backup.md (what
stays on each computer).

Run at this tree on origin/main 4e85cac01:
- gofmt -l: nothing. app.js 1,309,132 bytes (budget 1,316,874).
- mote: go vet, GOOS=linux go vet -tags nogui, GOOS=windows go vet of
  provider, gateway, gui, davsync, catalog: ok.
- mote: go test catalog, davsync ok; gui red only in
  TestMainWindowCorners/macOS_26_SDK (#3949, macOS 27); provider and
  gateway did not build there (mote's disk full, "no space left on
  device"), so they were run on:
- Linux (WSL magpie-desktop): go test -tags nogui provider, gateway,
  gui, davsync: all ok.
- Windows (xiaomi-gpu): go test -run 'RemoteSelf|KeepSelf|RemoteMagpie|
  Mirror|KeepLogin' provider, gateway, davsync: ok.
- mote: remote-self.test.cjs 16 of 16 (chromium and webkit, 1100 and
  420, en zh ja de), before the rebase; the rebase touched no line of it.

Broken by hand, each red, then restored:
- noteSelf a no-op: TestRemoteSelfRecord and
  TestRemoteMagpieThatIsThisOneIsLeftOut red.
- ThroughSelf a no-op: the gateway test red (404 for rem/own/m1).
- On() without SelfLeftOut: the gateway test red (listed, 2 passes).
- davsync hashes without the KeepSelf blank: TestKeepSelfIsNoChange red.
- Mirror without keeping KeepSelf: TestMirrorKeepsKeepSelf red.
- The row's badge removed: remote-self.test.cjs red (chromium 1100 en).
- The tick's onchange a no-op: remote-self.test.cjs red (webkit 420 zh).

Not tried: two real computers syncing each other (the case is built in
one process: the gateway test's Remote magpie is its own gateway);
the Linux and Windows apps' webviews; the whole GUI suite (mote's disk is full);
remote-self.test.cjs again after the rebase.
2026-11-05 12:37:30 +08:00
yetone d02b8a000e gui: an agent's own models' section says it is the agent's own sign-in (maxleebeta)
An agent's model picker (Pi and every agent with own-provider groups)
lists the providers the agent is signed in to itself below magpie's
models. Their section header was only the vendor's name, e.g. "OPENCODE
GO", the same as the user's magpie provider of that name, so maxleebeta
read Pi's own OpenCode Go list as magpie ignoring the one model picked
for magpie's OpenCode Go.

A section of direct options (Option.Direct) not already named for the
agent now reads "OpenCode Go · Pi's own sign-in" ("OpenCode Go · Pi 自己的
登录"), in sentence case, faint like the header, no accent. Its key is
distinct, so magpie's and the agent's own groups of one vendor are two
headers. Claude Code's "Claude Code" groups (named for the agent)
are unchanged. New string in zh, zh-TW, ja, de.

Run (mote, playwright chromium + webkit):
- agent-own-direct.test.cjs, extended: headings are exactly
  ["OpenCode Go", "OpenCode Go · <own sign-in>"], the own one between
  magpie's and Pi's models, no text-transform, same height as magpie's
  header, no left border or background image; 20/20 (both engines x
  en/zh/zh-TW/ja/de x 980/420). i18n-keys, claude-picker-fold,
  claude-picker-magpie-first, rail-tip green.
- Broken by hand (chromium en 980): suffix never added -> red; header
  key not distinct -> red (headings ["DeepSeek","OpenCode Go"]).
- Whole GUI suite on WSL magpie-desktop (mote was at load ~600):
  19,997 tests, 538 fail across 125 files. Those 125 files rerun at
  main f177c36a9 and at this head: 490 vs 481 fail, the same files; the
  names differing either way are scattered timing tests (Routing rules,
  thumbs, scroll) on a loaded Linux box, none in the picker. The
  picker files that fail (zero-priced-free etc.) fail alike on main.
- go test ./internal/gui: TestCoreScriptBudget red on main too (#5139):
  main 1,533,907, this head 1,533,906 (one byte less; comments trimmed,
  no raise). TestMainWindowCorners/macOS_26_SDK red on main (#3949).

Not tried: the real app or a real Pi sign-in; Linux WebKitGTK and the
Windows webview.
2026-11-04 22:13:43 +08:00
yetone 083821dc96 plugins: a search entry can use the plugin's own sign-in, with its own rests
Asked for by axelburks on Discord. A plugin's search hook entry can name
a provider its own auth hook signs in to, `auth: "<provider id>"`. It then
takes no key. The host picks an account, renews it under `fresh` (the wait
counts within the search's time), runs the hook in `inScope`, and gives it
`ctx.getAuth()`, which returns that account's sign-in. A token the hook saves
with client.auth.set goes to the same account.

The gateway (askSearchSignedIn) asks one account at a time. It takes the
accounts that are on, in the order the provider's model requests take them
(accountsOn, now shared with fallback.go), and puts an account resting from
a search refusal last. A refusal rests only that account's search
(restSearchKey "account <key>"), never its models' rest (restingUntil). Every
attempt gets its own request-log row. An entry without `auth`, or naming a
provider the plugin doesn't sign in to, is a keyed entry as before, with no
getAuth. In Settings → Search, a bound entry shows "Signs in with {name}" in
place of the key field, and the row says whether it is signed in and how
many accounts are on (every language).
Docs: reference.md (with an example), plugin-runtime, plugin-tools and
provider-plugins.

Run on mote at f44fa2ef6 + this change. After rebasing on acd789d45 (an
unrelated responses_ws change), go build ./... and -run "Search|Budget"
on plugin, gateway and provider are ok again at this tree.
- gofmt -l clean; go vet ./internal/... ok; Linux and Windows vet of
  plugin/gateway/provider/gui ok
- go test -count=1 -timeout 45m ./internal/plugin ./internal/provider
  ./internal/gateway ./internal/gui: plugin, provider and gateway
  ok; gui red only in TestMainWindowCorners/macOS_26_SDK, mote's
  macOS 27 title bar, already filed as #3949
- node --test on 15 GUI files: search-signs-in, search-api, search-keys,
  search-order, search-all, search-first, search-instead, searcher-pick,
  searcher-then, provider-search, settings-search, i18n-keys, gui-zh-tw,
  gui-ja, gui-de. 207 of 207 pass (chromium and webkit, 980/420px, en/zh).

Broken by hand. Each break made its test red:
- B1, no ctx.getAuth: plugin TestPluginSearchSignsIn "ctx.getAuth is not a
  function"
- B2, no renewal: "searched as due@seek acc-due", "the renewal never began"
- B3, gateway with no auth branch: gateway TestPluginSearchSignsIn "signed
  in: k9 undefined"
- B4, a refusal that also rests the model account: "a search's rate limit
  rested a@seek for its models"
- B5, getAuth handing out the provider's first account: "as the second
  account: a@seek acc-a"
- B6, the hook run outside inScope: "a token saved while searching as b: a
  rotated-b@seek"
- B7, getAuth given to every entry: "keyed: k9 function"
- settings.js showing the key field for a bound entry: search-signs-in red
  in every engine, width and language

Not tried: a real search vendor or Axel's own plugin; real accounts; runs
on the Windows or Linux boxes; the full GUI suite. The full go test ./...
runs after the push.
2026-11-04 20:55:42 +08:00
yetone 0ebe6c72c9 providers: each account row in the editor has its own Check in now, when the check-in reaches it and it isn't in today (xwoffice_91592 on Discord)
xwoffice_91592 asked for 立即签到 on each account in the provider editor
sheet (Trae CN, a plugin's subscription, one row per account with its
Credits line). The editor's rows read GET /api/login/usage, which carried
no check-in. It now passes those cards through provider.LoginCheckins,
which marks them as the Usage page's cards are (WithCheckins: checkins,
checkinBy, checkin, checkinOff) and adds checkinKey, the account's key
in its vendor's check-in (markCheckins sets it).

The row's button is Settings' Check in now for one account (xiaowu_95660),
not a fork. ciAcctFill in checkinnow.js presses ciNowSend with
{key, user} and checkinBy, so the same POST /api/usage/checkin-account,
the same status-line success and failure, then the row's usage is read
again. When to show it is checkinDue, taken out of checkinRow so the
Usage card's press and the row decide alike: the check-in reaches it, it
isn't off, and it isn't in today (a failed day, an "again" answer, or a
Qoder campaign not open yet still count as due). It sits at the end of
the account's usage line, small (.ci-acct), and wraps whole there rather
than being cut. app.js is 51 bytes smaller (comments cut); checkinnow.js
is lazy and not in the core.

Run (mote, worktree at origin/main 14f6d10de plus this):
- go test -run 'TestLoginCheckins|TestTraeCheckin|TestPluginCheckin|Checkin'
  ./internal/provider/: ok. GOOS=linux and GOOS=windows go vet -tags
  nogui ./internal/gui/ ./internal/provider/: ok. gofmt -l clean.
- New editor-checkin-account.test.cjs: 4 Trae CN accounts (due, in
  today, failed today, no check-in), en zh zh-TW ja de, 1000/560 desktop
  and 390 web, chromium and webkit: ok. It checks the translated label and
  tooltip, the placement (not cut, no sideways scroll), the press body
  {by, key}, the status line, the re-read, and that nothing scrolls.
- The editor-*, account-*, checkin-*, plugin-checkin,
  qoder-checkin-recheck, usage-card-* and i18n-keys files, both engines:
  634 of 635 ok. The red is account-eye's Usage card in chromium zh-TW,
  '' !== 'none', which is #5052; run alone it passed 30/30 twice.
- TestCoreScriptBudget: red at 1,533,950 > 1,533,802, which is #5139 (red
  on main at 1,534,001 before this); this change lowers it by 51.
- Rebased on c03dee7e3 (no core script or check-in file changed there):
  editor-checkin-account, i18n-keys and checkin-now-account, both
  engines, 28 of 28 ok; the Checkin provider tests ok; budget the same
  1,533,950.
- Broken by hand: no CheckinKey in markCheckins made
  TestLoginCheckinsPressOneAccount red.

Not tried: a real Trae CN account, WebView2 or WebKitGTK. The whole GUI
suite hadn't run before the push: another session's whole suite held
mote.
2026-11-04 18:49:11 +08:00
yetoneandchiperman 95a0ee1b9e providers: a long model id no longer squeezes its name field away in Names, prices & levels (#5170, chiperman)
chiperman's case: beside deepseek-v4-1-flash-economy-20261017 the
model's display-name field shrank to ~20px at 900px wide (77-94px at
400px), too small to click. The field could shrink to nothing
(min-width: 0) while the id beside it kept its whole width.

The field now keeps a 96px floor. It still fills only the room the id
leaves (flex: 1, basis 0, up to 220px), so a long id gives way after the
field reaches 96px and ends in an ellipsis. A short id is shown whole as
before.

Ported from chiperman's 8691d31 (issue thread; PRs are
collaborators-only), with one change. Their `flex: 0 1 220px` made the
field and the id shrink together, so a short id that fit was cut:
"example" went 48 -> 41px at 1100px in WebKit, and readable-focus's
"selecting a model ID" went red in WebKit (selection ran past the cut
id). Only the min-width is raised here. Their regression test is kept
(the reporter's id in provider-same-as at 900px). Added: one test per
engine, at 400/900/1440px in en, zh, zh-TW, ja and de. It checks the
field is >= 96px, the id is beside it, inside the row and ellipsized,
and that a short id is shown whole.

Run on mote (macOS 27, Playwright 1.62.0, chromium + webkit), at
0ee424e3e plus this change:
- provider-same-as + readable-focus, concurrency 1: 14/14 ok.
- Broken by hand, same files: old CSS -> 6 red ("a long model ID must
  not squeeze its name field away"; "en at 400px: the name field is
  77.203125px wide" in WebKit). chiperman's CSS -> 4 red ("en at 900px:
  a short id is shown whole" in both engines, readable-focus WebKit).
- Every GUI file that reaches the Names editor (21 files) plus gui-zh-tw,
  gui-ja, gui-de and i18n-keys: 320/325. The 5 reds are on origin/main
  0ee424e3e too, run the same way (2 of 2 runs each):
  models-select-all-api "Select all leaves the models..." (flaky at
  420/1100, #4389) and provider-levels-scroll WebKit (#4395).
After rebasing onto origin/main 3eb2bda4f (a Settings change only):
provider-same-as + readable-focus again at this commit, 14/14 ok.

Not tried: the whole GUI suite, the native macOS/Windows/Linux windows
(only Playwright's engines), Go tests (no Go or app.js change;
TestCoreScriptBudget covers app.js, which is unchanged).

Co-authored-by: chiperman <34889778+chiperman@users.noreply.github.com>
2026-11-04 16:22:34 +08:00
yetone 7033f50722 gui: the panel opens the main window from its edge nearest the tray
isaac_bai on Discord, after v0.1.2857 named the header's icon "Open the
main window": with Windows' taskbar at the bottom, the panel stands above
the tray and its header is the panel's whole height from the icon; the
button left of Quit was where his pointer already was. yogurt36 had asked
for one opener, not two, so the panel still has exactly one, now on the
edge nearest the tray:

- Hung below its icon (the Mac's menu bar, a taskbar or bar at the top)
  it is the header's icon, as before.
- Standing above it (Windows' bottom taskbar, a bottom panel on Linux) it
  is "Open the main window" left of Quit in the foot (#openMain), and the
  header has no icon. The string is the one the icon's name already
  uses, in all five languages.

Which side: once togglePanelNow has placed and shown the panel,
tellPanelSide reads the panel's bounds and its screen's and sends
magpiePanelOpenAt("foot") when the panel is nearer the screen's bottom,
"head" otherwise (panelOpenAt, panelside.go; the Mac is always "head").
Under Wayland a window can't read where the compositor put it, so there,
and until the app says, layout.js sets body[data-open-at] by the system:
"foot" on Windows, "head" elsewhere. CSS shows one of the two from it.

Tests:
- TestPanelOpensTheWindowFromTheEdgeNearestTheTray: Windows bottom/top
  taskbar, a tall panel, a second screen above the first, Linux X11
  bottom/top, Wayland, a screen not read, the Mac, unknown places; only
  "head" or "foot" reach the page.
- TestPanelToldItsSideWhenShown: both show paths in togglePanelNow call
  tellPanelSide after placing; app.js has magpiePanelOpenAt.
- panel-open-once.test.cjs, Chromium and WebKit x en/zh/zh-TW/ja/de:
  on a Mac platform exactly one opener, the header's, named per
  language, opening /api/window/main, foot ["profBtn","quit"]; told
  "foot" it moves. On Win32 exactly one opener, the foot's, left of Quit
  (["profBtn","openMain","quit"]), the foot's buttons fitting apart with
  their words whole at 360px, opening /api/window/main; told "head" it
  moves back; an unknown side changes nothing.

Run on mote via mote-run:
- At this head (rebased on 8468afecb): go test ./internal/gui -run
  'TestPanel|TestTrayDouble|Budget|I18n|Asset': ok; node --test
  panel-open-once, i18n-keys, window-no-footer, panel-profiles,
  quit-ask-setting, gui-de, gui-ja, gui-zh-tw: 165 of 165 pass.
- At the same change rebased on f168dd278 (main's 8 commits since are
  Library, Routing, browser and Codex-subagent work, none in the
  panel's header or foot): the 127 GUI files that load
  mode=panel or touch the foot, Quit, i18n or a budget, both engines,
  6 at a time: 2112 of 2136 pass. The 24 reds are in 7 other files; run
  again 2 at a time, 16 stay red at this change and 17 at origin/main
  1e1068c86, the same tests: usage-fold, tray-cell-click and
  codex-auto-reset webkit de (#4790), remote-magpie (#4398), and one
  provider-mask case (filed #5109); account-mask (#3951) and
  quota-curve (#4768) went green on the second run.
- At this head: wsl-run go vet -tags gtk3 ./internal/gui: ok
- win-run go vet ./internal/gui: ok; win-run go test -run
  'TestPanelOpens|TestPanelToldItsSide|TestTrayDouble' ./internal/gui: ok
- gofmt -l internal/gui: empty

Broken by hand (in a copy): panelOpenAt always "head" plus the page's
default and magpiePanelOpenAt doing nothing: the Go test red on 5 cases,
panel-open-once 20 of 20 red. Only the CSS rule that hides the header's
icon at the foot dropped: panel-open-once red (two openers shown).

Not tried: a real Windows tray with the taskbar at the bottom or the top,
or a Linux X11 bottom panel; the bounds Wails reports there are read from
its source (positionWindow, the screen's Bounds), not seen. The whole GUI
suite (1175 files) was not run: mote was at load ~55-100 from other
sessions' suites.
2026-11-04 00:22:54 +08:00
yetone d10f377657 providers: Names & levels is Names, prices & levels, where a model's own price at one provider is set (ferock4669)
ferock4669 asked on Discord whether magpie has a screen to price each
model, since one model can cost differently on each provider. It has:
each row in a provider's per-model list has a price box (input, output,
cache read, cache write, 1h cache write, long-context tier, $ / 1M
tokens), saved in settings' ModelPrices under pid/model. It wins over
the list price in Usage (usage.Pricer through provider.BasePriceIn) and
in a key's spend cap (usage.KeySpent through NewCoster). Nothing has to
be built; the button opening it said only "Names & levels", so nobody
finds a price there.

What changed:
- The button, its panel's heading and fold, and every note that sends
  the user there say "Names, prices & levels" (zh 名称、价格与推理档位,
  zh-TW 名稱、價格與推理檔位, ja 名前・価格・推論レベル, de "Namen,
  Preise & Stufen"); the gateway's vision and compaction notes, the
  provider package's text, the subsystem pages and the site's start
  docs (en, zh, ja) follow.
- The button's tooltip says it sets what each model costs at this
  provider; Usage's "estimated" tooltip says where a provider's own
  price is set and that it counts over the list price. Both in en, zh,
  zh-TW, ja and de.
- Not changed: the Codex model description text in internal/codexcat
  (it goes to Codex, so a vendor sees it) and core_budget_test's
  history comment.
- app.js: a comment above the price box is shortened so the core
  script stays under its budget, not raised (app.js 116 bytes under
  origin/main).

Run at the pushed head (rebased on origin/main 1af868a15), on mote:
- go test -run 'Budget|ModelPrice|ModelPref|Vision|Compaction'
  ./internal/gui ./internal/provider ./internal/gateway: ok.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows:
  ok (before the rebase, which touched no Go of this change).
- GUI, both engines, every language each file runs: the 149 files that
  name the label or open a provider's editor (before the rebase): 1191
  ok, 30 red in 7 files. Each of the 7 is red the same way alone at
  origin/main without this change: provider-fetch-again (#5057),
  provider-typed (#4673), provider-levels-scroll webkit (#4395),
  provider-picks-stay (#4397), usage-agents-hide (#3414), usage-ledger
  Requests (#5048), mobile-web (#3952, no .git in mote-run's copy).
  name-suffix-remote "chromium de" (ERR_NAME_NOT_RESOLVED once) passed
  alone at the head. After the rebase: model-price-edit, i18n-keys,
  name-suffix-remote, usage-ledger, usage-agents-hide again: go tests above ok; model-price-edit, i18n-keys and
  name-suffix-remote (all 10 cases) ok; usage-ledger Requests and
  usage-agents-hide red as at origin/main 1af868a15.
Broken by hand: model-price-edit.test.cjs at origin/main's label is red
in all 4 cases (the button "Names, prices & levels" is not found).
Not tried: the whole GUI suite (another session's full suite was on
mote, WSL at load ~100 with 31 test runners); the real app.
2026-11-03 17:00:38 +08:00
yetone 1dead5dc7b provider: magpie's own Codex account switches leave the Codex app running unless Restart the app is ticked (atom0964)
atom0964 on Discord (#help) has two ChatGPT Plus accounts in magpie, with
Codex always signed in to the first and Only switch Codex's sign-in both
off, on Smart routing. The Codex desktop app kept restarting by itself.
They tried several combinations of the ticks and it still did.

Why: with both off, SwitchWhenSpent signs Codex in to the next account at
98% and back to the first below 90%. Each switch was noted for the Codex
app (codexAppSpentSwitch), and KeepCodexAppOnItsProvider ended its
app-server once no turn ran; the ChatGPT app shows that as an error and
relaunches (#4550). With Codex kept on the first account there is no
switch, but the used-up takeover (magpie made Codex's provider for a
used-up account and given back once it has room; f37742e14 only limits
it to when another account can serve, which two accounts always can)
changed Codex's route, and that ended it too. So every combination
restarted the app.

What changed:
- Provider.RestartApp (restartApp), off by default, set by
  provider/restartapp (SetRestartApp, Codex only). This computer's own,
  like KeepLogin: Mirror keeps it and davsync's hash leaves it out.
- switchLoginBy(agent, user, byMagpie): SwitchWhenSpent marks its
  switch magpie's own (codexApp.auto). In codexAppStep, a change that is
  magpie's own (its switch, the takeover in or out, the first look at an
  app on a used-up account) ends nothing unless RestartApp is on; it
  logs why and the app follows once restarted. The switch notice's
  Restart, the Agents row's Restart, and uninstall are unchanged.
- Still restarted: a switch the user makes (Switch, the Agents row, the
  CLI), a Connect or Disconnect, failover written or taken out (any
  route change while the takeover state is unchanged), and a user's
  switch pending when magpie's comes.
- GUI: under Codex's accounts, with more than one on (or the tick set),
  "Restart the Codex app when magpie switches its account", with a tip
  and toasts in en, zh, zh-TW, ja and de. app.js paid for it with five
  account-row comments cut; TestCoreScriptBudget is not raised.
- docs/subsystems/agent-wiring.md says which changes restart the app.

Known edge: a takeover flip in the same 3s tick as a Connect is taken
as the Connect's (restarted), since the route changed by the user.

Run at the pushed head (on mote, rebased on b967b1620; then rebased on 2a19043af, a Library change touching none of these files, with the core budget checked again: 160 bytes under):
- gofmt -l clean; GOOS=linux (-tags nogui) and GOOS=windows go vet of
  provider, gui, davsync clean.
- go test -count=1 -timeout 45m ./internal/provider ./internal/davsync
  ./internal/backup: ok. ./internal/gui: ok except
  TestMainWindowCorners/macOS_26_SDK, red alone on origin/main 694f4a6d6
  too (#3949). ./internal/cli: ok except TestEveryRouteHasACommandOrIsNamed
  on GET /api/context/reply (#5026).
- GUI (chromium + webkit, 1100 and 420 wide, en/zh/ja/de):
  restart-app (new), switch-only, claude-switch-only, keep-login,
  codex-accounts-via, account-arrange, i18n-keys: 110/110 and 94/94.
  account-arrange's webkit case went red once in a 5-file run on an
  aborted /api/lanes request; it passes alone on origin/main and at
  this head.

Broken by hand:
- codexAppStep's guard turned off: TestCodexAppLeftRunningForMagpiesOwnChanges
  and TestCodexAppFirstLookLeftRunning go red (ended [60]).
- SwitchWhenSpent marking its switch as the user's: TestCodexSwitchedWhenUsedUp
  goes red ("magpie's own switch is counted the user's").

Not tried: a real ChatGPT desktop app on a real used-up account (the
app-server end is stubbed as before); Windows, where the app is quit and
reopened (CodexAppReopen runs only after an end, so leaving it running
skips it too); no CLI command for the tick (switch-only has none either).
2026-11-03 16:34:30 +08:00
yetone e41ef6288c providers: a spend cap on an API key, per day, month or in all (sparkling_lemur_62868)
sparkling_lemur_62868 on Discord: a team's OpenAI key holds granted
credits that other docker services spend from too, and they want magpie
to stop at a share of it. Their workaround was two magpies behind a
gateway-key limit.

What changed
- provider: KeySpendCaps on a provider, keyed by the key's fingerprint
  (key_spend.go): USD over a local calendar day, a local calendar month,
  or in all since it was set. Since is kept while the cap stays one in
  all. SetKeySpendCap and ParseSpendCap refuse an amount outside
  0 < usd <= 1,000,000 and an unknown period, and leave the saved cap
  as it was. Subscriptions are refused, since an account has its own
  usage-window cap.
- usage: KeySpent(keyID, start) is what magpie's own calls on the key
  cost at the Usage page's prices. Turned-away calls and app-reported
  ones are left out. It reads usage.jsonl once per key and start, keeps
  the sum for 5 minutes, and Append counts each new call into it
  (spentNew). A read that a write races is read again.
- gateway: perKeyEvery bars a key at its cap (spendHeld) as a usage cap
  holds an account. The next key serves, then the fallbacks. With none,
  the reply is 429 "spend cap reached: ..." naming each key, what it
  spent of which cap, and how to go on. Retry-After is when the soonest
  period renews; a cap in all gives none. A spend hold is not a usage
  cap: Stop at the caps and strictKeep don't end at it (capHeldOnly).
  The trace's barred row carries the cap, the spend and the period.
- GUI: a pill on each key's row in the provider editor, for example
  "$7.50 of $20.00 today". It opens the app's menu (No spend cap,
  Per day..., Per month..., In all...) and then takes the amount in
  place, as the lane-limit pill does. A key at its cap gets a line
  under its row: "At its spend cap · back in ...". Every string is in
  all five languages. The pill and the line are in keyspend.js, which
  app.js imports when it draws a key's row, so the core's script
  budget is not raised. /api/providers' keyList carries spend, and
  POST provider/keyspendcap sets it.
- CLI: magpie provider spend-cap <id> [key [usd [day|month|total]|off]]
  lists each key's spend and sets or removes a cap.
- docs: providers-accounts.md and gateway-routing.md.

Caveats, also in the tooltips:
- What counts is magpie's priced usage, not OpenAI's bill.
- A model with no known price counts $0.
- Requests already under way when the cap is reached still finish, so
  a key can go a little past it.

Run on mote at the pre-rebase head (3e3196222 + this change):
- go test -count=1 -timeout 45m for internal/provider, usage, cli, gui
  and gateway: provider, usage and gateway ok. Three reds, none from
  this change:
  - cli TestEveryRouteHasACommandOrIsNamed: GET /api/context/reply,
    red on main, #5026.
  - gui TestMainWindowCorners/macOS_26_SDK: macOS 27, #3949.
  - gui TestCoreScriptBudget: from this change. Fixed by moving the
    pill into keyspend.js, then ok on a rerun.
- go vet: plain, GOOS=linux -tags nogui and GOOS=windows -tags nogui,
  all clean. gofmt -l is clean.
- GUI, both engines: key-spend-cap.test.cjs passed 20 of 20 before
  the keyspend.js move, and all of its tests passed again after it.
  It covers en, zh, zh-TW, ja and de at 900 and 400px, a refused
  amount, the set, change and remove posts, and checks for no native
  select, no border stripe and no sideways scroll.
- Also run in both engines: i18n-keys, old-webkit, lane-limit,
  account-cap, key-row-chips-fit, key-weight-fit, key-nourl,
  provider-many-keys, key-switch, key-plan and key-rest-date.
  - key-replace's webkit 420px is red at base 3e3196222 too
    (#4126; base failed 2 of 3 en runs, this change 3 of 3).
  - key-rest-date's webkit zh-TW, ja and de tests time out at
    --test-concurrency=4 with three other files beside it, at base
    too (base 5 reds, this change 7). Run alone at concurrency 2, it
    passes 10 of 10 at base and with this change (#4691).

After the rebase onto 9c51f7fdb, at the pushed head:
- go build ./... and go vet on the five packages: clean.
- go test of the spend tests, TestCoreScriptBudget and the gui
  package's word tests: ok.
- i18n-keys and key-spend-cap in both engines: 24 of 24.

Broken by hand, each red and then restored:
- spentNew taken out of Append: TestKeySpentCountsTheKeysCalls red
  ("after a new call key a spent 3, want 7").
- spendHeld never barring: TestKeySpendCapPassesTheKeyOver red (the
  capped key reached the upstream).
- capHeldOnly keeping spend holds: TestKeySpendCapPassesTheKeyOver red
  (Stop at the caps answered 429 instead of using the fallback).

Not tried:
- a real OpenAI key or real spend;
- the real app window;
- Windows and Linux test runs (vet only);
- the whole GUI suite: mote was running two other sessions' full GUI
  suites at load 250 to 400.
2026-11-03 15:30:44 +08:00
yetone 63dc359fb4 providers: a subscription account's rest, or its model's, shows on its row (maxleebeta)
maxleebeta on Discord (#feedback): WorkBuddy answered 429
{"type":"rate_limit_error","message":"WorkBuddy: 您的使用量已超出频率限制,将在
2026-11-03 23:57:19 UTC+8 重置,您也可以切换其他模型继续使用。"} while the
provider's card said 1,934/2,350 credits left (82%), and nothing on the
Providers page said the account was held back.

Routing already handled the refusal: resetsWhen reads the time (UTC+8, the
space before 重置 included), failure() gives failQuota, and since it says
切换其他模型 the rest is that model's alone (restID), by "resets", till
15:57:19 UTC; the account's other models are still asked (#1669). What
was missing was the page: a key's rest showed on its row, an account's
never did.

- gateway.RestsUnder(prefix) lists the rests in force under a key prefix
  (provider@ for a subscription's accounts, provider@user/model for a
  model's), with Key and the rest's note (Model, By, Error).
- providerJSON.accountRests gives them by user in lower case, the model
  filled in from the key when the note has none; provider.KeyRest gains
  By, Model and Error.
- app.js: the account row in the provider editor gets a line per rest
  (accountRestLines): "<model> resting · 429 quota used up · back at
  <time>" or "Resting · …" for the whole account, the vendor's words
  beside it (shown whole when it names a time magpie couldn't read, so
  an unknown format still says why), and Try now (gateway/unrest by the
  rest's key). The key row's rest line is now the same helper
  (restLineOf), so app.js grows ~800 bytes, under the core budget.
- New strings in zh, zh-TW, ja and de. docs/subsystems/gateway-routing.md
  says where the Providers page reads them.

Not changed: the "-sg" maxleebeta saw in pi is WorkBuddy AI's own model
id (deepseek-v4.1-flash-sg, the paid Singapore id beside the free
deepseek-v4.1-flash); pi's footer and model picker show ids by design,
and the name magpie writes for it is the vendor's ("Deepseek-V4.1-Flash",
"(SG)" added by the plugin only where two ids share a name). Neither
magpie nor the plugin appends "-sg"; the CN build has no -sg ids.

Run (mote, through mote-run):
- go test ./internal/gateway ./internal/gui ./internal/provider at f0df4bb2b
  (base 06944e065): gateway ok (737s), provider ok, gui ok except
  TestMainWindowCorners/macOS_26_SDK, red on macOS 27 as on main (#3949).
- Rebased on 889767b7b: TestCoreScriptBudget, TestI18n*,
  TestAccountRestsInProviderState and the written-reset tests ok;
  gofmt -l clean. GOOS=linux and GOOS=windows go vet -tags nogui ok at
  f0df4bb2b, before the rebase. Then rebased once more onto 8ee172ca0,
  which changes only gateway search files; not re-run there.
- internal/gui/tests/account-rest.test.cjs: chromium and webkit, en, zh,
  zh-TW, ja, de, at 900 and 360px, ok. rest-try-now.test.cjs's 15 webkit
  reds fail the same on origin/main 06944e065 (#2564, #4127).
- Broken by hand: TestRateLimitedModelListedUnderAccount red with
  RestsUnder returning nothing, TestAccountRestsInProviderState red
  without accountRests, account-rest.test.cjs red without
  accountRestLines.

Not tried: a real WorkBuddy account hitting this 429, so the line has
not been seen on a live gateway; the whole GUI suite (mote under another
session's suite). The line shows in the provider editor's account rows,
not on the collapsed provider row.
2026-11-03 14:09:42 +08:00
yetone e189542dfb providers: a new-api relay's user id is its own field beside the balance token (zxc56823)
zxc56823 (Discord #general) added a new-api site with a key and an access
token. The balance card said 请在供应商的「请求头」中添加 New-Api-User = 你的
用户 ID, so they typed 272298 as a header's *name* and left its value
empty. The editor drops a header with no value, so New-Api-User never
reached /api/user/self. new-api v0.9's authHelper still answered 401
"未提供 New-Api-User", and the balance stayed unread. CC Switch asks for
"User ID" in a field of its own and sends it as New-Api-User beside
"Authorization: Bearer <access token>". magpie sends the same request
apart from Bearer, which new-api strips. The id can't be worked out from
the token or the key, so the field can't be zero-config.

- Provider editor, Account balance: when the Balance URL is
  /api/user/self, a "User ID" field sits beside the token, with the line
  that says where the id is shown. The field keeps the id in the
  New-Api-User header row and redraws Headers. It keeps its focus while
  typing, and turns amber when what's typed isn't digits.
- A header named by digits alone with an empty value is the user id.
  headersOf in app.js and userIDHeader in provider.go (cleanHeaders on
  save, and the balance read for an unsaved check) both send it as
  New-Api-User=<digits>. A New-Api-User with a value of its own wins, and
  the digits header is dropped. So the reporter's saved form now works
  without being retyped.
- The 401's hint and the card's text name the User ID field, not Headers
  (en, zh, zh-TW, ja, de).
- The core script budget is unchanged. The ~1.6KB is paid for by four
  comments cut in app.js.

Run at this tree (on origin/main 3d7b1233d, on mote):
- go test -count=1 -timeout 45m ./internal/provider/ ./internal/gui/:
  provider ok. In gui, the one red is TestMainWindowCorners/macOS_26_SDK,
  which is red on mote's macOS 27 (#3949). Nothing here touches AppKit.
  Before the comment cuts, TestCoreScriptBudget was red at +2,373 bytes.
  Now app.js is 9 bytes under its base.
- GOOS=windows go vet ./... ok. gofmt -l is clean. For Linux vet,
  go vet -tags gtk3 ./... in WSL magpie-desktop was ok at the previous
  base 6b8134430; the change is the same.
- GUI, both engines: balance-fix (en, zh, zh-TW, ja, de at 1100 and
  420px), i18n-keys, header-session-hint, balance-method and
  balance-field-default: 178 pass, 0 fail. Earlier, at 6b8134430, the 45
  GUI files that draw the provider editor, its headers, its balance or
  Advanced ran: 1010 tests, 992 pass. The 18 reds are in four files
  (editor-advanced-align, provider-typed, vertex-editor, zhipu-team), and
  the same 18 are red on a clean origin/main 3d7b1233d. Filed as #4615,
  #4673, #4720/#4721 and #4728. The macOS reds are noted on #4673.

Broken by hand:
- Both userIDHeader calls taken out: TestNewAPIUserIDTypedAsHeaderName
  goes red with the fake new-api's 401 未提供 New-Api-User.
- headersOf's digits mapping taken out: balance-fix's first test and the
  User ID tests go red.

Not tried: a real new-api site and account (the fake serves v0.9's
authHelper and quota/500000 from new-api's source). Also not tried:
Linux WebKitGTK and the Windows app.
2026-11-03 13:00:55 +08:00
yetone c9824bb364 usage: each request's row says the credits its reply said
jiabubu (Discord, #feedback) saw a WorkBuddy request's credits shown
before, and now nowhere. The gateway still keeps them: usage.Record.Credits
from the chat usage's `credit` (#2512) reaches the ledger through the
WorkBuddy plugin on every endpoint shape. The ranking, Overview, tiles and
Sessions show them too. The Requests list's rows never did: a plan's model
there reads "—" for a price, and its detail had no line for credits.

Now the cost cell of a row whose reply said credits shows "N credits"
(the same ledCredits words as the ranking) in place of the dash, or under
the API price reference when the model also has a price. The expanded row
has a Credits line. A reply that said none still shows "—". This applies
to every credit-priced provider, since it reads the record's credits and not
the provider.

Tests:
- internal/gateway/plugin_plan_credits_test.go: a moved workbuddy-ai plugin
  replies with WorkBuddy's credit usage. Chat, Messages and Responses, each
  streamed and whole, each land 0.01 credits in the ledger.
- internal/gui/tests/plan-credits.test.cjs: a new test checks the row's
  cell, its title, a row with no credits, a priced row with credits and
  the detail, at 1400px and 420px.

Run at this head (mote, via mote-run):
- plan-credits.test.cjs: 36/36 in Chromium and WebKit, en, zh, zh-TW, ja,
  de, 1400px and 420px.
- go test -run 'PlanCredits|TestCoreScriptBudget|I18n|Lang' over
  internal/gateway, gui, usage and usageapi: ok.
- gofmt -l is clean. GOOS=linux and GOOS=windows go vet for gateway, gui
  and usage: ok.
- The other Usage page files the change reaches, alone, fail the same on
  the base as with it:
  - usage-agents-hide: 22 (#3414, #2276).
  - usage-fold: 4 (#3415).
  - usage-ledger: 6, "newest live route needs no return-to-live button"
    (#4078, #3104).
  usage-curve-zoom-back passes alone.
- Rebased from f49f6ba68 onto origin/main 6b8134430. plan-credits
  (36/36) and the Budget|PlanCredits Go tests ran again at the rebased
  tree: ok. vet and the other GUI files ran on f49f6ba68.

Broken by hand:
- With the old page.js, plan-credits goes 12 red (the new test in each
  engine and language).
- With chat.go's `out.Credits = c` dropped, all six cases of
  TestPluginPlanCreditsReachTheLedger go red.

Not tried: WorkBuddy China's Claude models, which the plugin sends to
/v1/messages. No real bytes were captured (the account answers 401), and
the gateway reads credit from chat usage only (#5011). There was no real
WorkBuddy request through the GUI; the fixture's usage follows #2512's.
2026-11-03 12:37:37 +08:00
yetone 8e9b048b65 settings: a row's explanation shows on hover, not under every name
The owner (11-02, a screenshot of Settings › 模型): hide the lines that
explain a setting and show them on hover, so the page reads quiet and
open ("很简洁,很有呼吸感"). Settings' rows now rest as a name and a
control. The pointer resting on a row (450ms, so passing over rows shows
nothing), or a key reaching its control, shows its explanation whole in a
card under the row's name, or over the row where the window ends; the
card takes no pointer and no row moves. It goes when the pointer or focus
leaves, a key is pressed, or the page scrolls (focus's card follows its
row instead, as Tab scrolls it into sight).

- app.css: in #view-settings, under (hover: hover), a .row.pref's plain
  .sub lines are clipped out of sight, not removed, so a screen reader
  and the search still read them; each carries --hint: 1, which the card
  reads. A search shows them in place again, as before. A touch screen
  keeps them all.
- Stays in sight: errors (.err, .bad), states (.say, [role=status],
  .proxy-check), warnings (.image-gen-hidden, .sync-sign-in,
  .vision-not-marked), .no-names, .pv-hits, .feat-why, .font-note, the
  proxy in use (#proxySub), and any line with a button, link, input,
  code or a search provider's failure note in it (.acts, which
  settingshints.js sets on each such line as it is drawn, through a
  MutationObserver, so before it is painted: Safari before 15.4 has no
  :has(), and old-webkit holds the styles to 15.0). Disclosures stay too: what tracing sends (otel's
  sessions row) and the allow list's addresses, as do a disabled
  pattern's matches. .say is new, on the lines that are a state, not an
  explanation: the version row's update state, a sync's last sync, the
  sync notice, the web page's "Served" line, the local masking model's
  state (downloading, on, failed; its two explaining lines, before it is
  on, are hidden) and what Check in now came to.
- One-line rows are one height: a row left with its name alone was 48
  to 51px by its control (the owner, 10-22: one-line rows of one
  height), so under (hover: hover) every Settings .row.pref has a 27px
  content-box min-height, 51px with its padding, its line above outside
  it. Check in now's row aligns to its top, so its result line grows the
  row down and the button stays where it was pressed.
- app.js stays in the core budget (1,533,799 of 1,533,802 at this
  head, on main's 1,533,789) with three comments shortened, no raise.
- settingshints.js: the card and the .acts marks, a module app.js
  imports at start, not in index.html (one line in app.js; old-webkit's
  list of such modules names it). Its :focus-visible check is in a try,
  as Safari before 15.4 throws on it.

Tests, run on mote (macOS) at this tree:
- settings-hints.test.cjs (new): Chromium and WebKit, 1100 and 420px,
  en/zh/zh-TW/ja/de, Settings › Models. At rest the Image recognition MCP
  server's line is out of sight and still in the page; a gone model's
  error and an unticked image model's warning stay in sight; hover shows
  the whole line in a card off the row's name, inside the window, no row
  box moved, pointer-events none; the pointer leaving hides it; Tab (or
  Option-Tab in WebKit) to the row's copy button shows it; a search shows
  it in place; a line given a link shows at once and rests again when
  the link goes. 20/20 green.
- Broken by hand: with the clipping rule's body gone, 20/20 red on "the
  explanation shows at rest"; with app.js's import line gone, 20/20 red
  waiting for the card; with the .acts observer gone, Chromium 10/10 red
  on the link line. Before the kept lines and the row height were
  in, checkin-now-account was 20 red (the result line hidden, then the
  button moved 7px) and settings-general 10 red at 1000px (one-line rows
  48, 50 and 51px); both green with them.
- settings-lines-wrap.test.cjs: a hidden explanation is skipped by its
  "cut short" measure and checked whole in its card instead (#visionMcpRow
  and the searcher row). 20/20 green.
- 22 more GUI files checked a Settings explanation's text, width or
  wrapping in place; each now checks the text and that it is hinted, and
  skips its geometry (redact-*, privacy-model, settings-general,
  searcher-pick, disabled-models, the *-setting rows, images-codex-one,
  and reply-model-setting, new on main since: red 20 of 22 on ".sub
  fits" until it got the same check, then 22/22).
  These 24 files: 536 pass, 2 fail, both images-codex-one's #pop picker
  race, red the same on untouched origin/main 173b7e274 alone (13/18;
  #4618, commented).
- At this tree, on mote: those 25 files, old-webkit and i18n-keys, all
  green but images-codex-one's #4618 race (3 red). After the last
  rebase (ae060550b, 1a92a97ca) and the comments cut: privacy-model,
  settings-hints, old-webkit, desktop-tiers, i18n-keys green, and
  -run 'Budget|Core' ./internal/gui ok. old-webkit was red before .acts (":has()
  (Safari 15.4)" and settingshints.js unlisted). go test -count=1
  ./internal/gui: ok but TestMainWindowCorners (#3949, macOS 27).
- The whole GUI suite on mote (concurrency 3), one commit before .acts:
  cut short when mote went down mid-run (it rebooted). 25 files had
  reds by then. The 4 that open Settings are main's filed reds
  (gateway-caller-keys #3797, omarchy #4624, mobile-web #3952,
  images-codex-one #4618); the other 21 don't open Settings. Run on
  Linux (wsl-run, magpie-desktop), those 21: 269 pass, 98 fail here;
  270 pass, 97 fail on untouched origin/main 173b7e274, the same files
  red. The one difference was old-webkit, fixed above.
  The whole suite was not run again after .acts.

Not tried: the real app's WebKitGTK (Linux) and WebView2 (Windows), and
a real touch screen; the (hover: none) path is only by the media query.
2026-11-03 09:47:25 +08:00
yetone ae060550b9 claude-desktop: a tier's pick runs with its tier's Claude prompt (behavesAs)
moer2831 on Discord: a model picked for one of Claude Desktop's tiers ran
in the Code tab on Claude Code's generic prompt, not the one of the
Claude model of that tier ("通用提示词和对应模型提示词差距挺大的,感觉直接
蠢了一个度"). Desktop 4.29 and later hand Claude Code behavesAs only from
a profile's inferenceModels (z3t in 4.4212's app.asar: modelPicker
options with each entry's behavesAs).

What changed:
- gateway.DesktopInferenceModels: while a model is picked for a tier,
  the list is every row /v1/models gives Desktop, by its id and in its
  order (a non-empty list replaces discovery, pzn), with supports1m,
  prefer1m and labelOverride as Desktop read them off the row, and a
  pick's anthropicFamilyTier/isFamilyDefault. A pick that isn't a Claude
  model gets behavesAs = its tier's newest Claude id (claude-opus-5-5,
  claude-sonnet-5-5, claude-haiku-5-5, claude-fable-5-1). Nothing picked
  (or a pick no longer listed): no list. Unreadable picks are unknown.
- agent: desktopSyncModels writes it into magpie's Desktop profile on a
  tier's Set, as Desktop comes on magpie and on Sync; temp+rename, only
  when it changed; taken away when nothing is picked. The list is
  magpie's only while its hash is one magpie recorded (stash mark
  claude-desktop.models); any other list (the user's) is never written
  over or removed.
- Claude Code's modelSettings gets the pick's own window even when it
  matches the default (claudeBudget.behaves), since behavesAs would
  otherwise give it the Claude model's.
- GUI: the tiers menu ends with one line, "Claude Desktop reads the
  tiers as it starts: restart it after a change." (en, zh, zh-TW, ja,
  de). The Agents row's Restart already lights from the profile hash.
- docs/subsystems/agent-wiring.md and gateway-routing.md.

Run on mote at this tree (base c86fa2a34): gofmt -l clean; GOOS=linux
(-tags nogui) and GOOS=windows go vet ./internal/agent ./internal/gateway;
go test -count=1 -timeout 45m ./internal/agent ./internal/gateway
./internal/gui ./internal/cli ./internal/tui ./internal/backup
./internal/davsync ./internal/library ./internal/profile ./internal/stats
./internal/uninstall: ok but internal/gateway's
TestCodexPoolSaysTheClientsVersion (passes alone here and at main; #4807)
and internal/gui's TestMainWindowCorners (red the same at origin/main
6a6e4fefa; #3949). GUI (chromium + webkit, every
language they cover): desktop-tiers, i18n-keys, and every file named for
tiers, picks, roles, Desktop, i18n or a language (887 tests,
871 pass; the 16 reds are 4 files red the same at origin/main 6a6e4fefa:
found-skill-pick-remove #4097, menu-input-scroll #3402,
phone-connect-menu #4706/#4707, provider-picks-stay #4397). Not the
whole GUI suite.

Rebased on origin/main a5c1fa4b4 (nothing there touches agent, gateway or
GUI assets but routing.css), then again at the pushed head: go vet
./internal/agent ./internal/gateway; the size budgets,
TestDesktopInferenceModels, TestClaudeDesktop*, TestClaudePlan;
desktop-tiers and i18n-keys in both engines: ok.

Broken by hand, each red: behavesAs left out (TestDesktopInferenceModels);
the window write's behaves check dropped (TestClaudePlan); the sync on a
tier's Set dropped (TestClaudeDesktopModelsList); the user-list guard
off (TestClaudeDesktopModelsList); the menu's line not shown
(desktop-tiers 0 of 4).

Not tried: a real Claude Desktop 4.29 or later (none on mote; this
Mac's is 2.7032 and live). Builds before 4.29 ignore behavesAs and take
the names. Desktop 1.x gets the mythos ids. A user's own gateway profile
applied in Desktop makes magpie's list do nothing.

Thanks moer2831 for the report.
2026-11-03 09:33:25 +08:00