Commit Graph
585 Commits
Author SHA1 Message Date
yetone ea3edd4b13 routing: an account's share names its window when more than one counts the model (Wing8Aqua on X)
On the Routing page, under In turn, each account showed its week's share
("41% used") while its five hours were at 0%, and read as the five-hour
window. The row's share is Allowance.For's, the fullest window's, and
that is the one routing goes by: In turn rotates without weighing usage,
and sets an account aside only when a window reaches 98%, so the week at
98% stops it with the five hours empty. The number was right; it didn't
say which window it was.

Allowance.FullestName gives the name of the window the share is of when
two or more windows count the model (empty for one, as before). The
gateway puts it in Weighed.usedWindow, and the Routing row puts its short
form in front: "7d 41% used" (zh "7d 已用 41%").

Run (mica, -tags nogui): go test -run 'Fullest|UsedWindow|UsedRenews|Weigh'
./internal/provider ./internal/gateway ok; go vet darwin, linux, windows
on provider and gateway ok; gofmt clean. GUI (mote): the new
routing-used-window.test.cjs, 22 of 22 in chromium and webkit, en, zh,
zh-TW, ja and de, at 1100px and 420px; routing-*, i18n-keys, gui-zh-tw, gui-ja and
gui-de: 3234 of 3253; the reds are gui-de/gui-ja (fixed in this push's
sessions commit) and routing-context-fold, pin-away, row-swap, signin and
story-shrinks, red the same on a clean origin/main e4ea31321 run on mica
(#5586, #6512, #3799, #6520, #3954).
Broken by hand: w.UsedWindow not set in trace.go: TestUsedWindowNamesTheWeekInTurn
and TestUsedRenewsWithItsOwnWindow red; the prefix taken out of client.js:
routing-used-window 22 of 22 red. Both restored.
Not tried: a real Claude account with a full week, and the full suite
(both test machines had a long suite.lock queue).
2026-11-13 18:50:25 +08:00
yetone ba60e2e7f4 sessions: de and ja name the uninstalled agent once, as the English does
fe20e4dbd's "{agent} isn't installed here…" has {agent} once; its German
and Japanese said it twice, so gui-de and gui-ja's placeholder check was
red on main. The second mention is now "seine eigenen Dateien" and
"そのファイル自体".

Run (mica): node --test gui-de, gui-ja, i18n-keys, sessions-forget: 20 of
20 pass. Before: gui-de and gui-ja "de/ja has every zh string" red on a
mote run of this branch.
2026-11-13 18:50:25 +08:00
yetone dc1f17c1c8 library: RTK's chart says its top number is the busiest day, not a total (jasonchia58 on X)
jasonchia58 on X (macOS, v0.1.3119): the number at the top right of
Library → RTK's chart (1.6M) stopped changing, while the total under the
chart kept growing. That number is the bars' scale: the busiest day's
(or week's) input in the range, shown bare since 5b43bdd61. It changes
only when a day passes the old busiest, so it read as a stuck total.
Nothing on main changed it since 3119.

It now says "peak day 1.2M" / "peak week 1.2M" (zh 单日最高, zh-TW 單日最高,
ja 1日の最大, de Stärkster Tag), in the library plugin's own words, and
a range with nothing in it shows none. The total stays under the chart.

The Usage page's charts have the same bare peak (plugins/usage/page.js
875 and 4315); filed as #6517, not changed here.

Tests:
- internal/library/testdata/rtk-gain-daily.json is real rtk 1.0.1
  `rtk gain --daily --format json` output from a sandbox HOME;
  TestRTKGainRealDaily parses it and checks the days add up to the
  summary.
- library-rtk-chart.test.cjs feeds those days (moved to end yesterday)
  through a faked /api/library/rtk, chromium and webkit, en/zh/zh-TW/ja/de
  at 980 and 420px: the head says the peak, the busiest bar is the one
  at full height, the foot is the total; an empty 30-day range has no
  peak.

Run on mica (base 5b25d7e9e, then again after the rebase onto
49d7adef7: gofmt, the provider and library tests, library-rtk-chart,
library-rtk-gain, i18n-keys, i18n-en-no-cjk all pass): gofmt -l clean; go test
./internal/library ok; GOOS=darwin/windows go vet and GOOS=linux go vet
-tags nogui of internal/{provider,library,gui} ok; GUI files
library-rtk-chart, library-rtk-gain, library-rtk-admin,
library-rtk-nohook, i18n-keys, i18n-en-no-cjk all pass (both engines).
Broken by hand: the old head (bare tokens(peak)) makes all 12
library-rtk-chart subtests red.
Also run: go test -tags nogui ./internal/gui ./internal/provider: red
only on TestCoreScriptBudget (1,268,751 > 1,268,645, the same number
#6518 records at base 5b25d7e9e; this change adds no core script) and
TestHostBuildsNoList (#6479); editor-hints webkit red as in #6156.
Not run: the full Go suite and the whole GUI suite.
2026-11-13 18:41:28 +08:00
yetone e4ea313215 context: the last-cache fix fits the core script budget again
5b25d7e9e (shenggxhz on X) added 106 bytes of code to context.js while
the core scripts sat exactly at their budget (1,268,645 at its parent),
so TestCoreScriptBudget has been red on main since (1,268,751). The
budget is not raised; the change is packed instead:

- Routing passes the session key whole (sk, the conversation, or the
  line's first request), so ctxCard keys on opts.session alone. Routing
  is ctxCard's only caller.
- cacheOf takes a missing route, so the seed is `lastCache ||=
  cacheOf(opts.prev)`, and the cache shows when lastCache is set: it is
  set only by a shown cache (cacheShown) or by prev, which Routing passes
  only for a request under way, so `live &&` added nothing.
- Three nearby lines in the same card packed to one statement each
  (the health word, the big figure, the cache's class), same output.

core scripts now 1,268,634 of 1,268,645 (117 bytes less than 5b25d7e9e).

Run (mica-run, at this tree on 5b25d7e9e): go test ./internal/gui -run
'TestCoreScriptBudget|TestAppScriptBudget' ok; node --test routing-ctx-cache-long,
-still, -sessions, -fold, i18n-keys, context-cap, ctx-session-line: 150 of
154. The 4 reds are context-cap chromium en/zh (#6514) and ctx-session-line's
session-line test in both engines (#5801), red the same on main before this.
Broken by hand: without `|| lastCache` in the cache's condition, and
separately without the prev seed, routing-ctx-cache-long goes 12 of 22 red
in both engines.
Not tried: the real app; the change has no new behaviour, and the
Routing ctx GUI files cover the card's cache states in both engines.
2026-11-13 18:20:09 +08:00
yetone 2f22cc7e80 redact: Settings › Privacy's masking rules are imported in bulk and copied out (hgk0x on X)
hgk0x on X had many fields to mask, and adding custom rules one at a
time was slow. The Masking rules row now has Import… and Copy beside its
words, as the word lists have:

- Import… opens a box under the row's fields. One rule a line: a name,
  then a tab, =, : or comma, then the pattern; a bare pattern is CUSTOM.
  The box's Regex/Prefix choice says how a pattern is read. A JSON list
  (what Copy writes) is taken as it is, prefix and regex rules alike.
  What was read is listed (the first eight, then "and N more"); a rule
  the list has, or one pasted twice, is passed over. Import saves once,
  after the rules there are. Escape and Cancel save nothing; a redraw
  keeps the box, its text and its choice; a list the gateway refuses is
  said in the box and the paste is kept.
- Copy writes the rules as JSON.

MaxRules stays 32. Measured on this machine: 32 rules took 83ms on a
190KB body, 100 took 343ms, and that cost is on every request. One
rule's regex with alternation (a|b|c) covers many fields, which the
reply says. There is no CLI for masking rules, so none was added.

Run (GUI, mote/mica, both engines):
- new redact-rules-import.test.cjs: 5 languages x chromium/webkit at
  400px, 10/10 ok.
- the 56 GUI files that reach the privacy page, masking or i18n
  (i18n-keys, i18n-en-no-cjk, plugin-own-words, redact-*, mask-*,
  privacy-*, settings-*): 1333 tests, 27 red on loaded mica. The reds,
  run again on mote at base 5d54a990d and at this change: the same 20
  in settings-hints, settings-search and settings-lines-wrap de 440px
  on both (#6353, #6156, #6133). provider-mask's 6 reds were mica's
  load (load 60-85); it passed in both mote runs.
Broken by hand: reading every line as unnamed (named = false) turns
the new test red in every language and engine.
Not tried: the whole GUI suite, and the real app.
2026-11-13 18:17:36 +08:00
yetone f9678cebe2 gui: Routing's quota bars are Usage's, and every account in a Usage card has a line over it
normalcoder_ on X: Routing's remaining/total bars were grey and black
while the Usage overview's are blue, and in a Usage card with several
accounts two accounts ran together with no divider.

Routing's bars were never Usage's: af5889085 drew them grey (--muted),
black (--fg) for the account that answered, on --card-2, from the start.
It was not a regression. Now the stage's rows, a fold's row and each
account's row under the requests carry Usage's .quota-track, so the track
and fill come from that one rule (--pill, --accent) in light and dark.
routing.css keeps only their size and place. The account that answered
still shows by its frame and dot.

The Usage dividers came from six rules spread over app.css, each naming
one kind of row that could end an account (windows, error, balance, read
time, credit days, curve, resets, key line, auto-reset, credits). A
brief account's check-in row (Trae, WorkBuddy, MiniMax Code) and
magpie's own requests line (quota-own) were never named, so the account
after one had no line. One rule now draws the hairline over every
account that follows anything but the card's head or its "All accounts"
box.

Tested: new quota-bars-alike.test.cjs, in Chromium and WebKit, en zh
zh-TW ja de, light and dark, 1100 and 420px. It checks that every
account after the first in a card has a 1px solid --line border, the
first has none, and every visible Routing bar (stage and account list)
has the same track and fill colours as Usage's .quota-track: 10/10.
Broken by hand: the old app.css fails it, the old routing.css fails
it, and the old client.js (no quota-track class) fails it.
Screenshots before and after in both engines, both themes, 1100 and
420px: Routing's bars are accent on the pill track, and the Trae card's
t2/t3 have the line that was missing.
The GUI files that reach Routing, Usage, quota cards and accounts (354
files, every routing-*, usage-*, panel-usage*, quota-*, plus the
subscription-account/rt-acct users, i18n-keys and old-webkit) on mica:
5854 pass, 141 fail. The failures are in 23 files. Rerun at
concurrency 2 on origin/main 51b98b1a8 and on this tree, they fail the
same (130 at base, 133 here, the same files). The extra ones are
tray-cell-click, which fails 2 of 4 on base when run alone, and a
rest-try-now case. old-webkit's red is app.css:~422 :has(), not this
change. go test -tags nogui ./internal/gui -run Budget: ok.
At the pushed head 4176025f4 (rebased): quota-bars-alike, routing-quota-left,
usage-accounts-fold and i18n-keys pass, 30/30.
Not tried: the real app on Linux WebKitGTK (colours only, no motion).
2026-11-13 18:11:09 +08:00
yetone 5b25d7e9e8 context: a request under way in a long session shows the last cache, not "—" (shenggxhz on X)
shenggxhz's Codex session (T3 Code) on Routing showed "— 命中 · 供应商回答后可见" while a request was under way, and read it as the cache missing. The cache was there: Codex's rows record cache_read at about 32K of 34K. The card was dropping it for two reasons.

- The card forgot the last cache whenever the first request in its session line changed (its key was opts.series[0].id). Routing keeps only the latest 60 requests. In a session longer than that, the first request moves on with every new request, so every request under way showed the dash. The key is now the caller's session key (opts.session: the Routing session key, else the conversation).
- A card opened while a request was under way had no last cache to show, even when the session's answered requests were in the list. Routing now passes the session's last answered request with usage (opts.prev). Its cache is shown, dimmed and labelled "the last request's", until this request's own cache is read.

Run (mote):
- At the pushed head (rebased on 80c22eecb): routing-ctx-cache-long, routing-ctx-still, routing-ctx-sessions, routing-ctx-fold and i18n-keys pass 146 of 146.
- At the pre-rebase base 5d54a990d:
- New routing-ctx-cache-long.test.cjs: 22 of 22, in Chromium and WebKit, in en, zh, zh-TW, ja and de. It covers 60 answered requests followed by three more that stream start, then read, then done, with the figure dimmed and right at each step. It also covers a page opened mid-request.
- The 24 context-*, ctx-*, routing-ctx*, routing-context*, sessions-context*, group-context and i18n-* files: 800 of 806. The 6 reds are red the same way alone on origin/main 80c22eecb:
  - context-cap chromium: filed as #6514.
  - ctx-session-line, both engines: #5801.
  - routing-context-fold webkit, ResizeObserver: #5586.

Broken by hand:
- Without prev: the opened-mid-request cases are red, 10 of 22 (5 languages x 2 engines).
- Without prev and with the old series[0] key: all 20 subtests are red.
- With the old key alone, the test stays green, because prev seeds the cache again after each reset. The key is still the cause and is fixed here. prev alone would not cover a request whose prior answer is no longer listed.

Not tried: the real app with a live Codex session past 60 requests; Usage's and Sessions' cards (they pass no session or prev and behave as before); a Windows or Linux run.
2026-11-13 17:46:44 +08:00
yetone f4a73672ef routing: a ChatGPT API account is weighed by its Codex twin's reading, and its story lines wear its own logo
tmr11235 on X (v0.1.3924): a routing group of two ChatGPT accounts, each
added both as Codex and as ChatGPT API (chatgpt-api). The Codex rows read
their week and reset; the story below said "剩余额度未知,排在已知的之后"
next to the Codex logo, so it read as the Codex rows being unknown.

Two causes, both still on main:

- The story's lines were about the ChatGPT API accounts, but a line
  named only an account's name, and logoed() put the logo of the first
  member of that name in the order: the Codex twin. asides() now says
  which member each line is about (by its place, as two lines may say
  the same words), and renderSteps hands it to logoed(), as it did for
  a skipped member's line only.
- OpenAI tells a ChatGPT API account's plan usage nowhere magpie can
  ask, so Smart weighed it as unknown and put it after every known
  account, though it spends the same plan as its Codex twin.
  Allowances("chatgpt-api") now gives such an account the Codex
  account's allowance (samePlanAllowances), matched as
  SamePlanAccounts matches them: both tokens' chatgpt_account_id and
  chatgpt_user_id, never the name, so two Team seats of one email stay
  apart. One with no Codex twin stays unknown. The Routing card reads
  the same figure, as it reads the gateway's.

What was run (GUI on the Linux box through wsl-run, mote over its load
then; Go on mote):
- go test ./internal/provider -run 'TestChatGPTAPIAllowanceIsTheSameAccountsCodexReading|TestRenewedAccountForgetsItsAllowance|SamePlan': ok
- node --test routing-twin-logo (new; chromium and webkit; en, zh,
  zh-TW, ja, de; 1100 and 420): 20 of 20 ok.
- Every GUI file that opens the Routing page (199) plus i18n-keys and
  i18n-en-no-cjk: 3533 ok, 61 red in 13 files (click-scroll,
  ctx-head-narrow, ctx-route-align, ctx-session-line,
  inner-scroll-contain, mobile-web, routing-ctx-sessions,
  routing-many-keys, routing-pin-away, routing-pulse-composited,
  routing-row-swap, routing-sky-under, routing-story-shrinks). The same
  13 files at origin/main daaa11cb5 on the same Linux box: 57 red in
  the same tests; on mote the 13 files give 23 red at both
  origin/main and this change, test for test (ctx-session-line,
  mobile-web, routing-pin-away, routing-row-swap,
  routing-story-shrinks).
- go vet ./internal/provider ./internal/gateway (darwin), GOOS=linux
  and GOOS=windows go vet ./internal/provider: ok; gofmt -l: none.

Broken by hand:
- samePlanAllowances not applied: the new provider test is red ("the
  chatgpt-api account reads [] (known false)").
- asides' member dropped (about[i] -> undefined): routing-twin-logo is
  red in all 20 cases, the unknown lines lead with codex-color.

Not tried: a real ChatGPT API + Codex pair in a sandbox HOME (the
match is SamePlanAccounts', run for real since 2df5d40ee); the full
suite before the push (started after it).
2026-11-13 17:36:40 +08:00
yetone 5d54a990d4 usage: switched-off providers' accounts can be checked in, and Check in all (wxkwxk666 on X)
wxkwxk666 asked for two things on the Usage page. First, a provider
switched off should still show its accounts, at the bottom and folded,
so they can still be checked in each day. Second, one button should check
in every account at once.

- provider.OffCheckins (off_checkins.go) lists every account a
  checkiner reaches whose provider is switched off (Off, not Hidden).
  Each is a card with no windows. Nothing is read or asked for it. Its
  check-in result is matched by its own key, not by its name, since two
  sign-ins can share a name (plugins#254).
  GET /api/usage/checkins/off serves the list.
- The Usage page (plugins/usage) adds a "Switched off · n" line after
  the cards and the hidden line. It is folded until clicked. Each
  account shows today's check-in, and a Check in button when it isn't
  checked in yet. The button uses checkinnow.js's ciNowSend, which
  POSTs /api/usage/checkin-account.
- Check in all, at the head of the allowances, presses every account
  not checked in today, from the cards and from the switched-off line.
  It sends one checkin-account request per account, three at a time,
  shows "Checking in i/n…", then gives the counts (checkinPressSaid).
  When no account is due, it says so and sends nothing.
- Nothing switches a provider back on. The new strings are in zh,
  zh-TW, ja and de. Plugin files only: app.js is unchanged.
- docs/subsystems/provider-plugins.md says all of this.

Run, on mote:
- TestOffCheckinsListsSwitchedOffAccounts, in the fakeco plugin
  sandbox:
  - nothing is listed before the switch-off;
  - after it, two cards with distinct keys;
  - a press on one checks in exactly that account;
  - the provider stays off;
  - only the pressed card carries a result;
  - nothing is listed once the provider is switched on.
- go test ./internal/provider ./internal/gui, at this commit on
  origin/main 0fda3a1c1: gui ok; provider ok but for
  TestHostBuildsNoList, red on main already (#6479)
- gofmt
- go vet for darwin, linux (-tags nogui, ./...) and windows
- usage-checkin-all.test.cjs, in Chromium and WebKit, at 900 and
  420px, in en, zh, zh-TW, ja and de (20 of 20). It covers:
  - the line is folded, at the end, with its count;
  - opening it doesn't scroll;
  - a row's own press asks for that account only;
  - Check in all shows 0/2 while held, presses only the two due
    accounts, and POSTs nothing else (no provider switched on);
  - a second press asks nothing and says every account is in.
- 187 GUI files (the Usage page, panel, tray, settings and their
  neighbours), at the rebased head on mote: 3080 cases, 104 red in 16
  files. Those 16 run again on mote at origin/main 5a2d0ff47 and at
  this commit, under the same load: the same 12 files are red on both
  (checkin-now-account #6029, codex-auto-reset #4790, key-balance-card
  #6414, menu-scroll #5982, mobile-web #3952, old-webkit #6030,
  quota-refresh-order #6180, tray-cell-click #5215, usage-cards-hide
  #6294, usage-fold #4790, usage-hidden-way-back #6295,
  usage-range-times #6499, filed now). account-eye, i18n-keys,
  last-page and quota-warm pass on both in that rerun.
- That wide run found account-alias and account-eye red on an earlier
  draft: a fixture answering {} for the new endpoint made the page
  spread a non-array. The page now takes only an array.

Broken by hand:
- Without checkinAll's not-due skip, all 20 GUI cases go red.
- Without OffCheckins' check-in result (q.Checkin), the Go test goes
  red at off_checkins_test.go:56.
- Matching results by name (WithCheckins), as an earlier draft did,
  also went red.

Not tried: checking in a real switched-off vendor account through the
real app. The press is the existing CheckInAccount path, the same one
Settings' per-account Check in now already uses.
2026-11-13 16:56:19 +08:00
yetone f3ad175fb2 library: an MCP server's sign-in keeps to its link when Settings say so (hkxhkxhkx on X)
hkxhkxhkx asked for magpie never to open OAuth pages in the browser on
its own. Settings › Privacy › Sign-in pages › "Open sign-in pages in the
browser" (signInLinkOnly, since a45a0f1c5) already does that for every
account's sign-in, built-in and plugin, in the window, a web tab and the
command line (`magpie accounts add`, a plugin's login; `magpie settings
set signInLinkOnly true` sets it there). Audit of every route that opens a
sign-in page: the one it missed is an MCP server's OAuth sign-in from the
Library, which /api/library/mcp-signin opened in the default browser
whatever the setting. The TUI starts no sign-in; `magpie web` opens
magpie's own page (it has --no-open), not a vendor's.

Now /api/library/mcp-signin goes through openMCPSignIn: with the setting
on it opens nothing and answers linkOnly. The Library opens no tab of its
own on linkOnly (web), opens the server's editor from a row's sign-in, and
shows the same words as an account's link-only sign-in, the link with Copy,
and Open in browser. No new strings.

Still opened whatever the setting: a plugin whose own sign-in opens the
page or a Chrome window (Grok Build's CLI on macOS and Windows; agnes,
inkstone, astudio, mclaw, sensenova drive Chrome to sign in).

Run (Linux, magpie-desktop via wsl-run; mote was over its load the whole
time with eight full suites queued, mica's disk full):
- TestMCPSignInLinkOnlyOpensNothing (new), TestSignInLinkOnlyOpensNothing,
  TestMCPSignInSaysTheBrowserDidntOpen, TestOpenSignInLinkOnlyAsked,
  TestCoreScriptBudget, TestI18n* (-tags nogui): ok.
- mcp-signin-link-only.test.cjs (new; en, zh, zh-TW, ja, de; desktop and
  web; 1100 and 420px; Chromium and WebKit) with signin-browser-down,
  mcp-signin, mcp-signin-click, mcp-accounts, signin-link-only and
  i18n-keys: 146/146.
Broken by hand: the route back on openError, the new Go test red ("its
page was opened 1 times"); client.js back to main's, the new GUI test red
(no link-only note).
Not tried: a real MCP server's sign-in in the app; the whole GUI suite;
the full Go suite before the push (started after it).
2026-11-13 15:13:13 +08:00
yetone d370bef982 usage: Failed lists the requests a fallback answered, as Routing shows their tries failed (maohy915 on X)
maohy915 runs magpie on a NAS and uses it from another computer's magpie
through Remote magpie. The NAS's Routing page showed failed calls, but
Usage → Requests → Failed found none. Reproduced with two sandbox
instances on mote (B → remote-magpie → A, where A's provider `bad`
answers 429 and falls back to `good`). A's trace had 2 requests and 1
rerouted. Usage had 2 rows, Failed had 0 and Retried had 1. A try that
fails and is handed on writes no row when nothing is billed, and its
request's row is an answer on the second try. Failed kept only
LostRequest, the requests whose agent got the error, so the failed try
was nowhere under Failed. Plain failures, remote or not, were already
listed; only rerouted ones were missing.

Failed now keeps every request a try failed on (Record.FailedTry): the
requests the agent got an error for, the tries handed on, and the
requests a later try answered. Retried still keeps only the answered
ones. The counts are unchanged: each request is counted once, by how it
ended (小一's rule), so a Failed list reads "1 failed · 2 answered on a
retry". The Failed option and the card's "N failed" button now say so in
their tooltip, in every language. Filtered page cells are cached on disk
under the filter, so settledCountVersion goes to 4; the first start after
the upgrade pairs the history again once.

Run (mote):
- go test ./internal/usage ./internal/usageapi ./internal/gui: ok.
- New test TestFailedKeepsRequestsAFallbackAnswered; updated
  TestRequestsCountedOnceWithTheirRetries.
- GUI, both engines: ledger-retried (5 languages, 420/1100), i18n-keys,
  i18n-en-no-cjk, usage-ledger, api-key-usage, purpose-filter,
  usage-ledger-content, usage-phone-head, usage-loops, usage-request-page.
  All pass except known reds: i18n-keys "a plugin's words are its own"
  (#6422/#6423) and usage-ledger "newest live route needs no
  return-to-live button" (#4078/#3104/#4626).
- gofmt; go vet for darwin, linux -tags nogui, and windows.
- Real repro with a binary built from this tree: A's Failed went from 0
  rows to the rerouted request, both in the API and in the real page
  (Chromium).

Broken by hand:
- Filter back to LostRequest: both Go tests red.
- The Failed option's title dropped: ledger-retried red.

Not tried:
- Restoring settledCountVersion to 3 doesn't turn
  TestSettledCountedAsVersioned red: it counts only Filter{}. The bump is
  by reading.
- Not tried on a real NAS or in the desktop app's remote window; the
  page is the NAS's own web page.
2026-11-13 14:17:49 +08:00
yetone 741d502d2a library: a synced MCP server can run its own command on this computer (jinpwng on X, #6426)
jinpwng runs one MCP server on a Mac and in WSL. Each needs its own
program path, and the only ways around it were two servers with two
names or keeping the server to one computer, which loses the sync of its
agents and note (#3836).

A command server now has an optional `shared` start. When it is set,
command, args and env are this computer's, and every reader (the agents'
files, projects, the router, the check) runs them with no change of its
own. Collect carries the shared start in their place and never the field,
so the other computers get exactly what they had. Put keeps this
computer's start, and what comes in for the server becomes the shared
start, so a note, agents or the other computer's own command change still
comes in. A server that comes in as a URL, one kept to this computer,
and the editor sending no shared start each end it.

- GUI: a saved synced command server's editor has "Use another command
  on this computer" under Command. With it on, the hint names what the
  other computers run, and "Use the synced command" goes back. Nothing
  else on the page moves; a new server and a local one have no button.
- CLI: `magpie library mcp here <name> <command args…>` and
  `… here <name> off`; the listing names a server that has one.
- TUI: an edit keeps the shared start.
- Docs: docs/subsystems/library.md, site docs (en, zh, ja).

Run (mote, at the tree pushed but before the rebase):
- go test ./internal/library/... ./internal/cli/... ./internal/tui/...
  ./internal/backup/... ./internal/gui/: ok
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows: clean
- GUI, chromium and webkit: mcp-server-here (new: en, zh, zh-TW, ja, de at
  1100 and 390, the payload, no button on a local server, no sideways
  scroll), library-mcp-json, library-mcp-spaced-path, library-mcp-win-line,
  market-address, mcp-home-health, mcp-startup-timeout, market-have,
  mcp-editor-cancel, mcp-local-server, i18n-en-no-cjk, i18n-keys and the
  other library MCP files: 235 of 238. The reds:
  - i18n-keys "a plugin's words are its own": the same at origin/main
    3f6b1b0c9 (#6422, #6423, memory's "No folder").
  - market-have chromium "a server added by hand is marked added": a flake,
    red 1 of 3 at origin/main 3f6b1b0c9 and 1 of 3 here (#4620).

At the rebased head (on 04776ec6c, which touched library/client.js):
go test ./internal/gui/ ./internal/cli/ ok; GUI mcp-server-here,
mcp-local-server, library-group-steady, i18n-keys: 69 of 70, the red is
i18n-keys' #6422 above.

Broken by hand:
- keepStart doing nothing: TestServerHereThroughSync red (a sync took
  this computer's own command away).
- Collect carrying the server as is: red (carried /opt and "shared").

Not tried: the CLI's here command by hand (vet only; it calls the
tested ServerHere); the real app on a Mac with a real WSL computer syncing over
WebDAV; the test does the Mac-to-WSL round trip through Collect and Put.
A backup restored into an empty library gets the synced command only,
since a backup carries what sync carries.
2026-11-13 13:42:48 +08:00
yetone ac1702c330 library: the first part of a skill group opens below its heading, not over it (jinpwng on X)
jinpwng on X (macOS, Chinese UI): in Library > Skills, opening the first
group made the page jump, and what was clicked went off the screen; the
others opened downwards. The group was the first part of a big group (a
repository split by folder, drawn in the group's windowed list). A click
on a part's heading draws it anew, and the first part's only neighbour
above it is the list's zero-height pad, which the click's hold passes
over. So the page held the next part's heading, the rows opened pushed it
down, and the view scrolled by the whole part: the clicked heading went
from 152 to -920. A part's heading is now data-unrolls, so the hold keeps
its list, whose top doesn't move. Top-level groups, projects and the
Instructions agents already held still; the new test guards them too.

library-group-steady.test.cjs opens and folds, at the top and scrolled:
the Skills groups and the big group's parts (first and second, and the
first with the second open), the projects in Skills, MCP and Subagents
(first and third), and two Instructions agents. Each heading must stay
within 1.5px of where it was clicked. Clicks and scrolls go through
page.mouse, since Playwright's own scroll before a click reads as the
reader's.

Run (mica, mica-run), at base 436d507f0 unless said:
- library-group-steady in chromium and webkit, en zh zh-TW ja de, at 980
  and 420: 22 of 22 pass.
- Broken by hand (data-unrolls line removed): 20 of 20 cases red in both
  engines, "the first part opened: the heading moved from 152 to -920"
  (420: 242 to -830).
- With click-scroll, every-skill, found-fold, library-groups,
  library-instr-busy, library-instr-sets, nav-sub-unroll,
  project-skills-groups, project-skills-pick, skill-fold-all,
  skill-group-shared, skill-groups, skill-parts and i18n-keys, in both
  engines: 90 pass, 12 fail. The 12 are i18n-keys' "a plugin's words are
  its own" (#6422/#6423) and skill-fold-all's strict POST list seeing
  /api/update/using (#5982), red the same on origin/main 4545790de.
- Rebased on origin/main 4545790de (no Library or hold change between):
  library-group-steady again in both engines, 5 languages, 980 and 420:
  22 of 22 pass.
- mote: node --check client.js, gofmt -l, go vet ./internal/gui for
  darwin, linux nogui and windows: ok.

Not tried: the real app on macOS (the GUI files only), and a filter
showing a part (it takes the same partHead).
2026-11-13 13:23:41 +08:00
yetone c2a1d80fc2 routing: In turn says each message you send goes round, and draws it (Wing8Aqua on X)
"Each turn of a conversation goes to the next one" read as every message
of a session moving to another account, when a reader expects a new
session to be the unit, and the line was long. What the gateway does
(affinity.go affine): under In turn with Stays on Auto or Within a turn,
each message the user sends ("new-turn") goes to the next account, round
the list; the agent's tool calls for that message stay ("turn"); a new
conversation goes to the one holding fewest. Session and Strict keep a
whole conversation on one, so In turn goes round per conversation; Off
moves every request. Routing is unchanged.

The words now name the unit and the cost: each message you send goes to
the next one, round the list; its tool calls stay; a move costs some
prompt cache; Stays on Session keeps a whole conversation on one. Same
in the provider editor, a group's editor, the Routing plugin's mode
line, the CLI's groups help and the docs (en, zh, ja; llms-full.txt
rebuilt), in en, zh, zh-TW, ja and de.

Under the words, while In turn is picked, a small figure: two
conversations of three messages, a pill naming the account (A, B, C)
each message went to and dots for its tool calls in that account's
shade, drawn as Stays has it now (Auto moves each message, Session one
account a conversation, Off every request). Theme tokens only (--fg-2,
--muted, --faint, --card-2, --line), no colour. The figure lives in
rotfig.js, imported when In turn is first shown; the core keeps a
one-line hook, and its budget goes up 333 for that and the words.

Run (mote, at this tree): rotate-figure.test.cjs, new, provider editor
and group editor, en zh zh-TW ja de, 900px light and 420px dark,
chromium and webkit, 40/40; stays-strict, routing-group-strategy,
routing-save, routing-advanced, rate-limited-sink, group-template,
group-editor-fits, group-editor-align, routing-affinity-order,
routing-affinity-lead, routing-affinity-cache-write,
routing-pool-tooltip, routing-rows-fit, routing-weight-chip,
group-patience, group-defaults, builtins, search-keys, i18n-keys,
i18n-en-no-cjk, text-size, routing-editor-foot, gateway-key-own-rotate,
routing-accounts-narrow all ok; site worker.test.mjs 41/41;
TestCoreScriptBudget ok; go test ./internal/cli ok; gofmt clean; go vet
./internal/cli ./internal/gui darwin, linux -tags nogui, windows ok.
Red, the same on origin/main 5eac086ae (run there on mica):
account-arrange 53 !== 52 (#6010), old-webkit headerpresets.js (#6030)
and :has() in app.css (#5919).
After the rebase onto d6a6865b1, again at this head: TestCoreScriptBudget
ok, rotate-figure 40/40, site node --test 120/120; i18n-keys red only
on main's "No folder" in memory_mcp.go (72facf72e, #6422). Rebased
again onto 1cc7b7267 (a Gateway list label in app.css and i18n.js):
the core budget measured again there, 1,266,252 of 1,266,341; the full
suite runs after the tag.

Broken by hand: the new test against origin/main's assets is red (old
words, no figure); Session drawn like Auto is red (AAABBB expected,
ABCBCA drawn); the hook never drawing the figure is red.

Not tried: the real app (Wails WebKit, WebKitGTK); the figure is a
static SVG, no motion.
2026-11-13 12:55:57 +08:00
yetone 1cc7b7267d gui: the Gateway list says a model takes video or audio (pingqipai3 on X)
The Gateway page's model list showed each model's reasoning levels,
images and context, but not video or audio input, which the catalog often
knows (a model list's input_modalities, a plugin's capabilities,
models.dev).

/api/providers now carries `inputs` (video, audio, in that order) on each
model, from catalog.Model.InputModalities, and on each routing group,
from its entry's Inputs (any one of its models'). gatewayModels passes it
on, and the gateway plugin's mediaInfo adds a video and an audio glyph
chip after modelInfo's image one, with "Accepts video" / "Accepts audio"
in the tooltip ("(one of its models does)" for a group). The chips live
in the plugin, not in app.js's modelInfo, so the core scripts stay under
TestCoreScriptBudget (they were 553 bytes over in app.js). Strings in
zh, zh-TW, ja and de.

Run: at origin/main 54b6d4d39 + these three commits (c63a6d674, mica):
gofmt -l clean; go vet ./internal/{codexcat,gui,agent,gateway,provider,
catalog,usage} on darwin, GOOS=linux -tags nogui and GOOS=windows ok;
go test -count=1 of those seven packages: all ok (gui's
TestCoreScriptBudget included).
Rebased onto origin/main 21ed46106 after that run (main's gateway,
provider and i18n.js changes): provider, gui, codexcat and
gateway-model-info, i18n-keys, gui-zh-tw run again there (mica): Go all ok, GUI 8 of 9; i18n-keys is red on
"No folder" from 72facf72e on main (#6423), not this change.
The full suite runs after the tag.
GUI: gateway-model-info, gateway-model-chip-height, gateway-decide-info,
gateway-model-reasonless, group-member-info, gateway-models-open-steady,
i18n-keys, i18n-en-no-cjk, gui-de, gui-ja, gui-zh-tw, dates-gui-lang in
chromium and webkit (mote): 83 pass, 2 red, gui-de and gui-ja on the
"{agent} isn't installed here" string from fe20e4dbd, which this change
doesn't touch (#6234, already filed).
Broken by hand: mediaInputs returning nil turns TestMediaInputs and
TestGatewayListSaysVideoAndAudio red; mediaInfo returning modelInfo's box
alone turns gateway-model-info red in chromium and webkit.
Not tried: the real app with a provider whose list names video or audio.
model-chip-steady (the provider editor's chips, not this list) is red
40 of 60 here and the same 40 at origin/main 54b6d4d39 alone (#4388).
2026-11-13 12:53:04 +08:00
yetone c2fd48782b Put back what 1f05c311d took out of main by mistake
1f05c311d was committed with its worktree's older tree on top of a
fresh origin/main (git reset --soft), so beside the memory fix it
undid every file 610ae1f54..c1312ac15 changed (45 files: key balance,
import links, project subagents, uninstall, site, LESSONS.md and
more). This commit restores each of them to c1312ac15 byte for byte;
the tree is now c1312ac15 plus the memory fix alone
(git diff --stat c1312ac15 HEAD: the 4 files of the fix).
2026-11-13 12:18:23 +08:00
yetone 1f05c311d9 library: an open memory holds still while the Memory tab polls (Nietzsche_Li on X)
"资源库-记忆中,被展开的记忆的表单会定时抖动". While search by meaning
still has memories to read (read < of, which can last up to a minute
between memembed.Keep's reads) or a learn-from-conversations run goes,
the Memory tab reads its row again every 2s, and each read drew the
whole page anew. The open editor was a new .lib-detail each time and
played its content-in entrance (opacity .5, 2px slide) every 2s.

- semWatch/distWatch draw nothing when the read changed nothing, and
  redraw only their own row (redrawRow) when it did; the whole tab only
  when the memories changed.
- render() marks a .lib-detail open before it (same data-detail) as kept,
  so it doesn't replay its entrance. This covers every render of an
  open editor in the Library: memories, instruction sets and agents'
  files (the siblings; no other Library tab polls into render()).
- A new memory's text no longer takes the focus back on every render.

Run (mote): library-memory-steady.test.cjs, all 5 languages, 980/420,
chromium + webkit: green 4 of 4 whole-file runs after the last change
(webkit alone 2 of 2 before it). Broken by hand: the same test against
origin/main's client.js and library.css: 22 of 22 red ("the editor
played its entrance again"). One webkit de 420 red was the test's own
first row click intercepted by the header at 420px while the page
settled; the test now opens rows with a DOM click.
Also run, both engines, every language, 980/420: library-memory, library-memory-select, library-memory-suggest, memory-icon, library-instr-busy, library-instr-sets, library-linked-set, library-follow-server: all green. No Go code changed, so no go test or vet.
Not tried: the real app on a real memory store mid-read.
2026-11-13 12:17:43 +08:00
yetone 4431e31f7c library: a project gets subagents of its own, per agent (jinpwng on X)
The Subagents tab now lists the projects as Skills and MCP do. Opening
a project shows each library subagent with chips for the agents that
read a project's own subagent folder: Claude Code (.claude/agents),
Codex (.codex/agents, TOML), OpenCode, Gemini CLI, Qwen Code, Droid
(.factory/droids), Cursor and Copilot (.github/agents/*.agent.md). A
tick writes the subagent into that project only, in the agent's own
format; the agent's global folder and other projects are untouched.

Each file is recorded by its hash and rewritten or removed only while
it is exactly as magpie wrote it, so a same-name file of the user's is
left alone. A rename in the library follows into each project. The
files are kept out of git by the project's info/exclude block, and
follow the repository's other worktrees (syncTrees now copies
Subagents, and clears it for a worktree let go).

POST /api/library/projects/subagents {dir, name|names, agents}. No CLI
yet, like project servers. Hooks, instructions and Claude plugins have
no project scope yet (filed separately).

Run (mica / mote via mica-run, mote-run):
- go test -count=1 ./internal/library ./internal/gui: ok
- node --test, chromium + webkit: project-subagents, project-scope,
  project-servers, project-skills-pick, project-skills-groups,
  project-remove-keep, library-subagents, library-all, library-items,
  i18n-keys, i18n-en-no-cjk, claude-subagents-pick,
  codex-subagents-lead, subagent-effort: 150/150 pass
- gofmt -l clean; go vet darwin, linux -tags nogui, windows on
  internal/library and internal/gui: ok

Broken by hand: dropping Subagents from syncTrees' copy made
TestProjectSubagentsFollowWorktrees red ("the worktree hasn't the
project's subagent"); the earlier session broke the fix by hand and
saw the new library tests go red.

Not tried: a real Claude Code/Codex session picking up the project
subagent; the full go suite (started after the tag); Windows/Linux
runs of the GUI.
2026-11-13 11:51:50 +08:00
yetone 48afb27b0f library: Claude plugin rows show counts, the dialog keeps its width and folds the parts (jinpwng on X, #6309)
The plugin dialog's description, part lists and source line sat in the
editor grid's 132px label column, so even Plannotator (3 hooks) read as a
narrow column: the Hooks heading landed in the right column, the names
under it on the left and the GitHub line in the middle. Description, parts
and hints now span the grid. The list row showed every skill name (PStack
lists a hundred); it shows "Skills 12 · Hooks 3", and the dialog lists each
part's names in a fold, closed by default.

Run at this head (rebased on 610ae1f54), on mica, Chromium and WebKit, en,
zh, zh-TW, ja, de, 420 and 1100: library-plugins, library-subagents,
library-all, library-row-open-scroll, library-open-again, i18n-keys,
i18n-en-no-cjk: 82 of 82 pass. gui-zh-tw passes; gui-de and gui-ja's
"has every zh string" are red on main already ({agent} placeholder, #6234).

Broken by hand: with the span rule cut back to the <p> only, the test fails
with "a part or the source is squeezed" (parts 116/433 of 600px, source
116px), the reporter's alternating layout. With the old CSS it fails "the
description is squeezed: {p:132,d:600}".

No Go files changed, so no gofmt/vet. Not tried: the real app with a real
PStack or Plannotator.
2026-11-13 11:43:59 +08:00
yetone 610ae1f541 library: handing skills over turns off the all-in-~/.agents/skills setting and takes magpie's links out (ConatusMoon2222 on X)
Put skills in "~/.agents/skills" (SharedSkills) gives every agent that reads
that folder every skill, so it cannot go with choosing agents per skill,
which is what "Manage in magpie" (HandOverSkills) is for. With the setting
on, a handed-over skill's entry was taken away and the next sync linked it
back there, so the link stayed (reproduced in a sandbox HOME). Handing over
now turns the setting off in the same write; the sync then removes magpie's
own links there (sweepShared: only ours, never the user's entries). The
confirm sheet says so, only while the setting is on. The Put skills in note
says the skill router lists nothing while every skill is in
~/.agents/skills (the "none" the reporter met), only when both are on.
Strings in zh, zh-TW, ja, de.

Run (on mote, at this tree):
- TestHandOverWithSharedSetting: red with the l.SharedSkills = false line
  commented out ("a link is left in ~/.agents/skills"), green with it.
- go test ./internal/library ok; go vet darwin, GOOS=windows, linux nogui
  on internal/library ok; gofmt -l clean.
- GUI: skill-handover, shared-skills, i18n-keys, i18n-en-no-cjk in chromium
  and webkit, 23/23 each.
Not run: the full GUI suite and go test ./... before the tag; a real
account's Library; WebKitGTK.
2026-11-13 11:28:51 +08:00
yetone cba704d5f0 library: with the skill router on, the page says when no skill is listed for an agent and when its own skills stay in its prompt (ConatusMoon2222 on X)
ConatusMoon2222 turned the Skill router on and reported it "does not take
effect". Reproduced in a sandbox HOME: the router lists only the library's
skills ticked for an agent. An agent with nothing ticked, or each skill kept
direct, got no magpie-skills, yet its row said "on"; and skills in an
agent's own folder that the library lacks stay in its prompt with no word
on the page.

AgentView.SkillRouter is now "none" for an agent whose folder takes the
router but has nothing listed (Applied.Router false), and the Skills tab
names those agents, and the agents that have skills of their own the
library lacks, under the switch (.lib-hub-why data-why none / found). Four
languages (zh, zh-TW, ja, de). docs/subsystems/skill-router.md updated.

Run on mote: go test -tags nogui ./internal/library (ok, 260s);
skill-router.test.cjs in chromium and webkit, all four languages, narrow
and wide (22 pass, with the new found line asserted); go test ./internal/gui
Asset/Budget/Script ok; gofmt clean; go vet nogui darwin/linux/windows clean.
Broken by hand: sync.go back to the parent, TestSkillRouterLastSkillUnticked
goes red ("nothing listed, the view says on").
GUI i18n-*, library-*, skill-* files: all green except skill-fold-all and
skill-manual, red on origin/main from the window's /api/update/using POST
(#5982, not this change).
Not tried: a real agent on Windows; the reporter gave no agent, OS or
version, so the cause for their machine is inferred, not confirmed.
2026-11-13 10:53:40 +08:00
yetone 1281046a02 gui: the Library's Variables tab is called Environment variables
What it holds are environment variables an agent starts with, and
"Variables" alone read as something else (the owner: 应该叫环境变量).
The tab, its empty line, its add buttons and the new item's sheet say
environment variable in en, zh, zh-TW, ja and de (环境变量 / 環境變數 /
環境変数 / Umgebungsvariablen). "Environment variables" moves into the
core i18n.js: otel's page uses the same words, and i18n-keys keeps a
plugin's words its own.

Run (mote, at origin/main ff8b43711 plus this change): library-env 12,
library-hooks 12, library-loading 6, library-subagents 12, i18n-keys 4,
i18n-en-no-cjk 4, all ok, chromium and webkit, every language.
Broken by hand: client.js back to t("Variables") turns library-env 12
of 12 and library-loading 2 of 6 red.
library-loading was red on main before this (#6204, the Claude plugins
tab); fixed in its own commit ff8b43711.
Not tried: the whole GUI suite, the real app.
2026-11-13 04:09:39 +08:00
yetone af7edcc02a gui: the Library's project section is titled by what it holds
The owner (11-12): the MCP tab's 项目中 ("In projects") read oddly over
the servers a project gets. The heading now says what the section is:
"Project servers" on the MCP tab and "Project skills" on the Skills tab,
which shares the section (项目服务器 / 项目技能, 專案伺服器 / 專案技能,
プロジェクトのサーバー / プロジェクトのスキル, Projektserver /
Projekt-Skills).

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

Not tried: the real app; the change is the heading's words.
2026-11-13 04:03:55 +08:00
yetone 5c00da3b25 gui: a group's note says it is optional
The owner (11-12): the note field under a group's name read as one more
thing to fill in. Its placeholder now starts with "Optional", in every
language: 可选,例如:给工作 Key 用 and the like.

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

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

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

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

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

Run (mote, both engines): gateway-port, i18n-keys, i18n-en-no-cjk, 14
of 14 ok.
Broken by hand: settings.js put back as on origin/main, gateway-port red
in both engines (expected 'Gateway port').
Not tried: the real app.
2026-11-13 03:55:09 +08:00
yetone f1f512c1ec library: a repository's heading folds an agent's profiles into one chip, and a row's profiles chip lines up with the hand (Yanzhongixuy on X)
0.1.3926, several Hermes profiles: the Skills page's source headings
(anthropics/skills ...) drew one icon per profile, a long strip, and the one
chip 2a1111cba made on a row sat out of line. That commit said "Rows only":
groupChips never set change.rows, so headings kept every profile. The row's
chip had data-members, not data-agent, so the fan/stack translate rules in
library.css never reached it.

groupChips now sets change.rows, and its profiles chip is half lit when a
profile has some of the skills. library.css applies the fan rules to
[data-members] chips too. docs/subsystems/library.md says so.

Files: plugins/library/client.js, plugins/library/library.css,
tests/library-profile-group.test.cjs (new), docs/subsystems/library.md.

Run on mote: library-profile-group.test.cjs (new; chromium + webkit, en/zh/
zh-TW/ja/de, 420 and 980px, 22 cases): 22 of 22 green; broken by hand (old
client.js and library.css) 22 of 22 red (13 Hermes chips, not 1); old
library.css alone 22 of 22 red (chips out of line). The Library GUI files,
group-skill-chips and i18n-keys ran in both engines: the only reds are
library-loading's chromium and webkit cases, red on origin/main
8c7328f3a6 too (run there alone, 2 of 6
red), filed as #6204.
Not run: the full Go suite and the 113-file GUI run's final tally (still
running when pushed), Linux WebKitGTK, a real Hermes install with many
profiles.
2026-11-13 01:42:52 +08:00
yetone 1488762dae settings: MCP server addresses get the This computer / Local network switch (xzhih on X)
Settings > Models showed Image recognition's, Image generation's and Web
search's MCP server at 127.0.0.1 even on a magpie shared on the network.
While sharing is on, each address row now has a switch beside it, This
computer and the far address named as the gateway names it (addrWho: Local
network, Public address, On the internet). The far address is the one the
sidebar uses (sideLAN), so MAGPIE_PUBLIC_URL, container and LazyCat rules
carry over; nothing is copied. The pick is kept (magpie.mcpWhere); an app
starts at This computer as before, a page other machines opened (magpie
web) at the far address. Sharing off: no switch, as before. The Library hub
and the plugin tools line follow the pick through mcpAddress (no switch of
their own).

The two image rows moved from app.js into plugins/gateway/settings.js with
the switch; app.js ends smaller, and the core budget is met.

Run on mote at this tree: mcp-address-lan.test.cjs (new, 22 tests: chromium
and webkit, en zh zh-TW ja de, 1100 and 420px) 22 pass; with mcpAddress's
hook removed 11 of 11 chromium tests fail. vision-mcp, image-mcp,
search-mcp, public-url-default and 98 tests in all pass; the lan/mcp/
gateway/settings/search/vision/image GUI subset (122 files, 2181 tests): 2114 pass, 67 fail; the six failing files I reran (side-effort, settings-hints, settings-search, lan-join, images-codex-one, settings-lines-wrap) fail the same 35 tests on a clean origin/main copy, so they are not from this change; filed separately. The other failing files' names were lost to a tail (not reread). go test
./internal/gui (core budget included) ok; go vet darwin, linux nogui,
windows ok; gofmt clean.

Not run at the rebased head: the Go suite beyond internal/gui; the whole GUI suite and go test ./... (mote and mica both held a
GUI suite; queued after the tag). Not tried: a real LAN server. Library
hub address and the plugin tools line show the picked address but have no
switch of their own; they read it when drawn.
2026-11-13 01:02:07 +08:00
yetone 8097860ab1 gui: put back what 76ceff87c took out of main by mistake
76ceff87c was built on an older base and its tree dropped the Linux
backdrop-blur rule (7c37424fc) and Codex seats change (d6b5f24db) with
their tests, docs and history.go edits. This restores those files from
d6b5f24db; the diff against d6b5f24db is now only the hours feature.
Run: git diff d6b5f24db --stat lists the usage files alone.
2026-11-13 01:01:43 +08:00
yetone 76ceff87c9 usage: a number of hours the reader sets, beside the calendar (eachg0 on X)
The range menu behind Custom has a top row, "[N] hours back". Enter asks
the Usage page for the rolling window last:Nh (1 to 720), which the
backend already answers for every view (totals, chart, models, accounts,
Requests); the chip reads "Last 30 hours". The pick and N are kept on this
device (magpie.usagePeriod, magpie.usageHours). 24 stays the preset's
chip, and an empty page, the credit days and the menu-bar way in know the
new period. zh, zh-TW, ja, de strings added.

Run (mote, at the rebased head): usage-hours, usage-24h, i18n-keys in
chromium and webkit, en and zh. Broken by hand: keptPeriod limited to the
presets turned usage-hours red (expected last:30h, got today).
Not tried: the whole GUI suite (queued on mote's suite.lock behind other
sessions, still running), narrow widths by hand, the tray panel (it has no
24h chip and is unchanged).
2026-11-13 01:00:14 +08:00
yetone d6b5f24db5 routing: Codex seats of one name are not folded into one account card (RayYanOnline on X)
The accounts list on the Routing page folded accounts by provider and name, so a Team seat and a Pro Lite login (or two logins) that carry one email read as a single card, and the day's counts of all of them went to it. An account is now told apart by its plan as well: the page's foldActs key and the gateway's tallyKey add the lowercased plan when it has one; a seat with no plan keeps the two-part key, so stored tallies and fixtures are unchanged. The key still ignores the id, which flips between codex and codex@user when the live login switches.

Run (mote): routing-codex-seats.test.cjs, chromium and webkit, en zh zh-TW ja de: 5 of 5 each. Red on the old client.js (4 cards where 3 are wanted). TestTallyKeyTellsPlansApart and the tallies tests ok; go test ./internal/gui ok; go vet darwin, linux nogui and windows ok; gofmt clean.
Siblings: the TUI draws no account names (no Who use in internal/tui); the combo picker names members from groups.accounts, which already carries the backend's distinct names (email · Team, email · workspace).
Not tried: the reporter's real accounts; the whole GUI suite and the full Go suite are run after the tag.
2026-11-13 00:57:33 +08:00
yetone 6edf7a69e5 usage: hide and show single quota rows of an Overview card (wangshaowei39 on X)
Antigravity's card lists Claude & GPT, Gemini and more. A row group can now be
hidden from Usage > Overview the way a card can: right-click or long-press a
row, or use the card's "..." menu, and choose "Hide <group> from Overview". The
"Hidden" line under the cards lists hidden cards and rows with an Unhide button
and Show all. The last group of a card cannot be hidden (use the card's own
hide). Persisted as settings usageWindowsHidden ("<card>|<group>"), changed
through /api/usage/arrange { windowsHidden } and kept by the Settings save.
Table view and tray panel are untouched.

Run (on mote):
- go test: TestUsageArrange*, TestUsageArrangeWindowsHidden (new), TestSettingsSave*,
  settings_keep guard, TestCoreScriptBudget, ./internal/settings, ./internal/settingsapi;
  gofmt clean; go vet darwin, linux nogui, windows.
- GUI, chromium and webkit: usage-rows-hide (new, 5 languages x 1200/560/390;
  32/32), usage-card-more 32/32, usage-arrange, usage-all-accounts 24/24,
  i18n-keys 4/4.
- usage-cards-hide and usage-hidden-way-back: "de 560" red (no sideways scroll
  635 vs 560); the same red on a clean origin/main a5e5f539a, filed as #6294.
Broken by hand: withoutHiddenRows returning its input turns usage-rows-hide
16/16 red in chromium.
Not tried: a real Antigravity account (fixtures only); full suite starts after
the tag.
2026-11-12 23:45:43 +08:00
yetone e18aca1038 agents: an agent's own context window, and a routing group's own Compact at (ul3140773077392, NovaStudiosss on X)
ul3140773077392 on X: dsh compacts earlier than other harnesses at the same
window, so one global size per model fits none. An agent's sheet (Agents,
the agent's Settings line) now holds "Context window": a size for every
model, or model=size pairs (provider/model, group/<id>, provider/*, a bare
model id, *). Empty follows each model's own window. It is applied in
provider.CatalogFor, the choke point every agent's model list goes through,
so dsh's contextWindow, Codex's catalog and Claude Code's window all read
it, and a window set this way makes Codex/Claude compact at that window
(Entry.WindowSet). Stored in settings.AgentContexts, kept by a general
save (settingsapi); POST /api/settings/agent-contexts and
`magpie model window <agent> [model=size...|off]`.

NovaStudiosss on X: Routing, a group's Edit, Advanced already had "Context"
(the window agents are told). It now has "Compact at" beside it
(Group.Compact; compactSet reads it before the members' smallest), also
`magpie group ... compact=`.

GUI: agentwindow.js, loaded on demand through agentcompact.js so app.js
stays inside its budget (TestCoreScriptBudget passes; the "Context window
in {agent}" label reuses the existing "Context window" key). Every agent
with fields now has a sheet; agent-prefs' Pi expectation says so.

Run at the pushed head, on mote: go vet (darwin; linux -tags nogui;
windows) on provider, agent, cli, gui, settings, settingsapi; gofmt clean;
go test provider, cli, settings, settingsapi, gui (TestCoreScriptBudget
and cli's route table fixed here), agent -run Dsh; node --test agent-window
and group-compact (chromium and webkit, en zh zh-TW ja de, 900 and 420px),
agent-compact, agent-prefs, compact-at. Reds seen identically on a
detached origin/main 4e0026661: agent-prefs webkit "in the panel a
Settings line..." (#6139) and old-webkit "compat.js is the first" / "styles
hold up in Safari 15.0" (#5919, #3403).

Broken by hand, each red then restored: withAgentWindows out of CatalogFor
(TestAgentOwnContextWindow, TestDshOwnContextWindow); the group branch in
compactSet (TestGroupOwnCompactAt); the settingsapi keep line
(TestSettingsSaveKeepsWhatItDoesNotSend); the window row in the sheet
(agent-window tests); compact dropped from the group save
(group-compact tests).

Not tried: a real dsh with a real account (its compaction is dsh's own;
the test reads the window magpie hands it), the full GUI suite (queued
behind another run on mote), Windows and Linux runs of the new tests.
2026-11-12 23:01:29 +08:00
yetone 5a3d73039a sessions: a conversation opens in a sheet with turn, top and bottom navigation (Wing8Aqua on X)
Show conversation (and a subagent's row) used to unfold the whole
conversation inline in the row, which is very long. It now opens a sheet
(the modal framing the Library uses): the head counts the user's turns
("3 / 12") and has Top, Previous turn, Next turn and Bottom, like DSH's
viewer; the text scrolls inside the sheet, never the page; Close and
Escape end it. A recording cleared while a sheet is open redraws it from
the cleared state. Buttons answer in 100ms with the strong ease-out
curve, scale(.97) on press, hover gated to fine pointers; the sheet
itself keeps the modal's existing entrance.

Ran on mote: new sessions-talk-sheet (8 turns of 30 lines; counter, prev,
next, top, bottom and their disabled states, no page scroll, 1000 and 390
wide, Escape, reopen) in chromium and webkit, en zh zh-TW ja de: 10/10.
sessions-*, gateway-conversations, i18n*, modal*, inner-scroll-contain and
click-scroll GUI files: 725 pass, 0 fail (sessions-talk, sessions-subagents,
sessions-talk-model and gateway-conversations moved to the sheet flow).
go test ./internal/gui (core script budget included) ok; gofmt clean; go
vet darwin, linux nogui and windows ok.
Broken by hand: scrollTo removed from the jump: new test 0/10.
Not tried: the real Ubuntu app of the report (WebKitGTK); only Playwright's
chromium and webkit. Full suite runs after the tag.
2026-11-12 18:49:32 +08:00
yetone 2a1111cbab library: an agent's profiles are one chip on a row, picked in the app menu (Yanzhongixuy on X)
With several Hermes profiles the Library listed each as its own icon on every
skill/MCP row (~20 identical glyphs). Profiles of one agent family
(hermes#, omp#, claude#, qwenpaw#, WSL variants too) now collapse into one chip
with a count; a click opens the app menu (openProtoMenu, multi-tick, live) to
pick profiles one by one. All still toggles every profile. Rows only; the
By agent view is unchanged. Other multi-profile agents (omp, claude, qwenpaw)
had the same problem and go through the same code.

Run on mote at the branch head: library-profile-chip.test.cjs (new, 12 cases,
chromium + webkit, en/zh/zh-TW/ja/de), red 12 of 12 with profileChip broken by
hand; library-*, group-skill-chips, skill-*, mcp-*, i18n-*, hermes-*, omp-*,
project-* GUI files: all green except library-loading (Claude plugins tab,
already #6204) and one webkit billion-context card case that passed alone
(load flake).
Not tried: a real Hermes install with 20 profiles, Linux WebKitGTK.
2026-11-12 17:57:13 +08:00
yetone cfd3367df8 usage: a request's details show its service tier (JackyFill on X)
The ledger has kept each call's service tier since #1784 (tier_asked,
tier_sent, tier_served in the log, the CSV and the JSON), but the
Requests page never showed it. A request's details now have a Service
tier line: "asked X", then "sent Y" only when it differs, then
"answered Z" only when the reply named a tier. A call with none shows
no line. Row flag bits are untouched: the tiers are string slots, so no
bit is taken.

Run, on mica: new ledger-service-tier.test.cjs (3 rows: all three tiers,
asked+sent without an answer, none) in chromium and webkit, en zh
zh-TW ja de, 12 of 12 green; with the add("Service tier") line removed
by hand it is 0 of 12; i18n-keys caught a duplicate "Service tier" key
(the core table already has all four languages), which is removed;
ledger-*, i18n-keys, i18n-en-no-cjk and gui-* files rerun green after
(ledger-cache-hit chromium was red once in the first batch, green on
rerun in the same batch's second run).

Not tried: a real Codex priority call end to end (the gateway side is
#1784's); the full suite runs after the tag.
2026-11-12 17:22:03 +08:00
yetone 223b57ffa3 gateway: a turn waiting for its account's turn near a usage cap says queued, not routing (tmr11235 on X)
tmr11235 (Pi, Codex subscription, gpt-6.1-sol): the second request sat in
"routing" until the one before it was answered. Two Pi turns at once on a
Codex sign-in are both out at the vendor at once (HTTP and websocket
upstream, TestPiTwoTurnsOnCodexAreOutTogether, green on the old code too),
and no concurrency cap is set for Codex by default. What does hold a
second turn is an account within 5 points of a usage cap the user set
(nearCaps, one turn at a time). That wait comes before the first try is
begun, so the row had no try and read "routing", and the wait wasn't a
known one for the unrouted watch either (it could end the request as
unknown after 30s).

The wait now sets the route's Phase to "queue" and the request's phase
(notePhase, so it is a known wait). The Routing page says "queued…" and
its explanation says what it waits for, in en, zh, zh-TW, ja, de.
The one-turn rule itself is unchanged: it protects a cap the user set.

Run (mote): TestNearCap*, TestNearCapWaitSaysQueued, TestPiTwoTurns*,
go test ./internal/gui, routing-queued/routing-masking/routing-wait-dot
in chromium, routing-queued in webkit, i18n-keys, i18n-en-no-cjk, gofmt,
go vet darwin/linux nogui/windows of internal/gateway.
Broken by hand: showQueued replaced by a no-op, TestNearCapWaitSaysQueued
red ("never: the waiting turn's route says queued").
Not tried: a real Codex account near a real cap; full suite is started
after the tag.
2026-11-12 16:02:11 +08:00
yetone 0af73f42b4 gateway: an app update asks its own background service to restart, and the page no longer calls it another program (Norethcy on X)
After an app update the service (`magpie daemon`, ~/.local/bin/magpie)
ran on as the old version until its own look at the disk found the gateway
idle, and `magpie daemon restart` by hand showed the app "Port 3425 is in
use by ~/.local/bin/magpie (pid N): quit it" while the new service came up.

- PortHeld.Own: a holder that is a magpie running this install's program
  (same file, symlinks followed) is marked; the Gateway card then says
  "Starting the gateway…" instead of the port-in-use error.
- The app asks an older service of its own install (the pid the service
  manager reports, program from the unit/plist: daemon.Program) to restart,
  once per process, through gateway.RestartPath, as `magpie update` does:
  it restarts into the new version once idle, bounded by its drain, under
  the same service manager.

Run on mote: go test of the new tests in internal/gui, internal/daemon,
internal/gateway; go vet darwin, linux nogui, windows; gofmt; gateway-*
and i18n GUI files in chromium and webkit. Broken by hand: dropping the
Older check makes TestNudgeAsksOwnOlderDaemonOnce red.
Not tried: a real app update over a real launchd service. The restart is
an in-place re-exec of the service, not a socket handover, so the port is
closed for the service's start-up.

GUI (mote, chromium+webkit): gateway-port-holder, older, skew, takeover, port, i18n-keys, i18n-en-no-cjk 36 of 36 ok. All gateway-* files: 30 reds, all in gateway-card (shares on the network, #6267) and gateway-key-arrange (420px, #6268); the same 30 with client.js reverted to origin/main, so not from this change.
Not tried: a real app update over a real launchd service; the daemon re-execs in place, it is not a socket handover.
2026-11-12 12:50:57 +08:00
yetone 1e2857730a routing: a group's right-click menu has Remove (jimlee0824v2 on X)
Remove was only at the foot of the expanded card. The row menu now ends with
it, set apart, running the card's own groupAction("delete"): the same
question first, the same groups/delete call.

Run (mote): group-menu-remove (new, 10 tests: chromium and webkit, en zh
zh-TW ja de; cancel posts nothing, confirm posts groups/delete and the row
goes), group-share, group-duplicate, i18n-keys, i18n-en-no-cjk: 38 of 38.
group-*, route-menu-pointer, click-scroll and panel-routing* run next.
Broken by hand: with client.js at HEAD the new test is 0 pass, 10 fail.
Not tried: the real app; the item reuses "Remove", already in every language.
2026-11-12 10:30:41 +08:00
yetone c14fa0ce93 Bring back 919780414 and 88d2962e0, which 698ed4adb undid
698ed4adb (a busy port names its holder) was committed from a tree made
before 919780414 and 88d2962e0 landed (09:38, eight minutes before it),
and took both out with no word in its body: quotatable.js, the Usage
Cards / Table switch and its test, and sessions' 16-byte head and
prefix hashes (digest.go) were gone from main from v0.1.3823. This puts
both back as they were, on top of 698ed4adb's own change, which is kept.

Run at this tree, on mote (cherry-pick of both onto origin/main
db0c1b039, no conflicts):
- gofmt -l internal/sessions: clean.
- go vet ./internal/sessions ./internal/gui; GOOS=windows and
  GOOS=linux -tags nogui go vet ./internal/sessions: ok.
- go test -count=1 ./internal/sessions: ok 83.6s.
- go test -run 'Budget|Lazy|I18n' ./internal/gui: ok (the core script
  budget holds with both changes).
- GUI, chromium and webkit: usage-quota-table, gateway-port-holder,
  i18n-keys, i18n-en-no-cjk, old-webkit: 44 of 46. The two reds are
  old-webkit's "compat.js is the first" (headerpresets.js, #6030) and
  "the styles hold up in Safari 15.0" (#5919), red the same on an
  origin/main db0c1b039 copy.
Not run: the full Go and GUI suites.
2026-11-12 09:57:52 +08:00
yetone 698ed4adb5 gateway: a busy port names the program holding it, and Tailscale's serve gets its fix (pluoki on X)
The Gateway page, `magpie serve` and the app log said only "port N is held by another program". pluoki's was `tailscale serve` on the same port number.

proc.PortHolder reads the holder (lsof on the Mac, /proc on Linux, Get-NetTCPConnection on Windows). Tailscale's daemon is root's and often unreadable, so `tailscale serve status --json` is the fallback for the port. gateway.NoteHeld / PortHeld.Sentence say who holds it, and for Tailscale give `tailscale serve --https=<other> http://127.0.0.1:<port>`. Shown in the `magpie serve` standby line and bind error, the app log, `gatewayHeld` in /api/state (Gateway page) and Start's "taken" answer, in en, zh, zh-TW, ja, de. A holder that can't be read says nothing; the old wording stands. Nothing is killed or touched.

Run: gofmt clean; go vet darwin, linux nogui, windows (mica); go test ./internal/proc ok; targeted holder/gateway tests on macOS (mica), Windows (win-run) and Linux (wsl-run); parser tests with real lsof output; GUI gateway-port-holder, gateway-takeover, gateway-older, gateway-skew, gateway-port, i18n-keys, i18n-en-no-cjk in chromium and webkit. Real run on WSL: a holder named tailscaled on the LAN address with magpie on 0.0.0.0 gives the Tailscale sentence at the bind error; a Python holder on loopback gives "held by python3.12 (pid N)".
Broken by hand: each fix reverted in turn, its test went red.
gateway-card.test.cjs is red on origin/main too (#6029). internal/gateway, gui and cli package runs were still going at push; the full suite follows the tag.
Not tried: a real `tailscale serve` (changes live config), a real Windows holder end to end, the bind-error path on macOS (a wildcard bind coexists with a specific one there).
2026-11-12 09:46:34 +08:00
yetone 9197804144 gui: Usage allowances can be shown as a table beside the cards (zysicyj on X)
With a dozen accounts the packed card grid is hard to scan. The Usage
page's Allowances header now has a Cards / Table switch (a segmented
control, remembered per user in localStorage "quotaView"; the default stays
Cards, and nothing is written until the user picks). The table has one row
per account: subscription, account, then the four most common windows
(used % with a bar and the reset time), an Other column for extra windows
and balances, sortable by any column (click again to reverse, a third
time to clear; rows with no value stay last). Balance-only and error rows
span the window columns. Same data and helpers as the cards (quotaFill,
resetClock, quotaWho). At narrow widths the table box scrolls, not the page.

The code is a lazily imported quotatable.js, so app.js stays inside its
code budget. "Cards" and "Table" are translated in zh, zh-TW, ja and de.
quotatable.js is listed in old-webkit's lazy-script exceptions;
docs/subsystems/gui-shell.md has a paragraph on it.

Run (on mica/mote, Playwright): the new usage-quota-table.test.cjs, 22 of 22
in chromium and webkit, in en/zh/zh-TW/ja/de, at 1100px and 420px (14 faked
accounts: default is cards and saves nothing, row count and figures,
persistence across reload, sort cycle and account sort, no page overflow,
back to cards). TestCoreScriptBudget, i18n tests 8/8, gofmt, go vet for
darwin, linux -tags nogui and windows. Whole GUI suite (make test-ui)
at 1ad0f4cc4+this: started before the tag; first 890 results green except account-arrange (#6010, red the same on origin/main).

Broken by hand: with the default flipped to table, 10 of the new tests
failed; restored.

Not tried: the real app, Linux WebKitGTK, a real account's data (the
fixtures are faked, with the shapes the cards read).
2026-11-12 09:38:54 +08:00
yetone 908c9986cd templates: routing recipes — Plan first, Fastest first, Spread evenly (qhyqhy1s on X)
qhyqhy1s asked for best-practice templates in routing groups, as only
three were offered. The Routing page's template cards and Templates menu
(and `magpie group template`) now carry three more, each only a setting
the engine already has:

- Plan first (plan): the strongest model of up to three providers, the
  ones billed by a plan (Provider.BillingKind) ahead of pay-as-you-go
  ones. Not made when no provider is on a plan (NeedPlan).
- Fastest first (fast): the same members, routing "fast".
- Spread evenly (even): the one strongest model from up to four providers
  that serve it, routing "rotate" over all their keys and accounts.

Names, one-line descriptions and the new "Needs a subscription or token
plan" are in zh, zh-TW, ja and de. docs/subsystems/gateway-routing.md has
a Routing recipes section.

Run on mote at the pushed tree: go test ./internal/provider ./internal/cli
./internal/gui (Template|SizeOf|Group) ok; gofmt -l clean; group-template,
getting-started, i18n-keys and i18n-en-no-cjk GUI files, 98 tests, chromium
and webkit, 420px, every language, ok. Broken by hand: routing left unset
on Fastest first, TestRecipeTemplates red. Not tried: a real account
adding each template; the full GUI and Go suites are started after the tag.
2026-11-12 08:34:38 +08:00
yetone 40c8d0c81a routing: an account whose windows are all set aside shows what the Usage page read, not "not known" (@apple_test_src on X)
A Cursor account signed in through its plugin (pooled plan, or on-demand
or free credit that can pay) sets every window aside, since none can stop
the account. Routing's allowance then holds no figure for it, so the
Accounts and keys row (and the stage row) said "what's left not known
yet" while the Usage page showed its percentages. This is true of any
plugin-served subscription that sets all its windows aside, not only
Cursor.

Both Routing rows now say the card's first window (as Usage read it) when
routing has no figure, the rest on hover; with no card the unknown line
stays. Display only: how accounts are weighed is unchanged.

Run: new routing-pooled-card.test.cjs (5 languages, 1100/420px, chromium
and webkit) 22 pass; red 22 of 22 with client.js put back to origin/main's
(broken by hand). Routing, i18n-keys, use-first, account-mask and
codex-credits GUI files on mote: the only reds are in routing-context-fold,
routing-pin-away, routing-row-swap, routing-story-shrinks, many-keys and
accounts-narrow; the first four fail the same on the origin/main client.js
(umbrella #4494, #5475).
Not tried: a real Cursor account; the Go suite starts after the tag.
2026-11-12 03:51:33 +08:00
yetone 4b29709eca gui: Standard speed is one word, in the core strings; the routing plugin's copy is gone (#6206)
a5e805f57 added the core string for Model settings while the routing plugin
already had it, so i18n-keys failed "no language has a key twice" and "a
plugin's words are its own". The plugin reads core words, as it does Fast and
Ultrafast.

Run on mica at the rebased head: i18n-keys and i18n-en-no-cjk 8 of 8 from the
repo root (red before: 2 of 8). Chromium and webkit: model-speed, group-*,
routing-group*, routing-save*, routing-js, i18n-*: 775 of 778; the red are
group-editor-selected (#5049, red on a clean main) and i18n-keys' "a plugin's
words are its own" when run with -C internal/gui, where the test's repo root
becomes mica's home and it reads another session's run copies (the same file
passes from the repo root); not a code red.
Not tried: the full GUI suite.
2026-11-12 02:45:22 +08:00
yetone a1a3b6fadb library: DeepSeek Harness folds its context with billion-context through its /bili/ prefix (VantH_off on X)
VantH_off asked for DeepSeek Harness in billion-context's support.
Library's billion-context tab offered Pi, omp, OpenCode, Claude Code, Hermes
and Zed. bili's dsh route is `dsh plugin add billion-context` (billion-context
0.1.213 README), which loads in dsh's process and takes traffic by proxy
settings; magpie's dsh route is baseURL http://127.0.0.1:3425/v1, plain http
on loopback, so that never sees it and the plugin would add tools and fold
nothing (the Hermes case, 00e8242e8). dsh's route baseURL is editable, so it
takes the route Zed and Hermes take, bili's documented /bili/ prefix.

Turned on, magpie runs `bili start --port 8787` and writes magpie's route
baseURL in every dsh profile and the home layer as
http://127.0.0.1:8787/bili/<gateway>/v1 (Anthropic route: no /v1)
(agent.DshThrough: dshSyncFresh with the prefixed gateway). dshReach reads the
prefix back from the profiles' routes (loopback path before the gateway's
address) and Check, Sync, a pick and the serving round (dshWiredWith, which
read gateway.URL() directly) keep it; an address that isn't a local proxy's
goes back to the gateway. Off writes the gateway back. Empty-list string (en,
zh, zh-TW, ja, de), docs (en, zh, ja), llms-full.txt and
docs/subsystems/library.md name dsh. bili's dsh plugin installer is never run
for it. The remaining agents are #5915.

Run (mica, at the pushed head unless said):
- TestDshThroughBili, TestBiliDshThroughPrefix: ok
- see below for the packages and GUI files
Broken by hand:
- dshReach returning gw: TestDshThroughBili red (a sync drops the prefix)
- no "dsh" URL lane: TestBiliDshThroughPrefix red (dsh not offered)
Not tried:
- a real dsh and a real `bili start`; tests fake bili and the probe, so
  whether dsh's SDK sends to the prefixed address is by analogy with Hermes
- Windows run (vet only)
2026-11-12 02:24:10 +08:00
yetone e6bf4adf1f usage: Claude Code's helper requests are labelled, the largest cache write is one click away (recih on X, #6199)
Claude Code's AgentSummary and its auto mode classifier name themselves
nowhere in the request, so there is no client marker to read. The gateway
tells them by their content (inferredKind: a claude-cli/ request on the
Messages API; the classifier by autoModeClassifierAsk, the summary by its
last user text "Describe your ... in 3-5 words") and records them as
agent_summary_inferred and auto_mode_check_inferred. The purpose catalog
names them "Progress summary (inferred)" and "Auto mode check (inferred)"
and puts each with its plain kind's purpose, so the existing Purpose filter
lists both; nothing known and nothing inferred share a name. A tool that
printed the same words, a chat, and another agent's request stay unmarked.

A requests page now also holds BigWrite, the gateway-served row that wrote
the most to the cache (cells, page-v1.json and pageFromLedger all carry it;
rows from session files have no request to open). The Requests line shows
it as "109K largest write", a button that opens that request through
openUsageRoute. settledCountVersion is raised to 3, which keys the cached
pages.

Not done: the per-request branch recovery result asked for in #6199. No
structured field holds it.

Run on mote (load 21-24 of 18 cores, mica was higher): go test ./internal/usage
./internal/usageapi, the gateway and gui purpose tests, go vet for darwin,
linux (nogui) and windows, gofmt; the GUI files usage-big-write (new),
purpose-filter, routing-kind, i18n-keys and usage-ledger in chromium and
webkit. Broken by hand: inferredKind returning "" turns
TestClaudeHelperRequestsAreLabelled red; the larger-than test of BigWrite.add
turned round turns TestRequestPageBigWrite red on both paths; the jump off
turns usage-big-write red. Not tried: a real Claude Code session against a
live subscription, Linux WebKitGTK.
2026-11-12 02:01:31 +08:00
yetone e174b55150 library: a Variables tab gives environment variables to Claude Code and Codex (paopao_baobao on X)
An environment variable is kept once in the Library and written into each
agent picked: Claude Code's settings.json "env", Codex's config.toml
[shell_environment_policy.set] (a sub-table or inline set is edited; a
dotted spelling is refused). It follows Hooks: Applied.Env records what
magpie wrote, so turning it off or removing it takes out only that, and a
value the user set or changed in the file is never overridden (a conflict
is a problem on the row). An unreadable file is an error, nothing is
written. The tab has name, value and agent chips, an edit sheet and a
row Remove with a confirm; its sidebar entry is in "Every agent". Not
carried in backups, as hooks first were. docs/subsystems/library.md updated.

Run (mica, sandbox HOME): internal/library and internal/gui go tests ok;
gofmt clean; go vet darwin, linux -tags nogui, windows clean; GUI
library-*, i18n-* in chromium and webkit (en, zh, zh-TW, ja, de, 440px):
all green except "the Library while it loads", red on the merge base too
(not from this change). Existing tab-list assertions in library-hooks,
-subagents, -groups, -loading now include Variables.
Broken by hand: syncEnv overwriting the user's value turns
TestEnvNeverOverridesTheUsers red.
Not tried: real Claude Code / Codex reading the written env; other agents
(Gemini .env, Qwen, Droid); WSL; env in backup carry.
2026-11-12 02:00:19 +08:00
yetone a5e805f574 Codex: Ultrafast beside Fast in a group member, and a Fast/Ultrafast setting per model (kdajenks on X)
kdajenks (magpie 0.1.3739, Codex on ChatGPT Pro) could set Fast only from a
routing group's member row and had no Ultrafast there, and no way to set the
speed in the model's own settings. Ultrafast exists: Codex's catalog lists
the `ultrafast` service tier, the code already sent it for agent picks and
Codex's service-tier row, and the live account's service_tiers hold it.

- Group member: the button steps Standard speed, Fast, Ultrafast (where an
  account offers it, `ultraOK`), back to Standard. `Group.Ultra` is a subset of
  `Fast`, kept through rename, fold, share, gone-filter and the CLI
  (`magpie group ... ultra=`). The gateway marks the candidate `ultra`.
- Per model: `settings.ModelTiers` ("<provider>/<model>" to priority or
  ultrafast), `provider.SetModelTier` (refused where CanFast/CanUltra say no),
  `ModelPref.Tier` in Model settings (Standard speed / Fast / Ultrafast, in
  modellimits.js), and `magpie model tier <provider/model> [fast|ultrafast|usual]`.
  The gateway sends it on a direct pick for an agent with no fast pick of its
  own, through fastPick, so an account without Ultrafast gets priority. A group
  member goes as the group says.
- Docs: gateway-routing, providers-accounts, reference.

Run (mica, at the rebased head over a6d84e13a):
- gofmt -l clean; go vet darwin, linux nogui, windows clean.
- go test internal/provider, internal/settings ok; internal/gui and
  internal/cli ran: the one red of mine (TestSettingsSaveKeepsWhatItDoesNotSend
  wanting ModelTiers) is fixed in this commit; the others are not mine and
  red on a clean origin/main: TestEveryRouteHasACommandOrIsNamed (#6202),
  TestPanelHiddenByWailsMarksPageOutOfSight (#6203, not checked on main).
- internal/gateway ok (984s).
- GUI, chromium and webkit: new model-speed.test.cjs (30, five languages, 1200
  and 420px), plus model-*, group-*, fast-*, i18n-*, text-size,
  codex-service-tier, panel-*, routing-group*, routing-save* files. Red and not
  mine, same on a clean origin/main worktree: fast-pick and fast-ultra (#6201),
  group-editor-selected (#5049).
- New tests TestModelTierSentToEveryAgent, TestGroupMemberUltrafast,
  TestCleanModelTier, TestSaveGroupUltra.

Broken by hand: removing the gateway's model-tier branch and the candidate
`ultra` copies turned both gateway tests red; turning off the Ultrafast choice
in Model settings turned 20 of 30 GUI tests red; reverting the member button to
two states turned 10 of 30 red.

Not tried: a real ChatGPT account sending Ultrafast through the new setting;
the agent picker's bolt does not show a model-level default; Windows and Linux
GUI runs.
2026-11-12 01:56:26 +08:00
yetone 319753d892 gateway: a key can follow, force on or force off masking (y0ngb1n on X)
A gateway key now carries Redact: "" follows the global setting, "on"
masks that key's requests even when masking is off, "off" sends them as
written. Trusted devices turn it off, external ones are forced on.

- access: Key.Redact, CleanRedact and the redact-key action; an issued key
  inherits "on" from its issuer and can't turn it off; the default key
  takes the same values.
- gateway: maskingFor(ctx) decides per request; every route that masked
  (chat, native, text hits, the Masked-As header) asks it. A local request
  with no key keeps the global setting. masking.WithForced carries "on"
  into the masker; the redact plugin's InUse counts keys set on.
- CLI: magpie gateway keys redact <key> follow|on|off.
- GUI: key-row badge and an app menu; 7 strings in zh, zh-TW, ja, de.
- docs/subsystems/gateway-routing.md: the Redact paragraph.

Note: "on" with global masking off masks secrets and personal data by the
defaults. An off key is still masked on a Remote magpie hop, which sends no
Masked-As header.

Run (mote-run): go test for access, masking, redact, cli, gui and
plugins/redact packages and the new gateway key_redact tests; gofmt -l and
go vet on darwin, windows and linux nogui, all clean; the new GUI test.
Broken by hand: maskingFor returning the global value goes red in
key_redact_test.go.
Not tried: a real remote-to-remote hop with two keys; the full suite runs
after the tag.
2026-11-12 01:01:32 +08:00