Commit Graph
2284 Commits
Author SHA1 Message Date
yetone f5e1b10913 settings: longest context can hold a model's own window too (WJaunita45604 on X)
v0.1.3681's Longest context left a window the user set for a model, or "*"
on its provider, alone even when longer. Settings > Models > Routing now has
a menu beside the field: "Models without their own" (the default, as before)
or "Every model". In both modes the shorter of the cap and the user's own
window is told; they differ only when the user's own is longer (own keeps it,
every model brings it down). Settings.ContextCapAll, Settings.CappedOwn,
POST /api/settings/context-cap-mode {all}, magpie model context-cap all|own.
Applied in provider.windowIn (so /v1/models, catalogs, compaction), Codex's
CodexNativeWindow/CodexWindow (the list's ETag tag carries the mode) and the
gateway fallback window. i18n in zh, zh-TW, ja, de.

Run (wsl-run, mote's disk was full): provider (full), settings, settingsapi,
codexcat packages; cli -run ContextCap; gateway -run ContextCap|ModelsList;
GUI context-cap, i18n-keys, model-load, settings-places, settings-general in
chromium and webkit; TestCoreScriptBudget; gofmt; go vet nogui and
GOOS=windows vet. Broken by hand: windowIn's CappedOwn removed turns
TestContextCapAllHoldsTheUsersOwnWindowsToo red.
Not tried: the whole Go and GUI suites, a real Codex reading the list, macOS
or Windows runs, GUI in zh-TW/ja/de beyond the i18n-keys check.
2026-11-11 14:28:17 +08:00
yetone a46c90e7c3 providers: a key's usage cap is set from its row, as an account's is (@wanggenjidev on X)
GUI half of the previous commit; same pill and words as the account cap. key-usage-cap.test.cjs passes in chromium and webkit, en zh zh-TW ja de, 900 and 400px.
2026-11-11 14:18:11 +08:00
yetone 465e9f721f gui: library-bili waits for the sidebar's sections before it picks a tab by place
The sidebar list is drawn once in the strip's order and again in sections
once navicons.js is loaded; Pi packages then sits before RTK, so a click by
an index read before the redraw landed on another tab.

Run: library-bili and library-groups on Windows (xiaomi-gpu), Chromium and
WebKit: 100 of 100. Red before this wait in WebKit on mote, 2 of 4 cases.
2026-11-11 13:53:34 +08:00
yetone 29d37b4a6c gui: Library's sidebar list is in sections: every agent, one agent, magpie (@ConatusMoon2222 on X)
The list under Library in the sidebar was one flat column mixing what every
agent shares, what one agent has and magpie's own add-ons. It now has three
quiet section names, as a Mac source list's: "Every agent" (Instructions,
Memory, MCP servers, Skills, Hooks, Subagents), "One agent" (Claude plugins,
Pi packages) and "magpie" (RTK, billion-context). Same pages, same strip,
same routes; the page's own strip is unchanged. A section with no tab showing
has no name, and a list of one section (agentless) has none at all. The names
are said in zh, zh-TW, ja and de ("One agent" is new; "Every agent" was
already there); no colour, no gradient, no border.

The grouping and the sort live in navicons.js (loaded with the first list,
which then draws again), so the core script budget holds; a few navSubs
comments were cut for the bytes.

Run:
- library-groups.test.cjs (new): the three names and the rows' order in en
  zh zh-TW ja de, no names in the strip, a name is no tab, quiet style, a tab
  still opens, hidden-only section loses its name, one section none, 420px and
  dark: Chromium and WebKit, 16 of 16 on mote before the rebase, 100 of 100
  with library-bili on Windows (xiaomi-gpu) after it, and with sidebar.test.cjs
  on WSL.
- Broken by hand: names always shown made the hidden-section case red in both
  engines.
- go test -run Budget ./internal/gui: ok before the rebase.
- Screenshots zh light/dark at 900 and 420, before and after, in
  magpie-wt/library-groups-scratch/shots.
- Wider sidebar and library set on mote: 302 of 304; the 2 reds were
  library-bili in WebKit, a click by an index read before the redraw
  (fixed in the next commit). mote could not launch browsers afterwards.

Not tried: the whole GUI suite (mote refused connections and then browser
launches for hours; run after the tag), the real Linux WebKitGTK app.
2026-11-11 13:53:34 +08:00
yetone 61a04f42a2 library: a project's Skills menu groups the skills by source, a heading ticks the whole group (Elorynth on X)
The project card's Skills menu listed every library skill flat. It now
lists them as the Library does (skillGroups(true): by repository or the
user's own group, this computer's last, whatever sort the list has), with
a heading over each group. Pressing a heading ticks all of the group's
skills, or unticks them when all are in; it is half-ticked while some are.
A typed filter keeps a group's heading over the skills it finds, and
matches a skill by its group's name. One group only stays the flat list.
openProtoMenu takes a `group` option (the values it ticks) for this.
Paid for in app.js by five comments cut, no budget raise.

Run on the Windows box (mote's Chromium launch hung, SSH refused at
times): project-skills-groups.test.cjs, new, in chromium and webkit,
en/zh/zh-TW/ja/de at 400px wide: red on the old code (6 of 6), green
after. With project-*, i18n-*, menu-*, proto-menu-overflow and
skill-group* GUI files in both engines: all green except
menu-input-scroll and menu-scroll (14 chromium, 13 webkit), which are
red the same at origin/main aa2ea5c90 on the Windows box (commented on
#3402). TestCoreScriptBudget ok at the rebased head.
Not tried: the full suite, the real Linux app (WebKitGTK). Part 2 of the
report (instruction presets bundled into a toolkit) is not built: a
project has no instructions of its own yet.
2026-11-11 13:31:23 +08:00
yetone b39a793c98 codex: the Codex app, left showing fewer projects after a switch while it ran, says to quit and reopen it (linsm66 on X)
"为什么codex在触发自动更换账号后侧边栏已有的项目文件夹会消失呢".

v0.1.3600 (10bef5fe0) shares every account's projects while the Codex app
is closed. A switch while the app runs can't be helped by a file: the
app (ChatGPT.app 26.1103, early-bootstrap-133 selectRendererOwner, run on
every principal change) parks the old identity's projects and loads the
new one's from memory, and writes its memory over the file. An app open
since before the sharing, or a project added since it was last closed,
shows the new account's empty list. magpie does not quit the app unasked
(15acba534, 248268ce4); the owner chose a hint instead.

codexProjectsLook, from codexProjectsStep's loop while the app is open,
reads the state file: the owner's local projects' folders against those
parked under the other identities. When the owner changed since the last
look and the owner lacks a folder, /api/providers says codexProjects, and
Codex's accounts show "The Codex app shows fewer projects than you have:
quit and open it again" (Got it hushes it; dismiss-projects). A project
removed on the account the user is on is no switch and says nothing. A
closed app clears it: the share runs and the app loads every list as it
opens. The notice is in codexprojects.js, loaded when the state says so,
so the core's budget is unchanged. i18n in zh, zh-TW, ja, de.

Run (mote refused ssh all session; so wsl-run on the Linux box):
- go test -tags nogui -run 'TestCodexApp|TestCodexProjects' ./internal/provider: ok.
  TestCodexAppProjectsShortAfterALiveSwitch drives the repo's app
  simulator through a live switch to an unshared account and, after
  shareCodexProjects, to a shared one. Broken by hand (every look counts as
  a switch) TestCodexAppProjectsRemovedByHandIsNoHint went red.
- node --test codex-app-projects-short.test.cjs (new), codex-app-stale,
  i18n-keys, i18n-en-no-cjk: all pass, chromium and webkit, 5 languages,
  900 and 480px (70 tests for the first two).
- TestCoreScriptBudget ok; gofmt clean; go vet -tags nogui and GOOS=windows
  of internal/provider and internal/gui ok.
- old-webkit.test.cjs: "compat.js is the first of the page's own scripts"
  and "the styles hold up in Safari 15.0" are red on origin/main
  4ddc150c6 too, same names. GOOS=darwin vet of internal/gui fails at
  traywindows_darwin_test.go:30 (trayImagePNG) on origin/main too, from
  WSL without cgo.

Not tried: the real Codex app switching live (the simulator follows the
bundle's selectRendererOwner, not a launched app); the whole GUI suite
before the push (started after the tag); mote.
2026-11-11 13:26:49 +08:00
yetone 4ddc150c66 gui: a hover hint beside the account switch says how it works and why it is the agent's own use
The owner (11-11): "在这个切换开关旁边有一个 hover 的提示,提示这个原理是啥,
以及它为什么不会让你的账号被封禁". Beside Switch {agent}'s account
automatically, an ⓘ mark; resting on the row (or a key reaching the
switch) shows settingshints.js's card with three lines:

- how: the next account's sign-in is written where the agent keeps its
  own, as /login or codex login does; what is left is read by Claude
  Code's own /usage, or where Codex's /status reads it; sessions already
  open keep their account until restarted;
- why it is the agent's own use: Claude Code still sends every request
  itself, straight to Anthropic, unchanged, and magpie sends none (an
  account's own proxy kept); for Codex, only which of your own accounts
  it is signed in to changes;
- the limit: the same as switching by hand; use only your own accounts,
  sharing one is against the vendor's terms. It promises nothing about
  bans: that is the vendor's call.

Only where the switch moves the sign-in. Under the gateway it moves
Claude Code's requests instead, and the "straight to Anthropic" line
would be false, so SignInMovesOf now says `routed` on a kept Claude
whose requests go through the gateway, and the hint shows for `moves`
and for `kept` without it.

The lines and mark are in autoswitchtip.js, imported when the switch is
drawn; app.js gets the one import line, paid for by cutting this branch's
own two comments: the core is 1,533,771, under 1,533,802, no raise.
Strings in zh, zh-TW, ja and de.

Run (xiaomi-gpu, Windows 11, win-run; mote refuses ssh):
- node --test sign-in-moves, keep-login, pool-ends, old-webkit, i18n-keys,
  i18n-en-no-cjk, settings-hints, editor-hints: 148/152. The 4 reds are
  the same at the base 156861b3a: old-webkit's headerpresets.js (#6030)
  and Safari 15.0 :has() (#5919), and settings-hints webkit de at 420px,
  filed as #6073.
- the new test (Chromium and WebKit, en and zh): the mark sits beside
  the switch on its line, the lines rest out of sight, hovering shows the
  card with the three lines beside the row, a press on the mark posts
  nothing; no mark for kept+routed or gateway.
- Broken by hand, each red: the mark's preventDefault removed (a press
  turned the switch off); the routed check dropped (kept+routed showed
  it); Routed not set in SignInMovesOf (TestSignInMovesSaysWhatSwitchDoes).
- go test -run "SignInMoves|ClaudeRoutedSignIn|KeepLogin|SwitchOnly"
  ./internal/provider ok; go vet ./internal/provider ok;
  TestCoreScriptBudget ok; gofmt -l clean.
- A Chromium screenshot of the card in zh looked at.

Not tried: the Codex variant's card in a browser (its strings pass
i18n-keys); the real app; macOS and Linux.
2026-11-11 13:05:16 +08:00
yetone fc24a89183 gui: switching the agent's account is a switch of its own
The owner (11-11): "这个轮换做成一个开关". The used-up switch was off
behind a "Keep Claude Code signed in to" tick box, and the tick box read
as something else. Under the accounts of a Claude Code or Codex with
more than one account there is now a "Switch Claude Code's account
automatically" switch:

- on: the line from the previous commit sits under it, saying when the
  sign-in moves and whether it comes back;
- off: "Keep Claude Code signed in to [account]", the picker that was
  the tick box's (first account, or the one picked);
- switch-only: held on and disabled, with a title saying why, since
  switch-only always moves the sign-in.

The switch posts provider/keeplogin as the tick box did (keepLogin is
the switch off), so nothing on the server changes and a user's saved
keepLogin reads as the switch off. The name is a label for the switch:
clicking it flips it too. `.editor label`'s text-align: right is undone
for it, so its words start at the left. The two "Automatic switching is
off" strings give way to the switch's name and title in zh, zh-TW, ja
and de. docs/subsystems/providers-accounts.md says it under "Used-up
switch".

Run (Windows box, win-run; mote refused ssh and WSL's GUI runs failed
with E_UNEXPECTED):
- sign-in-moves, keep-login, pool-ends, i18n-keys, i18n-en-no-cjk,
  routing-signin, account-return in chromium and webkit, en and zh:
  100 pass
- after the alignment fix: sign-in-moves, keep-login, pool-ends: 72 pass
- TestCoreScriptBudget (wsl-run): PASS
- screenshots, chromium en and zh, on and off: name at the left, switch
  at the right, line or picker under it
- after rebasing on origin/main: see the push

Broken by hand:
- posting !on from the switch: sign-in-moves red 4 of 16;
- dropping the text-align fix: the "words start at the left" check red
  (160 to 224px in), where the old box check had passed.

Not run: the whole GUI suite with the switch (mote and WSL down). At the
previous commit it was cut short on mote with load timeouts; the account
reds there (account-arrange, agent-switch-accounts, claude-switch-only's
"page doesn't move") also fail on origin/main d1b4eff5a and are #6010,
#5925 and #4344. Not tried in the real app with the owner's accounts;
their keepLogin (the switch off) is left as it is.
2026-11-11 13:05:16 +08:00
yetone 8a3dbf0232 gui: the accounts list says what magpie does with the agent's sign-in
A user with two Claude accounts read the used-up switch as gone. Their
"Keep Claude Code signed in to" box was ticked, which turns the switch
off, and nothing on the page said so. Under the accounts of a Claude Code
or Codex with more than one account, a line now says what the switch
does, as NextLogin decides it:

- kept: switching is off, the agent stays on the first account (or the
  one picked) even once it runs out;
- gateway: Claude Code's requests go through magpie, which picks an
  account per request; its own sign-in stays put;
- moves: the share it moves at (98%, or used up for In order / Until
  used up), and whether it comes back to the first (returnsToFirst).

provider.SignInMovesOf gives the mode from the same checks NextLogin
makes (leftAlone, keep, ClaudeThroughMagpie && !SwitchOnly, SpentShareOf,
returnsToFirst). /api/providers carries it as signInMoves on the agent's
own provider row. The Routing tab's sign-in note says the gateway case
too. Strings in zh, zh-TW, ja and de.

Run (mote, through mote-run):
- go test -run 'TestSignInMoves|TestClaudeRouted|TestKeepLogin|
  TestClaudeSwitched|TestNextLogin|TestCodexLogin' ./internal/provider: ok
- go test -timeout 45m ./internal/gui ./internal/provider: ok (script
  size budgets included)
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
  provider and gui: ok
- GUI: sign-in-moves, keep-login, i18n-keys, i18n-en-no-cjk,
  routing-signin, account-return in chromium and webkit: 60 pass
- whole GUI suite (make test-ui): see below
- screenshots in WebKit, en and zh: the line sits inside the list at the
  rows' inset; zh sentences join with no space

Broken by hand: dropping NextLogin's keep case from SignInMovesOf turns
TestSignInMovesSaysWhatSwitchDoes red; not appending the line turns
sign-in-moves.test.cjs red 4 of 4.

Not tried: the real app with the owner's accounts; the user's own
keepLogin is left as it is.
2026-11-11 13:05:16 +08:00
yetone 059d995d56 gateway keys: the list reads the ledger once for all keys, and a proxy's web page is said by its title (aiandcloud on X)
aiandcloud (2.98B tokens, 12,654 requests a day, server mode behind a
proxy) saw Gateway keys draw a Cloudflare 524 page as raw HTML.

Slow list: every poll of /api/caller-keys read up to a month of ledger
rows once per window per key. budget.AllOf now reads each distinct window
once for all keys, and keeps the settled blocks' sums with a cursor
(usage.VisitFrom), so a poll only reads what was appended since; the
unfinished tail block is always read again. A rewritten or shorter log
resets the cursor. All(k) is AllOf of one key.
Numbers (BenchmarkAll vs BenchmarkReadEach, 8 keys x day/week/month,
31 days x 12000 rows/day = 372k rows, warm): 211-228 ms before, 23.5 ms
after.

Raw HTML: fail() now turns an error string holding a web page (a remote
magpie's or a vendor's 524/502 page inside the JSON error) into a short
said/what pair, "A proxy in front of magpie answered, not magpie ({what})"
with the page's title, translated in all 5 languages (key already in
i18n.js). The browser already handled non-JSON bodies (notJSON, #2032).

Run (Windows box, mote ssh was down earlier): go test budget, usage, gui
(AllOf, Budget, FailSays, I18n, Keys); gateway-keys-proxy-page and
gateway-key-limit GUI files in chromium and webkit, 5 languages: 24/24;
gofmt; vet windows, linux nogui, darwin (mote, only a clang deprecation
warning). Broken by hand: with the old fail() TestFailSaysAProxyPageByItsTitle
is red; with VisitFrom's reset() removed TestAllOfIsWhatEachWindowRead is red.
Not tried: a user-scale cold ledger, a server behind a real Cloudflare,
the full suite before the tag (started after).
2026-11-11 13:00:54 +08:00
yetone 58fb070953 settings: named proxies, chosen as inherit, direct or a saved one anywhere a proxy is (@tsingchao on X)
Settings > Network keeps named proxies (name, address, optional login)
with a Test that says reachable and the latency. Everywhere a proxy can be
chosen (global, plugin downloads, a provider, a key, a Claude account) now
has a Saved mode beside the others; the value is "@<id>". Addresses typed
before are read exactly as before, nothing is migrated or overridden.
netproxy.Parse/Resolve/Redact/EnvWith/Dispatch resolve a reference at the
lowest layer, so a proxy edited once reaches the gateway, usage reads,
sign-ins and the plugin host at the next request; Claude Code's
settings.json env (a snapshot) is rewritten by provider.ProxyEdited.
A reference this computer lacks fails closed (DeadProxy), says the proxy's
name in the request error and as "Proxy missing: {name}" on the provider
row, and never goes direct. The password lives in settings.json (0600), is
never read back by the page, logged, or put in Settings sync. The list
rides with the providers part of a sync (Bundle.Proxies, MergeProxies by
id, passwords only with keys). A proxy in use can't be deleted (409).
The saved list's page code is in proxies.js, loaded when Settings draws it;
app.js grew by Saved-mode helpers only, paid for by 16 long comments cut
(core budget unchanged, no raise).

Run (mote refused ssh all session, so Go and GUI went through win-run on
xiaomi-gpu, Windows 11; gofmt and darwin/linux-nogui/windows go vet were
clean on mote before it went down, at the pre-sync tree):
- go test settings, netproxy, backup, settingsapi, davsync: ok on Windows
  (earlier on mote: also gui, provider, plugin with real Bun, gateway).
- saved-proxies.test.cjs 20 of 20 (chromium+webkit, en zh zh-TW ja de,
  420px) twice more on Windows; provider-proxy-missing.test.cjs 20 of 20.
  One webkit de 420px run of saved-proxies failed once under 4-way
  concurrency and passed 3 of 3 alone; not reproduced.
- TestCoreScriptBudget ok after the move (it was 3.4KB over before).
Red on this tree and on origin/main alike (Windows run, not mine):
settings TestSharedCheckedReadsOnceAndKnowsUnknown; provider
Codex keychain/Git tests; plugin TestHostRunsAsMagpieBun, TestPiPackage;
gui TestGatewayHeldByAContainer and others; old-webkit "compat.js is the
first" (headerpresets.js) and ":has() (Safari 15.4)" on origin/main 245f07b19.
Broken by hand: restore skipping Proxies (TestSavedProxiesTravelWithProviders
red), Parse returning nil for a dangling ref (netproxy tests red), the
Proxy-missing badge disabled (provider-proxy-missing 0 of 20), and the Claude
env snapshot failing open (found by reading, test added).
Not tried: real vendors, the real Claude Code, a real two-computer sync, the
macOS suite and the whole GUI suite on this final tree (mote down; the whole
suite ran to test ~3700 on the earlier tree with reds owned by others).
A proxy missing whose sender never had it is named by its id.
2026-11-11 12:26:43 +08:00
yetone 4df5256db8 plugins: a plugin's page shows its README in the UI's language (ahwulv on X)
A plugin that ships README.zh-CN.md still showed README.md on its details
page with magpie in Chinese. GET /api/plugins/page now takes ?lang= (the
page's document language) and plugin.ReadmeIn picks the README named for it:
README.zh-CN.md, README_zh.md, README-zh.md, README.zh-Hans.md, README.CN.md
and the like, any case (readmeTag/pickReadme). Order: the language's own tag,
then its base (zh-TW takes a simplified README over English), then the plain
README.md as before.

Where it reads from: an installed plugin's folder; an npm package not
installed from its files through jsDelivr's file list (the registry entry
holds README.md only), public registry only, never a user's private one;
a GitHub repository not installed from its contents list. Any failure keeps
the old README.md path. The page cache in plugins.js is keyed by package and
language. A package only on the community dist branch still shows the
README its index carries (English).

Before/after: zh UI + a package with README.zh-CN.md showed README.md; now
shows the Chinese one. en UI, no such file, or jsDelivr down: unchanged.

Run: TestPickReadmeByLanguage, TestReadmeInUILanguage (fake npm, jsDelivr,
GitHub, installed folder) on mote at the commit before the final rebase and
on a WSL box; broken by hand (lang forced to "" in ReadmeIn) the test goes
red. GUI plugin-readme-lang (new, chromium + webkit, en and zh) green, red
when &lang= is dropped from the request; plugin-detail-escape green. go vet
darwin green. Not tried: a real npm package with a localized README against
the live jsDelivr; the other plugin GUI files and linux/windows vet were
still queued on mote when this was pushed.
2026-11-11 11:50:13 +08:00
yetone 914fcf59b0 gui: Sessions' Settings › no longer scrolls the whole window (kalicyh on X)
Settings' explanation lines are held out of sight with position:absolute
(hover mice), but their row had no positioned ancestor, so each sat at the
window's top-left corner, below the fold for the rows far down a page. The
document (body is overflow:hidden, still scrollable by script) then had
~870px of scroll, and Sessions' Settings › (openSettingsAt ->
scrollIntoView on the Privacy session-history rows) scrolled the window as
well as the page: Settings' top, the header, was pushed off the screen.

The row's .who is now the line's box (position:relative), in Settings and
in the provider editor's prefs (same rule, same hole). Every other
openSettingsAt link (Privacy rows, General's name row) shared it.

Run (win-run xiaomi-gpu; mote refused SSH all session, WSL tar errors):
- sessions-to-settings, all 5 languages x 1100/420 x chromium+webkit:
  20 of 20 ok. The new check (window scrollTop 0, Settings top >= 0,
  document no taller than the window) is red on the old CSS, 4 of 4 in zh
  (both engines, both widths).
- settings-hints/-lines-wrap/-places/-back/-search/-tabs-stick,
  editor-hints/-roomy, provider-prefs: 15 failures on this change against
  18 on the old CSS, the same names minus three the fix cleared (webkit de
  440 line-wrap, webkit hover hints); the remaining 15 (chromium de 440
  line-wrap, Settings' search, both engines) fail the same on the old CSS
  on the Windows box.
Not run: the full GUI suite, go test, macOS/Linux WebKitGTK.
2026-11-11 11:40:24 +08:00
yetone 7476328901 settings: one longest context for every model (WJaunita45604 on X)
Settings > Models > Routing has a Longest context field (magpie model
context-cap [<size>|off], POST /api/settings/context-cap). It lowers every
model's window to it, so a user need not set each model. A window the user
set on a model, or on its provider with "*", wins and is not capped; a model
whose window is unknown stays unknown.

It is applied where the window is derived, provider.windowIn, so /v1/models,
every agent's catalog, group windows and the compaction thresholds that
follow the window all agree. Codex's own models take it through
CodexNativeWindow, CodexWindow and codexcat.Cap on the list the gateway
serves; the list's ETag carries the cap so Codex asks again. The provider
editor's Listed value stays the vendor's.

Run (mote): provider, codexcat, cli, settings, settingsapi, gateway tests;
GUI context-cap, model-load, settings-places, i18n-keys, settings-general in
chromium and webkit (en, zh); TestCoreScriptBudget; gofmt; vet on darwin,
linux nogui and windows. Broken by hand: windowIn without the cap turns
TestContextCapHoldsEveryModelButTheOnesTheUserSet and TestModelsListContextCap
red.
Not tried: the whole GUI suite (one row added to an existing list, no new API
read on page load), a real Codex reading the capped list, Windows run.
Not covered: Claude Code's own [1m] choice (claudeRunName) and agent/claude.go's
fallback when a ref has no window.
2026-11-11 11:07:57 +08:00
yetone eb56de0b59 gui: a model's Same as can be picked from models.dev's list, filtered (timfang4162 on X)
In Model settings the Same as box, which binds a provider's model to
another model's metadata (window, reply limit, levels, images, list
price), was a bare text field. A button beside it now opens the app's own
menu (not a <select>) with the models of the models.dev catalog magpie has
already synced: id, name, window and price on each line, a Filter… box over
id, name and maker, the current one ticked. A pick fills the box, so it is
staged and saved with the editor's Save like a typed id, and a value typed
afterwards still wins; nothing about how Same as is read changed.

GET /api/catalog/models lists the cache with one entry per model
(catalog.SameModel), taken from the provider that lists its window and
price. It fetches nothing. The picker lives in modellimits.js, loaded with
the model rows, so the core script budget is not raised (five comments in
renderModels cut to pay for the strings, 613 bytes of room before).

Run on mote at this tree:
- TestCatalogModelsListsTheSyncedCatalogOnce; broken by hand (last
  provider wins instead of the one with window and price) it fails with
  "kimi-k3 = {ID: ... }; want the provider that lists its window and
  price".
- model-same-pick.test.cjs, 22 cases (chromium and webkit, en zh zh-TW ja
  de, 400 and 900px): filter by maker, name and id, Enter picks, the
  current one ticked, one catalog read, no scroll, no <select>, saved as
  modelPrefs same; a failed read says so. With the filter argument taken
  out of openProtoMenu it fails. provider-same-as.test.cjs still passes.
- gofmt, go vet (darwin, linux nogui, windows) on internal/gui,
  TestCoreScriptBudget.
Full GUI suite at this tree (rebased on 5c05ac41b): the only reds are not this change's, each also red or flaky at origin/main 1f99f6f0b run alone, and filed: account-arrange #6010, account-eye #5052, account-refresh-holds #5814, accounts-own-signin's Antigravity test #6038 (a webkit access-control flake that moves between languages).
Not tried: the real app's WebKitGTK; the full suite is started after the
push.
2026-11-11 10:56:41 +08:00
yetone 0cc91af3db agy: magpie's models go in a settings file of its own, so agy's remote control works (baysonfox on X)
magpie wrote modelProvider gemini, the model and its custom models into
agy's settings.json. That made every agy an API-key session: no Google
account, so no remote control (needs the sign-in plus Google's server-side
flag), and a plain agy asked for GEMINI_API_KEY too.

Now they go in ~/.gemini/antigravity-cli/magpie-settings.json, handed to agy
as --settings for the one session (the launch command, magpie agy run, and
the function in a shell or a WSL distro). settings.json stays the user's.
An older wiring is given back (stashed model and provider) at the next Sync
or pick. agy remote-control and --remote-control run plain, on the sign-in.

Run (mote): go vet, GOOS=windows and linux nogui vet, agent/cli/sessions/update
packages (see push note). Real agy 1.5.3 in a sandbox HOME: plain agy with
the user's untouched settings.json now asks for sign-in (no GEMINI_API_KEY
error); the new launch reached a stub gateway at /v1beta/models/<m>:streamGenerateContent.
Broken by hand: remote-control bypass removed, TestAgyRun red; TestAgy red
on the old code (settings.json written).
Not tried: real remote control (needs a Google sign-in, none in the sandbox);
signed-in BYOM custom models; Windows PowerShell function run.
2026-11-11 10:31:52 +08:00
yetone 88c417392e usage: a sortable model speed ranking on the Requests tab (@flying_crp on X)
Usage's Requests tab gets a "Model speed" card: per model, the median output tokens/s, the median wait for the first token and the request count, over the selected range, sortable by every column (aria-sort header buttons, quiet table, no gradients). A request counts when it was answered (not rejected, handed on, failed or canceled), its first token was timed and it wrote 100 tokens or more (usage.MinRankTokens; the tooltip says so). Computed locally: each chunk keeps a 2% log-bin histogram per model beside its cells (speed_rank.go, chunkPart.speeds), a page merges the chunks' histograms, so there is no per-request sort and medians are within ~1%. The settled chunks' histograms are in the page file; its key salt is now page-v2, so the first load after upgrade recounts settled history once. /api/ledger sends speeds and speed_min.

Run (mote): gofmt clean; go vet darwin, linux nogui, windows for the touched packages and ./... earlier; go test internal/usage, internal/usageapi, internal/gui ok at this head; usage-model-speed.test.cjs 12 of 12 (chromium and webkit, en/zh/zh-TW/ja/de, 400px: order, sort by every column, aria-sort, focus kept, no horizontal overflow, ellipsis, hidden when empty); with i18n-keys and i18n-en-no-cjk 20 of 20; the whole GUI suite once on the branch before the rebase: every red is in a file unrelated to this change (account-arrange #6010, account-refresh-holds #5814, account-eye #5052, agent-switch-accounts #5925, bulk visibility and disconnect previews #5982 fixed in e430e2750, accounts-own-signin #6038), each red alone on origin/main 71a68639b or load-only.
Timing: 1M requests added to a chunk in ~185ms (TestModelSpeedRankAtTheLargestLedger).
Broken by hand: dropping the Failed/Canceled exclusion (gpt: 5 requests, 59.7 tok/s) and dropping the page's merge of chunk speeds (ranking empty) each turned the new tests red; restored.
Not tried: the real Linux app (WebKitGTK), a real ledger of hundreds of thousands of rows through the page-v2 file, a Windows run (win-run).
2026-11-11 10:12:23 +08:00
yetone e430e27500 gui tests: agent-bulk-visibility and agent-disconnect-preview leave the window's in-use signal out of the writes they count (#5982)
10c4dc109 posts /api/update/using on the window's first pointer or key event. Both files record every POST and count or compare them, so bulk visibility (10 cases: 4 posts, not 2) and disconnect previews (4 cases: the two /api/update/using posts) were red on origin/main 71a68639b, run alone on mote. The recorders now leave that path out, as provider-find's did in b96847c3d.

Run: both files on mote, chromium and webkit, 5 and 2 languages: 14 of 14 ok (before, at 71a68639b: all 14 red). Not tried: the rest of the ~250 files with a strict POST recorder (#5982's open part).
2026-11-11 10:07:19 +08:00
yetone 68d1fda92b providers: GPUStack, a self-hosted model server, in the Add sheet (tayedexuanfeng on X)
tayedexuanfeng asked for GPUStack so locally deployed models import quickly.
GPUStack (github.com/gpustack/gpustack, read at 26b4af6) serves its
OpenAI-compatible API at <server>/v1 (/v1-openai is the legacy path), takes
the key as a Bearer (docs/user-guide/api-key-management.md), and lists the
ready models at GET /v1/models as {"object":"list","data":[{"id",
"object":"model","created","owned_by":"gpustack"}]} (routes/openai.py).

A KindLocal preset, so the Add sheet's Server address field, the CLI's
address=, the TUI's ask and AtAddress all apply as for Ollama; unlike
Ollama it is not NoKey, so its key is asked for. Default http://localhost/v1
(port 80). Logo: the project's own docs/assets/logo.png (Apache-2.0), 96px,
in pngIcons as mlx-serve's is (lobehub has none). Note translated in zh,
zh-TW, ja, de.

Run on mote: go test -count=1 of internal/provider, gui, cli, tui (ok);
go vet on darwin, windows and linux nogui for provider and gui (ok);
GUI i18n-keys, i18n-en-no-cjk, models-add-and-icons, local-address and the
new gpustack-add (56 of 56 in chromium and webkit; gpustack-add also in en,
zh, zh-TW, ja, de at 900 and 440px). The new Go tests use a fake server in
GPUStack's documented shape and never reach the network.
Broken by hand: NoKey true on the preset turns TestGPUStackPreset red;
dropping gpustack from pngIcons turns gpustack-add red (11 failed).
Not tried: a real GPUStack server (none on the LAN), the Linux WebKitGTK
app, the Windows box. Not built: GPUStack's /v1/responses and /v1/messages
(chat only).
2026-11-11 08:31:55 +08:00
yetone ae449f8e4f gui: the sidebar's tab lists give each tab a mark of its own
Library's, Usage's, Plugins' and Settings' tabs, listed under their page
in the sidebar (navSubs), were names alone while every page above them
has an icon (the owner, with a screenshot of Library's list). Each tab
now has a 14px line mark before its name, from NAV_SUB_IC by page and
tab id: segs gives its buttons data-seg (Usage's own strip too), and
Settings' tabs have data-set. A tab with no mark (none today) keeps an
empty slot, so the names stay in one column. The mark is muted, and
takes the row's ink when the row is hovered or picked.

The marks are in navicons.js, imported with the first list drawn, which
then draws again with them. Its one line in app.js is paid for by two
navSubs comments cut, so the core's script budget is not raised
(1,533,751 of 1,533,802).

German's longest Settings names ("Synchronisierung und Backup") were
cut with an ellipsis at 1100 before this; "Netzwerk und Freigabe" now
is too (7px). Left as is: shortening the word would change it in five
other German sentences that name the tab.

Run:
- nav-sub-icons.test.cjs (new): every row of the four lists has its
  mark, 14px, before its name and level with it, one column per list,
  names whole (not German); en zh zh-TW ja de, Chromium and WebKit, on
  WSL (magpie-desktop): 12 of 12. Red with Library's memory mark taken
  out by hand ("library: Memory has a mark").
- go test ./internal/gui on Windows: 8 reds, the same 8 alone on
  origin/main b46f23ffa (#4115, #5928, #5324; TestCherryStudioImportRow
  added to #4115).
- At this head, on origin/main b50910fee, on mote: 27 GUI files a
  sidebar list, a tab strip or a core script reaches (nav-sub-icons,
  nav-sub-unroll, nav-lamp, sidebar*, side-width, side-toggle,
  settings-sections, settings-tabs-stick, settings-back, segs-glide,
  segs-press-redraw, plugin-pick-sub, plugins-more-discover,
  plugin-updates, usage-refresh, library-items, library-bili, i18n-keys,
  i18n-en-no-cjk, click-scroll, readable-focus, icon-one-tone,
  old-webkit), both engines: 588 of 590. The 2 reds are old-webkit's,
  red the same alone on b50910fee: headerpresets.js unlisted (#6030,
  filed now) and .side-foot:has() (#5919). go test ./internal/gui
  -run 'Budget|Core': ok.
- settings-search is red on b50910fee alone too (the window's
  /api/update/using in its strict list, commented on #5982), so it was
  left out of the run above.
- Not run: the whole GUI suite (mote's suite.lock queue is ~30 deep)
  and the whole Go suite at this head.
2026-11-11 08:31:16 +08:00
yetone 9212185a73 gateway keys: Model names is a row of name and a picked model, not a textarea (tsingchao on X)
The key's Model names editor was one textarea of "name = provider/model"
lines. It is now a row a name: the name typed, the model picked in the app's
menu (search by name or id), x to remove, Add a name for another, the
Headers editor's row. A row with a name and no model, or the reverse, holds
Save off; a row with neither is left out. aliases-key's body and the saved
data are as before; the line-format message is gone, so is its key.

Run (mote): gateway-key-search-names (rewritten for the rows) + i18n-keys,
24 ok, chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 440. Broken by
hand: half-row check off, the test goes red in all 10 chromium cases.
Screenshots before and after in chromium, dark and light, 900 and 420.
Not tried: Windows/Linux GUI run; the whole GUI suite runs after the tag.
2026-11-11 07:52:22 +08:00
yetone 0d0462d4a2 gui: a Presets menu in a provider's Headers fills in what a common client sends (l3123109756 on X)
The Headers editor gets a small Presets button beside + Add header. It
opens the app menu (openProtoMenu) with Codex CLI, Gemini CLI, OpenCode,
Kilo Code, Cline, Roo Code and Cherry Studio. A pick adds that client's
headers: a header the draft already has with a value keeps the user's own,
one with no value is filled, the rest become rows. The list lives in
headerpresets.js, imported when Presets is pressed, so the core's script
budget is not touched. No Claude Code preset and nothing that imitates it.

Where each value comes from (another app's values come from that app):
- Codex CLI: originator codex_cli_rs and the User-Agent shape from
  codex-rs login/src/auth/default_client.rs (as internal/provider
  codex_request.go sends them), version 0.167.0 = @openai/codex on npm.
- Gemini CLI: GeminiCLI/<ver>/<model> (<platform>; <arch>; terminal) as
  internal/provider/google.go userAgent has it, 0.67.0 = @google/gemini-cli
  on npm.
- OpenCode: opencode/latest/<ver>/cli (packages/core/src/app.ts,
  internal/provider/opencode_client.go), 2.2.7 = @opencode/cli on npm.
- Kilo Code: HTTP-Referer, X-Title, User-Agent, X-KILOCODE-EDITORNAME from
  Kilo-Org/kilocode request.ts and headers.ts (internal/provider/kilo.go),
  7.8.27 = @kilocode/cli on npm.
- Cline: cline/cline sdk/packages/llms/src/providers/cline-client-headers.ts
  (internal/provider/cline.go), desktop client, 3.5.54 as cline.go has it.
- Roo Code: DEFAULT_HEADERS in RooCodeInc/Roo-Code
  src/api/providers/constants.ts, RooCode/3.53.0 = src/package.json on main.
- Cherry Studio: defaultAppHeaders in CherryHQ/cherry-studio
  src/main/utils/http.ts, read from main on 2026-11-11.

Run (mote, at the pushed head, rebased on origin/main):
- new header-presets.test.cjs: 20 of 20 in chromium and webkit, en, zh,
  zh-TW, ja, de, 900px and 420px. With the user-value rule broken by hand
  (a preset overwrote a set value) it was 0 of 20.
- header-session-hint, model-headers, i18n-keys, i18n-en-no-cjk: green.
- TestCoreScriptBudget: ok. app.js is smaller than before.
- editor-hints.test.cjs webkit: 10 red here and on a clean origin/main
  copy alike ("Tab didn't come back to Certificate's box"), filed in
  #5872.
- The whole GUI suite is running on mote after the tag; reds will be
  filed.
Not tried: a real request through a preset's headers against a vendor
that checks them. Codex's and Gemini's User-Agents carry macOS and arm64
as magpie's own Go code does.
2026-11-11 06:38:15 +08:00
yetone ce5e5964db gateway keys: model search box, re: patterns and Model names in the key editor (tsingchao on X)
The model picker of a gateway key gets a search box (name or id) and takes
"re:<regexp>" typed then Enter; the row menu gets Model names (aliases-key).
Docs: gateway-routing.md "A key's model patterns and names".

Run (mote): go vet darwin, windows, linux nogui on access/gateway/cli/gui;
go test internal/access, gateway (937s), cli, gui all ok at the pre-rebase
base; after rebasing on origin/main: go build ./..., the new Go tests,
TestCoreScriptBudget, and GUI gateway-key-search-names + gateway-key-models
+ i18n-keys (28 ok, chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 440).
Broken by hand: pattern match off (gateway + access tests red), aliasRequest
off (alias test red), search argument removed (all 20 chromium GUI red).
Not tried: Windows/Linux GUI run, a real client against a real key; the
full suite runs after the tag.
2026-11-11 06:26:47 +08:00
yetone 13a9f1263a plugins: Discover counts who uses and likes each plugin
Discover showed npm's weekly downloads, which CI, mirrors and magpie's
own keepMovedCurrent updates inflate. Now each card and the hero say
how many people use a plugin, counted by magpie itself, and a plugin's
page has a like.

- The daily stats send (stats.Send) also POSTs usemagpie.ai
  /api/plugins/report with the install id and the installed, switched-on
  plugins Discover lists, by their Discover key: the npm name, or
  github:owner/repo for a repository tagged magpie-plugin
  (plugin.Public). A folder, a private repository or an unlisted
  package is never named. It goes only while "Share the agents,
  providers, models and plugins I use" is on (noUsageStats), and only
  where the day's event goes at all (Count me as a user, DO_NOT_TRACK,
  MAGPIE_NO_STATS, release builds).
- site/pluginstats.js on D1 magpie-plugins: users are the ids that
  reported a plugin in the last 7 days, reports drop after 30 days, a
  caller's address is kept only as a hash for an hour (60 asks an
  hour). /api/plugins/stats carries no id and is cached for an hour.
- A like (POST /api/plugins/like through the GUI's /api/plugins/like)
  is taken only for a plugin installed and on here, can be taken back,
  and is kept in plugin-likes.json.
- "Most liked" sorts by likes once a plugin has 20, below that by
  GitHub's stars.
- plugincounts.js is loaded with the Plugins page, not the core, and
  redraws the cards only when the counts changed.
- The privacy text follows: README.md, README.zh-CN.md, docs/reference.md,
  the site's privacy and start pages in en, zh and ja, llms-full.txt,
  and the Privacy switch's label and description in every language.

Run at this tree (on origin/main 51da6f1f5):
- Windows box (win-run): gofmt -l clean; go vet of internal/stats,
  internal/plugin, internal/gui ok for windows and linux (-tags nogui);
  node --test site/pluginstats.test.mjs site/worker.test.mjs 44 of 44;
  TestCoreScriptBudget, TestPluginCountsAndLikes ok; GUI old-webkit,
  i18n-keys, privacy-usage-stats, plugin-git, plugin-local,
  plugin-github in both engines: 45 of 46, the one red is #5919
  (.side-foot:has, d374168d0).
- mote, one commit before the rebase onto 51da6f1f5 (Go unchanged
  since): go vet darwin ok; TestSendPlugins, TestPublicPlugins,
  TestPluginCountsAndLikes, TestCoreScriptBudget ok.
- Windows, at 7bc7af1d0 (one rebase earlier): go test internal/stats
  ok; internal/plugin and internal/gui red only in TestPiPackage and
  eight gui tests that fail the same at origin/main 72f2deebe on that
  box (#4115, #5928; TestCherryStudioImportRow added to #4115 with its
  cause). Every plugin*, market*, privacy*, i18n*, old-webkit* and
  discover* GUI file (83 files, both engines, concurrency 4): the reds
  left after the fix below match origin/main 6d7862769 on the same box,
  or are flakes red there too under concurrency: plugin-update-button
  (#4500), plugin-proxy-page (#6017, new), privacy-agent-telemetry
  (#6018, new).
- Broken by hand, caught: the first run had `const like = !local && …`,
  so a local plugin's page called false?.sync() every 600ms; 136
  "like?.sync is not a function" errors across plugin-git, plugin-local,
  plugin-github and the sign-in files. Fixed before this commit.
- Live: D1 magpie-plugins created and the worker deployed;
  /api/plugins/stats answers {"plugins":{}}, a bad report or like 400,
  /api/latest and / 200. No test data was written to production.

Not tried: the full Go suite and the full GUI suite. mote had 28 suites
waiting for its lock, and WSL on the Windows box failed with
E_UNEXPECTED while another session uninstalled a distro. Not tried
either: a real like or report from a release build (source builds
never send), so the first real counts come with this release.
2026-11-11 04:28:18 +08:00
yetone 796f759e20 gui tests: library-bar-more leaves the window's in-use signal out of what the page posted (#5982)
10c4dc109 posts /api/update/using on the window's first pointer or key
event. library-bar-more recorded every POST and compared the list to
["/api/library/skills/check"], so it went red in every subtest.

Run on mote, at 90f4a377b: library-bar-more.test.cjs, BROWSER=chromium 11/11 and
BROWSER=webkit 11/11. Before the change: 22 failures, the same at
origin/main 459405960.
2026-11-11 04:14:58 +08:00
yetone d77eb6d236 memory: search by meaning, on a small model on this computer
A memory search now finds what means the same in other words or another
language ("什么时候上线" finds "Releases go out on Tuesdays"), for the
MCP server's memory_search and the Library's Memory tab alike. It is off
until switched on under Memory → Search by meaning, since it downloads
paraphrase-multilingual-MiniLM-L12-v2 (Xenova's int8 ONNX, ~135 MB,
pinned revision, size and sha256 checked); switched off, the model is
deleted.

- internal/pii/guard: the BERT code runs the embedder too (LoadEmbedder,
  mean pooling; the tokenizer reads 250,002 pieces and WhitespaceSplit).
  Its vectors match ONNX Runtime's int8 to cosine >= 0.995 and are no
  further from fp32 than ORT's own; testdata carries both.
- internal/memembed: the switch, the download, vectors.bin keyed by each
  memory's sha256 (read once, again when the text changes, a cut-short
  file read as none), Keep reading in the backend, the model let go after
  10 minutes unused.
- internal/memory: memory.Semantic fuses the meaning ranking with the word
  ranking by reciprocal rank; a tie goes to the nearer in meaning, since
  a first word hit may hold one common word ("when do we release" had
  "Never delete images when..." first). Near 0.30 / Within 0.15 come from
  97 real memories and 16 queries, half Chinese for English memories:
  12 of 16 sought found with ~4 others each. Rank searches without noting
  memories used.
- GUI: the Search by meaning row (download %, memories read, failures),
  and the tab's search lists what the backend ranked first
  (POST /api/memory/rank), then word matches. zh, zh-TW, ja, de.
- docs/subsystems/memory.md: the section, out of "Not built yet".

Why not multilingual-e5-small, which this was built on first: run for
real, its cosines sat at 0.78-0.89 for everything, and a Chinese search
ranked Chinese memories over the English one it meant. e5-small, e5-base
and MiniLM were compared in ONNX Runtime on the same 97 memories; MiniLM
put the sought one first 9 of 16 and in the top 3 12 of 16, with the
rest at a median cosine of 0.16.

Run before the rebases (mote, on origin/main as of the work):
- gofmt -l internal/ clean; go vet of memembed, memory, pii/..., gui,
  library; GOOS=linux and GOOS=windows vet of memembed and pii/guard.
- MAGPIE_EMBED_DIR=~/models/pml go test -run Embedder ./internal/pii/guard:
  7 texts (CJK, full width, emoji, digits before runs of spaces) at
  0.9962-1.0000 with ORT int8.
- go test memembed, memory, memdistill, pii/..., library, browsermcp.
- Linux (magpie-desktop, -tags nogui, mote's disk was full): go test
  memembed, memory, pii/guard, gui (461s), cli (1228s, past the default
  10m timeout, so -timeout 30m); gateway -run 'MemoryMCP|OwnMCP'.
- Rebased on origin/main 3ebb1ba2c, on mote at this tree: gofmt -l
  internal/ clean; go vet of memembed, memory, pii/..., library, gui,
  gateway, and GOOS=linux and GOOS=windows vet of the first four; go
  test memembed, memory, pii/..., library, browsermcp (Embedder test on
  ~/models/pml); gateway -run 'MemoryMCP|OwnMCP'; cli -run
  'Settings|Parity|Budget'.
- Rebased again on origin/main 5d6935b11 (title bar, cli parity,
  account export, provider catalog): go vet of gui and cli; go test -run
  'Settings|Parity|Budget' of cli and gui, ok with the Bark test fix two
  commits up (TestSettingsSaveKeepsWhatItDoesNotSend, red on main).
- GUI on mote, this commit plus the next (90f4a377b, which fixes
  library-bar-more for #5982): every library-*.test.cjs, i18n-keys and
  i18n-en-no-cjk, BROWSER=chromium and webkit, 701/702 each. The red is
  library-loading's tab list, which has no "Claude plugins" (6af54dc9a)
  and is red alone at origin/main faffb1e95 (#5997). library-bili's
  webkit saved count times out about 1 run in 3, on main too (#6015).
- A real switch-on: the pinned files downloaded from Hugging Face and
  checked in 11s, 5 memories read; 什么时候上线, 端口被占用怎么办, 清理磁盘,
  回复用什么语言 and "when do we release" each find their memory first.
  缩进用什么 finds nothing (0.23 to the tabs memory, under Near).
- Broken by hand: without the tie rule, TestSearchFindsByMeaning's new
  case is red (images first).

Not run: the whole Go suite and the whole GUI suite; go test of
internal/gui and the whole of internal/cli after the rebases (WSL kept
restarting, and they passed on Linux before).
2026-11-11 04:14:58 +08:00
yetone 47e30d0e97 gui: the Mac's title bar drags while a dialog is open, and the bar's middle does everywhere (ssuuuuooo on X)
v0.1.3624 added the .modal-grip strip but it could not work on the Mac:
there the scrim begins under the bar (body.window.mac .modal top: 50px),
so the strip sat below the bar, while the bar itself (header, sidebar top)
is inert whilst a dialog is open (modalBackground), and an inert element
is not hit, so nothing there carried --wails-draggable. On Windows and
Linux the strip worked only at the sides: the dialog's 16-28px top padding
let a tall dialog (the provider editor) lie over the strip's middle.

Now on the Mac the strip reaches up over the bar (top: -grip height; a
fixed child would not do, the scrim's backdrop-filter is its containing
block), and off the Mac the scrim's top padding is at least the strip's
height so no dialog lies over it. docs/subsystems/gui-shell.md updated.

Run (mote-run, chromium and webkit): modal-title-drag.test.cjs gains
"the middle of the title bar drags with a tall dialog open" (web and mac
classes, 5 x 3 points along the bar, header inert): 0 of 4 on the old css,
4 of 4 now. With modal-*, dialog-*, add-sheet*, signin-closes-sheet,
sidebar*, click-scroll, panel-drag-linux, title-bar-tools, i18n-keys,
popover-mac-chrome, editor-roomy: 351 pass; the 3 reds of that run
(modal-centred-late, sidebar-overlay-scrollbar webkit, title-bar-tools
zh-TW webkit) pass 36 of 36 rerun alone at this tree, and
sidebar-overlay-scrollbar webkit also failed once on the base (load).
Not tried: a real drag in the signed macOS app (the test checks the
--wails-draggable value under the pointer, which Wails reads); the
confirmation (action-confirm, top layer) still has no strip.
2026-11-11 04:09:07 +08:00
yetone b9f8548d22 accounts: export ChatGPT and Claude accounts as Sub2API or CLIProxyAPI files (heyiwei5 and Rk1ngggg on X)
WIP commit before the full checks; body rewritten at ship.
2026-11-11 04:07:09 +08:00
yetone 696556e26c provider: Google Vertex AI takes an API key (express mode) and a base URL (Langanpaibian on X)
Vertex AI could only be signed with gcloud credentials and a project id.
A provider now takes one API key instead: a Key with no project is Vertex
express mode, asked at https://aiplatform.googleapis.com/v1/publishers/
google/models/<model>:streamGenerateContent with the key in x-goog-api-key
(Google's docs), no project, no token minted. Express serves Gemini
models only, so Base(Chat)/Base(Anthropic) are empty and the models list
drops partner and Claude models. A key with a project is asked at the
project's address, signed by the key. Vertex.BaseURL (optional, /v1
stripped) replaces Google's host for a keyed provider, such as a proxy.

Security: a Google token or gcloud credentials go only to Google's own
address. A BaseURL is honoured only with a key, and the key is the only
credential sent there; without a key Save refuses it and a providers.json
holding one has it dropped on load.

Wired through: provider.Save/normalize/Sign/Base/planModels, `magpie
provider add google-vertex <key>`, `provider key`, `provider set ... url=`,
`provider <id>` and the list, the editor's API key and Base URL fields
(app.js, 4 translations each), the Providers row pill, and the
providers-accounts subsystem page.

Run (mote-run): gofmt -l clean; go vet for darwin, linux -tags nogui and
windows over ./...; go test -run Vertex for provider, cli, gui, gateway
and tui, all green, with new tests TestVertexExpressKey,
TestVertexExpressBaseURL, TestVertexExpressEditor (fake server) and the
gateway's TestVertexExpressStreams (chat, streamed and whole, asks
/v1/publishers/google/models/... with the key header, no token minted);
vertex-editor, i18n-keys and ledger-protocol GUI files in chromium and
webkit (en and zh editor flows; the i18n check covers zh, zh-TW, ja, de).
Broken by hand: Sign without x-goog-api-key turns the provider, gui and
gateway express tests red. The existing tests that pinned "a key is
refused" now pin the new rules.

Not tried: a real Vertex AI key (no account on hand; the endpoint and
header are from Google's express-mode docs, the tests use fakes), the
full GUI suite in webkit, Windows and Linux runs of the tests.
2026-11-11 03:54:21 +08:00
yetone 71c4ef2d07 gui: Bark push target for every alert, and a daily spend summary (EV_John_Liu on X)
Settings > Usage has a Bark row: a server (default https://api.day.app, or
a self-hosted one) and the device key, then Test and Remove. Every alert
that goes through notifier.sendAs (allowance, balance, reset reminder, task
done, masking, sign-in) is also pushed to Bark when a key is set, whether or
not the system lets this computer notify. A second row, once a key is set,
turns on a daily summary at a time of day: today's cost and request count,
and each window or balance near its cap (the Allowance alert's share, else
80%), capped at 8 lines. It is pushed once a day (a restart does not resend;
a failed push is retried every 15 minutes; one more than 6 hours late is
left), in the page's language (en, zh, zh-TW, ja, de).

The device key is a key: the page only gets barkKeySet, never the key; it has
its own route (POST /api/settings/bark, key omitted keeps it, "" removes it),
a Settings save carries it (settingsapi.Merge), and a backup or sync without
keys leaves it out and keeps this machine's. No log line or error names it
(the Bark client replaces it with "..." in what the server or client says).
bark.js is a lazy module so app.js (budget) gains one line.

Run (mote, at the pushed tree before the rebase onto 6d7862769):
- go test ./internal/bark ./internal/settings ./internal/settingsapi
  ./internal/backup ./internal/davsync ./internal/provider: ok.
- go test -run 'Bark|AlertsGoTo|GitHubToken' ./internal/gui: ok. go vet
  darwin, GOOS=linux -tags nogui and GOOS=windows over gui, bark, settings:
  clean. gofmt -l: clean.
- GUI: bark.test.cjs (5 languages x 900/380px x chromium/webkit), i18n-keys,
  i18n-en-no-cjk, usage-alert: pass. Whole GUI suite started; reds so far are
  in account/agent/checkin tests that do not touch Settings or Bark, filed
  separately after this tag; old-webkit's Safari 15.0 :has() is #5919.
- All against fake servers; nothing reaches the network.
Broken by hand, each went red: no barkPush in sendAs
(TestAlertsGoToBark), BarkKeySet forced true / key shown (TestBarkSettingAndTest),
no same-day check in the daily step (TestBarkDailyStep).
Not tried: a real Bark device or the real api.day.app; win-run and wsl-run
(vet only for those OSes); a self-hosted Bark server.
2026-11-11 03:41:37 +08:00
yetone 6af54dc9a9 library: Claude Code plugins kept as one item, with a Claude plugins tab (FakeshadowzZ on X)
A Claude Code plugin (.claude-plugin/plugin.json, skills/, agents/,
hooks/hooks.json, .mcp.json) can be installed into the Library from a
folder, a git address or a marketplace.json, and is one row: turned on, off
or removed as a whole, and given to the agents picked with the chips every
tab has. Its skills, MCP servers, hooks and subagents are ordinary library
items tagged Bundle: <plugin>, so each agent gets them through the code of
its kind and the Skills, MCP servers, Hooks and Subagents tabs go on
working. Off clears every part's agents and keeps them for on; Remove
removes the parts. A part whose name the library has gets the plugin's name
as a prefix, never over the user's own. Claude hook events and matchers map
to the portable ones; others become claude:<Event>, for Claude Code only.
Slash commands, LSP servers and non-command hooks are listed as not
carried, not dropped. internal/library/plugin.go, POST /api/library/plugins/*,
the Claude plugins tab in plugins/library/client.js (en, zh, zh-TW, ja, de),
docs/subsystems/library.md.

Run (mote): go test -tags nogui ./internal/library ./internal/gui
./internal/backup ./internal/davsync ok; gofmt clean; go vet darwin, linux
(-tags nogui) and windows clean. GUI, chromium and webkit, en zh zh-TW ja de
at 420 and 1100: library-plugins (new), library-hooks, library-subagents,
i18n-keys, i18n-en-no-cjk, click-scroll all pass. Whole GUI suite started
and cut short at ~460 of its tests: failing only account-dragging and
accounts-sheet (routing, untouched by this), not compared on origin/main.
Broken by hand: dropping the Off handling in givePlugin and the hookTakes
filter each turned the new Go tests red.

Not tried: a real Claude Code plugin from a marketplace, a git source
(tests use folders), WSL, Windows. Not carried yet: commands/*.md, LSP
servers, a plugin's folder across computers (a backup carries the parts, not
the plugin record).
2026-11-11 02:55:15 +08:00
yetone 5df062f0f2 provider, gui: a Claude account with its provider switched off shows its last reading, or says it is switched off, not "No allowance reported" (Kunlin03 on X)
Kunlin03 (Pro subscription, "Claude Code" switch off): the account's card
said "暂无额度数据". LoginUsage returns nothing for a provider magpie leaves
alone (switched off or removed, leftAlone), so /api/login/usage answered {}
and the card had neither a reading nor an error, although left_alone.go says
what was last known is still shown. Pro versus Max is not the cause: the
read itself (Claude Code's /usage) is the same for both.

LoginUsageShown, used by /api/login/usage and `magpie accounts`, answers such
an account from keepLast (its last reading, readDeferred, "not refreshed this
time") and, with none kept, errLeftAlone, which the card words as "Switched
off, so no allowance is read — switch it on and refresh" (4 languages).
LoginUsage itself is unchanged: warm-ups and switching act on it and must
not take a kept reading for a fresh one. Nothing is requested for a provider
left alone.

Not changed: the Usage page and a card refresh for an off provider (they
read through loginReading as before). Not tried with a real Claude Pro
account; the sandbox has none.

Run (mote): TestLoginUsageShownOfSwitchedOffClaude (red without errLeftAlone
in readDeferred), claude-off-usage-card.test.cjs in chromium and webkit, 5
languages, 2 widths (red with the quotaError branch removed), gofmt, vet
darwin/linux nogui/windows, the provider, cli and gui packages, i18n and
account/usage GUI files.
2026-11-11 02:40:18 +08:00
yetone 1d41799f2a agent: turn off every agent's telemetry from Settings › Privacy (OipsAnthony on X)
OipsAnthony on X: "magpie 设置 - 隐私,支持统一关闭所有 Agent 的遥测功能,
这个统一管理的地方优先级最高". v0.1.3562 gave Codex, Claude Code, Gemini
CLI and Qwen Code a Telemetry row each; there was no one switch for all.

Settings › Privacy now has "Turn off telemetry for all agents"
(settings.AgentTelemetryOff, POST /api/settings/agent-telemetry,
agent.SetTelemetryAll in internal/agent/telemetry_all.go):

- On: every agent found here with a telemetry switch is turned off through
  its own switch and that switch's rules (only keys the file lacks are
  written; a value of the user's own that keeps telemetry on is never
  written over: the agent stays on and the reply's "refused" names it
  and why). Each agent the switch turned off gets a stash marker,
  <id>.telemetry.all. An agent found later is turned off on the next
  state the window reads and by a one-minute gateway loop
  (KeepTelemetryAllOff, in WhileServing).
- While on, each agent's own Telemetry row shows off, says "Off for all
  agents in Settings › Privacy" and its buttons are disabled; the API
  refuses it too (ErrTelemetryAllOff).
- Off: only the marked agents are turned back on, which takes out only
  magpie's keys. An agent off by its own row or the user's own config
  before stays off.
- An unreadable settings.json is unknown: nothing is written.
- The setting is per computer (KeepOwn) and the generic settings POST
  can't change it (settingsapi.Merge carries it).

app.js pays for its ~650 bytes with ten Privacy-section comments cut
(core 1,533,550, under its 1,533,802 budget, no raise).

Run (mote, first on 10bef5fe0):
- go test -count=1 ./internal/agent ./internal/gui ./internal/cli
  ./internal/settings ./internal/settingsapi: ok, except gui's
  TestSettingsSaveKeepsWhatItDoesNotSend, red as it should be for a new
  field; with AgentTelemetryOff in its fixture it and the budget and
  parity tests pass (-run).
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
  ./...: clean. gofmt -l: clean.
- GUI, chromium and webkit: privacy-*.test.cjs (new
  privacy-agent-telemetry: 5 languages x 1100/640px plus a refused case
  in each engine, no scroll on click, no native select), i18n-*,
  agent-telemetry, settings-search, click-scroll: 218 of 218 pass.
- The whole GUI suite (1,367 files) was started under ~/suite.lock and
  never got it: lockf gave up after 4h with the lock held by other runs.

- Rebased on 6a81a3c62 (this commit's parent), again: go vet
  ./internal/... (darwin) and GOOS=windows vet of agent, gui, cli; the
  Telemetry, budget, settings-keep, CLI parity and route tests; GUI
  privacy-agent-telemetry, agent-telemetry, i18n-keys and
  privacy-usage-stats in both engines: 64 of 64.

Broken by hand:
- no stash marker in keepTelemetryOff: TestTelemetryAllOff red, "Gemini
  CLI not back on".
- SetTelemetry without the ErrTelemetryAllOff check: TestTelemetryAllOff
  red, "Gemini CLI's row turned on under the switch".

Not tried: a real agent's config on this computer (sandbox HOME only);
Windows runs of the new Go tests (they skip there, a #! stand-in isn't a
command on Windows; the switch's code has no OS-specific path).
2026-11-11 02:38:58 +08:00
yetone 6a81a3c62a masking: its head's Settings link is a link, and the head wraps before it squeezes the title
v0.1.3386 (ff7d84b9b) put "Settings › Privacy" in Insights › Masking's
head as a second button.text beside Turn off masking. The whole GUI
suite, run on mote after the tag, went red on it:
- mask-alert and masking-records "masking on, the page turns it off and
  on again" found two button.text where Turn off is the only one
  (all languages, both engines);
- masking-records "the card says what was kept" at de 640px: the two
  buttons and the 7/30 days switch left the title a column ~60px wide,
  the head 276px tall, and the first request at 907px, past 760.

Now the link is a .link (as on Plugins › Built-in), and .msk-head wraps
whenever its title would be narrower than 16em, in place of the
600px media query. de 640px: head 107px, first request 738px.

Run on mote: node --test masking-records, mask-alert, builtin-places
(Chromium and WebKit, every language): 218 pass, 0 fail. Red before
this on the same files (gui-full.log of the post-tag run).
The rest of that post-tag GUI run is triaged separately; mote rebooted
mid-run twice, and its other reds are in files this change doesn't
reach.
2026-11-11 02:14:20 +08:00
yetone 5048a48d5c gui: a plugin's README renderer moves out of the core, to pluginmd.js
Discover and the new Install button took TestCoreScriptBudget 2,766
bytes over. The README's Markdown renderer moves to pluginmd.js,
imported once plugins.js has run; the core is 1,531,323 of 1,533,802,
no raise. markdown and mdLoad stay function declarations: as consts,
window.mdRender = markdown at the top of plugins.js threw "Cannot
access 'markdown' before initialization" and every page failed (the
first WSL run). The Library's skill files read through window.mdRender
too, so the import isn't left for the Plugins page to open.
old-webkit lists pluginmd.js with the other lazily loaded files.

Run record: the Discover commit's (same push).
2026-11-11 01:51:15 +08:00
yetone e369bf77b4 plugins: Install is a thin ring round body-coloured text, with its arrow
The owner picked option C of four: "一个个大安装像一个个补丁". Install,
Move and a list's Sign in are a 1px ring (--ring-act, the text colour
at 15%) round body-coloured text, with a download arrow before
Install; hover fills it grey; Update is the same ring in green; the
detail page's main action keeps its accent fill. Browsers without
color-mix() (Safari before 16.2) get --line for the ring, which
old-webkit's check asked for.

plugin-update-button and plugin-market assert the ring and the fill
of the new look. Run record: the Discover commit's (same push).
2026-11-11 01:51:15 +08:00
yetone fd568caf7d plugins: Discover is one market, with this week's picks on top
The owner asked for one market instead of three (magpie's community,
other npm authors and repositories tagged magpie-plugin on GitHub) and
approved the mockup: every plugin is the same card, its source said
under its name, a strip picks the kind and a menu the source. The top
is the week's picks: one a day from the community's most downloaded
not installed yet, the most downloaded and the most starred. A search
looks through every source at once, most used first. GitHub's slower
answer shows a word that it is being asked, and a failed ask a quiet
line with another go.

The GUI tests that named the three sections now find the cards by
source. plugin-manual-float picks Subscriptions so all 40 cards draw
(Discover's shelves cap at 6). plugin-github waits for WebKit's wheel
scroll to come to rest after reaching a card: it went on after the
last wheel, and the scroll that was measured as the click's was its
own (logged before, settled, open and closed: it moved before the
click, never after).

Run at 563b3dd92, the pushed head's tree (only messages changed since),
on origin/main 40fbec705:
- mote: gofmt -l internal/gui empty; go vet ./internal/gui,
  GOOS=linux go vet -tags nogui, GOOS=windows go vet; go build,
  GOOS=linux go build -tags nogui, GOOS=windows go build: ok.
  go test ./internal/gui ./internal/plugin ok (TestCoreScriptBudget
  in it).
- mote GUI, plugin*, old-webkit, market*, builtins, skill-edit, i18n*,
  gui-*, about*, agent-plugin* files: 1,283 ok, 50 not ok, in
  plugin-move-unserved (#4410), market-have (#5997), old-webkit's
  app.css :has() (#5919), gui-ja's {model} (#5943),
  plugin-signin-no-url (#5938), plugin-signed-out-account (#5998) and
  plugin-card-update once; each red the same alone at origin/main
  90f9f01a2, where plugin-card-update was red too.
- Rebased onto 459405960 (c4da9a97d's title-bar drag in app.js and
  app.css among it): gofmt, go vet ./internal/gui and the Budget and
  Script tests of internal/gui again: ok.
- Before the rebase (on 783cd0f84): the whole GUI suite on
  magpie-desktop (WSL), its 132 red files again beside main: 95 red the
  same on main (#4600, commented), key-replace red 3 of 3 alone on main
  too; old-webkit's color-mix and plugin-github were this change's and
  are fixed; library-hooks, -items, -loading and -subagents red the
  same alone on main (#5997).
Not tried: the real app; screenshots come from the GUI test pages.
2026-11-11 01:51:15 +08:00
yetone c4da9a97dd gui: the window drags from the title bar strip while a dialog is open (ssuuuuooo on X)
On the Mac the main window couldn't be dragged by its title bar while a
dialog was open: #modal's scrim covers the whole window, including the
bar, and had no drag region (--wails-draggable is read from the element
under the pointer). #modal is the one overlay every dialog of the window
uses (provider editor, new provider, what's new, sign-in, ...), so one
strip fixes the class: .modal-grip, last child of #modal (app.js keeps
the dialog the first child), as high as the title bar, drag. The dialog
has z-index 1 over it and so is never a drag region, nor is the scrim
below the strip, which still closes the dialog on a click; the strip
counts as backdrop for modalBackdrop, so a click there closes it too.

Not covered: the confirmation (action-confirm, a top-layer <dialog>);
its ::backdrop hit-tests to the dialog element, which can't carry a
strip. The add sheet is part of the page, not an overlay.

Run (mote-run, chromium and webkit): new modal-title-drag.test.cjs (en,
zh, 1100 and 440px; the provider editor and a new provider's editor):
8 of 8 pass; with the grip's drag style taken out it is 0 of 8. Also
modal-*, dialog-*, add-sheet*, signin-closes-sheet, sidebar, click-scroll,
panel-drag-linux, title-bar-tools, i18n-keys: 162 pass. go test
./internal/gui ok; go vet darwin, gofmt clean.

Not tried: a real drag in the macOS app (the test checks the
--wails-draggable value under the pointer, which is what Wails reads);
windows/linux go vet of internal/gui (no assets-only Go change).
2026-11-11 01:28:27 +08:00
yetone 5b28e85999 gui: the open-source licenses text takes the dialog's whole width (JiuLiaowkvn on X)
The notices <pre> sat in the editor grid's first column (fit-content 132px,
or 35% at 420px) once framed, so only a narrow strip of the dialog showed
text. It now spans both columns.

Run (mote, chromium + webkit): about-notices.test.cjs, 20 pass. The new
width assertion fails on the old CSS (15% of the dialog at 1100, 35% at
420), passes after. Not run: the rest of the GUI suite, full go suite.
2026-11-11 00:40:17 +08:00
yetone 4623f54190 gateway: HTTPS for other computers, from magpie's CA or an imported certificate (zhangly1 on X)
zhangly1 on X: Claude on another computer on the LAN needed magpie at
https://. Settings → Network and sharing → HTTPS (magpie https on)
serves other computers TLS on the gateway's own port, with a
certificate magpie's CA (the mTLS one, in ~/.config/magpie/mtls) signs
for this computer's names and addresses; this computer keeps plain
http://. The switch is read per connection, so no restart.

- Certificate row: Import… takes the user's own PEM certificate (with
  chain) and unencrypted key, in any files and order; a pair that can't
  be served (no key, no cert, a stranger key, a passphrase, run out,
  nothing PEM) is refused with the reason in the page's language and
  leaves nothing behind. Remove goes back to magpie's CA. --tls-cert
  still comes first.
- magpie's CA row: SHA-256 shown, Save puts magpie-ca.crt in Downloads;
  the gateway serves it without a key at /magpie-ca.crt to any address
  the share lets in. Rows under it give curl -kO, macOS, Windows, Linux
  and NODE_EXTRA_CA_CERTS steps with Copy.
- A page open from another computer can't turn HTTPS on or off under
  itself (it would lose its own address).
- magpie https status|on|off|import|remove|ca --out; the serve banner
  names magpie's CA or the imported file instead of "(mTLS)".
- docs/reference.md and gateway-routing.md say all of it, and that
  Windows' curl.exe needs --ssl-no-revoke for any private CA.

Run:
- gofmt -l clean; go vet linux -tags nogui ./internal/..., GOOS=windows
  and GOOS=darwin -tags nogui vet of the touched packages (WSL, mote
  refused ssh all evening).
- WSL: go test -tags nogui gateway -run HTTPS|MTLS|ClientCert|CAFile|TLS|LAN
  ok; gui -run HTTPS|MTLS|Keep ok; settings, settingsapi, mtls ok;
  cli -run Help|HTTPS|TLS|Serve|Banner|Flag|Unknown ok. The whole cli
  package hit its 40m timeout in TestEveryAgentFieldNameWritesNothing
  (#5234, #4247, not this change).
- GUI (WSL Playwright, chromium + webkit): https-settings (en, zh, 390px,
  strings in all four languages) ok, plus mtls-settings, allow-ips,
  browser-access, cors-origins, gui-de/ja/zh-tw, i18n-keys,
  i18n-en-no-cjk, lan-*, public-url*, api-key-theme,
  connect-address-kept, gateway-connect-keys, gateway-caller-keys,
  side-gateway-lan, menu-scroll. Reds at load ~130: api-key-theme
  (#5044), connect-address-kept (#5972), gateway-caller-keys (#2572),
  gui-ja (#5943), lan-docker (#4692), all red the same at base
  10bef5fe0 run beside it; allow-ips and gateway-connect-keys went red
  once under that load and pass 18/18 at concurrency 1, base and this
  change side by side.
- Real: a sandbox HOME gateway built from this tree on WSL
  (MAGPIE_ADDR=0.0.0.0:3593, a gateway key, magpie https on, magpie
  serve). From the Windows host: curl -k /magpie-ca.crt 200 without a
  key; Node fetch with NODE_EXTRA_CA_CERTS=magpie-ca.crt 200 on
  /v1/models, 401 without the key, SELF_SIGNED_CERT_IN_CHAIN without
  the CA; plain http:// 400; curl.exe --cacert needs --ssl-no-revoke
  (schannel), then 200. Cert SANs: localhost, the hostname, .local,
  127.0.0.1, ::1 and every address. magpie https import of an openssl
  CA's leaf on the running gateway: Node trusting that CA 200, magpie's
  CA alone refused. remove + off on the running gateway: plain http://
  from Windows 200. This computer's plain http:// 200 throughout.
- At the pushed tree (on origin/main ee818e8bc), WSL:
  gofmt -l clean; go vet -tags nogui linux, GOOS=windows, GOOS=darwin
  nogui of gateway, gui, cli ok; go test -run 'HTTPS|CAFile|MTLS|LAN'
  gateway, gui ok. GUI https-settings, mtls-settings, i18n-keys,
  gui-de/ja/zh-tw, allow-ips, lan-* (both engines): 147/155; reds are
  gui-ja (#5943), lan-docker (#4692), allow-ips webkit under load, and
  gui-zh-tw chromium under load (2 of 3 green alone, filed #5983).

Broken by hand:
- TLSOn without HTTPSOn: TestHTTPSOtherComputer red.
- lanGuard without the caFileOpen exemption: TestHTTPSCAFile red.
- mtls config without GetCertificate = settingsCert: all three
  serving tests red.
- app.js without renderHTTPS(s): https-settings red in both engines.

Not tried: the macOS, Windows and Linux system trust commands on a real
store (they change the box's trust); Claude Desktop itself; a darwin
GUI run (mote unreachable); the full suite before the tag (started
after it).
2026-11-10 23:05:47 +08:00
yetone 6c3f113cee routing: a rule's hours over give the conversation back; looser times (MinglunZhu on X)
MinglunZhu asked twice for a provider by time of day and said the time
setting in Routing rules is awkward. Three causes:

- A conversation a night rule sent to its member stayed there after the
  hours: no rule matched the new turn, so Auto affinity kept it on the
  night's member by its cache (Smart and every routing but In order).
  ruleFor now sets RuleHit.Ended when the last turn's rule had hours
  that are over, and affine lets the conversation go (Affinity.Why
  "hours"); the trace says so in en, zh, zh-TW, ja, de. Tool rounds of
  a turn begun inside the hours stay put; Session, Strict and In turn
  keep their own way.
- The time boxes took only ASCII "HH:MM", while their numeric keypad
  on a phone has no colon and a Chinese IME types ":". clockOf (GUI)
  and clockMinutes (CLI, saved files) now read "22", "2200", "930",
  "22:00", "22.00", "22点30" and full-width digits; "9:5" is still
  no time. time=22~08 takes ~ and ~ for the dash.
- A new rule starts with an intent box; hours took an × and a +. Adding
  another condition now drops the intent box while it is empty.

A time rule in a nested group doesn't give its conversation back yet:
#5977.

Run (mote): go test ./internal/provider (ok); go test -run
'TestRuleHoursOver|TestRuleTime|TestRule|Affinity|StandIn|Session|TestParse|Clock'
./internal/gateway (ok); go vet darwin, GOOS=linux -tags nogui,
GOOS=windows for gateway and provider; gofmt. GUI, chromium and webkit:
routing-time (8/8 after the new trace test's fix), and 28 rule/affinity/
i18n files (routing-rule-*, routing-time*, routing-intent-entry,
routing-folder, routing-pause*, routing-smart-intent, routing-save*,
routing-rules-line, routing-affinity-*, routing-behind-why,
routing-kept-again, routing-session-folder, i18n-keys, i18n-en-no-cjk):
477/481, the 4 reds the new trace test's first wording, fixed and rerun.

Broken by hand: affine's "hours" case off -> TestRuleHoursOverGiveThe
ConversationBack red (Smart stays on kb by cache); origin's
grouprule.go/ruleparse.go -> TestRuleTimeTypedLoosely red; client.js's
"hours" case and the intent give-way off -> routing-time 0/4 in
chromium; the old clockOf -> routing-time red on "9:00".

Not tried: the real app with a real night/day pair of providers; the
full gateway package and full GUI suite (the full Go suite runs after
the tag); Windows run of the touched packages (vet only).
2026-11-10 22:57:20 +08:00
yetone b96847c3d9 gui tests: provider-find leaves the window's in-use signal out of what the page posted
10c4dc109 posts /api/update/using on the first pointer or key event, so provider-find's "only the order was posted" went red in every language and both engines on mote at ca7a39291 (something else was posted: ["/api/update/using"]). The recorder now leaves that path out; it is the window's, not the Providers page's.

Run on mote: provider-find with the GUI files of the commit before it, 154 of 154 in chromium and webkit. Not tried: other GUI files with a strict post recorder (8 record every non-GET); none of them were run here.
2026-11-10 22:53:58 +08:00
yetone 72e804d2b5 gateway: a provider set Never a fallback takes no other model's request (sonnnnnnnnnnnna on X)
sonnnnnnnnnnnna asked that a request a local uncensored model was given
never falls back to an online provider (Anthropic, OpenAI) when the local
model is full (kv slots) or down, where it could get the account banned.

A provider now has Never a fallback (NoStandIn), off by default: the
Providers page's right-click, under Use first, ticks it; the CLI's
`magpie provider set <id> fallback-for-others=no` sets it. Its keys and
accounts are dropped from a request's plan once a candidate of an
unmarked provider was planned before them (standInsOut, run in planPaused
and in planGroup before restLast and sinkPlanned, so a local model that
failed and is resting still counts as first; a primary with nothing
planned counts too). A request that goes to a marked provider first still
moves on as before, and a weighed group (Smart, Cheapest) that picks a
marked member first sends it there. The dropped rows go to the trace's
left-out list as StandIn; the Routing page says why ("it is set never to
be a fallback for another model"), and the cap, held and barred refusal
checks ignore them so a refusal keeps its old status.

No classifier was built: the model that would judge the request is the
local one that is down, and any other would send the text somewhere the
user didn't choose.

Run on mote (macOS 27) at this tree on 065ca02c2: gofmt -l clean; go
vet darwin, GOOS=linux -tags nogui, GOOS=windows over gateway, provider,
gui, cli; go test ./internal/cli ./internal/gui ./internal/provider ok
(TestCoreScriptBudget after four comments cut in app.js, core 1,533,187
of 1,533,802, no raise), ./internal/gateway -run
'StandIn|UseFirst|Fallback|Barred|Capped|Group' ok (the whole package
ok at e6f151507); GUI in chromium and webkit, 126 of 126: stand-in (new,
5 languages, 1100 and 420 wide), provider-find (with the next commit),
use-first, menu-first-second, routing-held-member, unlisted-models,
i18n-keys, i18n-en-no-cjk; plugin-actions, routing-wb-refused and
group-found-skip ok at ca7a39291. provider-models-rest is red the same
at ca7a39291 (10 !== 83), #4396.

Broken by hand: standInsOut's drop turned off (`other && false`), and
TestNoStandInTakesNoOtherModelsRequest went red ("local down: 200 ...
from cloud2, want the spare").

Not tried: a real local model (llama.cpp/Ollama) going full or down, the
Windows box, a click in the real app.
2026-11-10 22:53:58 +08:00
yetone e053c337aa gateway: join a shared magpie with a password (EV_John_Liu on X)
EV_John_Liu asked for quick setup on a LAN: the central magpie serves a
page behind a password where other PCs and Macs get their config and a
new key of their own.

Settings -> Network and sharing -> Join with a password sets the
password (at least 8 characters; only a salted PBKDF2-SHA256 hash is
kept, in join.json, 0600, written through temp-and-rename; a file that
can't be read or parsed means joining is closed). The row then shows the
address to give out, <shared address>/join, and Turn off joining.

/join is the key page (/me) opened to join: the visitor types a name for
the computer and the password. POST /v1/magpie/join makes a gateway key
named after that computer (or "Joined from <ip>"). The key is listed in
Gateway keys like any other, where it can be limited or removed. The
page shows the key once and then the setup for that key: Claude Code,
Codex, a new magpie tab (`magpie provider add remote-magpie '<key>'
url='<address>'`), OpenAI-compatible and curl.

Every route judged:
- lanGuard lets another machine reach GET /join and the join route
  without a key, only while magpie is shared. The route checks the
  password itself.
- A browser's POST must come from the page itself. Host must be one of
  this computer's own names (IP, localhost, MAGPIE_PUBLIC_URL's, its
  hostname), so a DNS-rebound name is refused. Origin must equal Host.
  Missing Origin and Origin "null" are refused, and so is any
  Sec-Fetch-Site but same-origin. corsGuard still refuses null, foreign
  and *.localhost Origins before this. curl and scripts, which send no
  browser marks, are judged on the password alone.
- Throttle: each try from another machine costs a token, a right
  password too. The bucket holds 10 and refills one every 10s, so a
  guesser gets about 360 tries an hour, and a flood of tries makes no
  flood of keys. Over the limit the route answers 429 with Retry-After.
- The password and key never go in a URL or a log line. The key comes
  back only in a no-store 201 body. Logs name the key's id and the
  caller's address.
- The routes are classed in the key-slot and read-only route lists.
  They carry no key.

Run on mote at this head (rebased on 065ca02c2):
- gofmt clean
- go vet: darwin, linux -tags nogui and windows, for access, gateway
  and gui
- go test: access, gui, and gateway's join, route-list, key page and
  LAN tests
- The whole gateway package ran before the rebase, and its only reds
  were the two route-list guards fixed here.
- GUI (node --test), chromium and webkit: lan-join (new), key-page,
  mtls-settings, allow-ips, i18n-keys, lan-docker, lan-lazycat,
  lan-address-height, side-gateway-lan: all ok before the rebase, and
  lan-join, key-page and i18n-keys ok again at this head.
- That GUI run caught a TDZ error: JOINING was read before its const,
  which broke /me too. It is fixed in this commit, and key-page went
  from red to green.

Broken by hand (each red, then put back):
- no throttle: TestJoinHoldsAGuesser red
- no lanGuard bypass: TestJoinMakesARevocableKey, TestJoinHoldsAGuesser
  and TestJoinClosed red
- no ownHost check: TestJoinRefusesOtherPages red
- joinRefusal returning "": rebound remote, cross-site and no-Origin
  browser POSTs each got a 201, red
- Dropping only the Origin comparison stayed green, because corsGuard
  refuses the same Origins first.

Not tried:
- a real two-machine LAN join with the built app
- a Windows or Linux run of the tests (vet only)
- the full suite, which starts after the tag
2026-11-10 22:42:11 +08:00
yetone 87b3af7653 library: a project turns a global MCP server or skill off, out of git, and its worktrees follow (WhyULose0 on X)
WhyULose0 asked for MCP servers and skills per project: a global set every
project inherits, each project that set ± items (a global one turned off
for one project too), one place to tick for every agent, nothing written
into the project's git, the router running a shared server once, and a
new git worktree following its main project.

What was there: projects could add skills and servers (Library → a
project's card), the MCP router ran each server once, but a project could
not turn a global item off, magpie wrote its entries into the project's
.gitignore (a tracked file), and a worktree got nothing.

What changed:
- Turning a global item off in one project (ProjectServerOff,
  ProjectSkillsOff; POST /api/library/projects/server-off, skill-off),
  done the way each agent reads a folder: Claude Code's record of the
  project in ~/.claude.json (disabledMcpServers; magpie takes out only
  names it put there), Codex's project .codex/config.toml
  ([mcp_servers.X] enabled = false, only for a server in Codex's own
  config), Claude Code's skillOverrides "off" in the project's
  .claude/settings.local.json.
- With the router on, a project that adds or turns off a routed server
  gives Claude Code (local scope in its project record) and Codex (project
  config) the hub at /mcp/magpie/hub/<agent>~<projectKey>; hubServers
  serves that address the project's set, each server still started once.
  gateway.HubAgentOf cuts the key off for the log, errors and on-demand.
- Out of git: entries go to the repository's info/exclude (one block per
  project, shared by every worktree); the .gitignore is left as the user
  wrote it, and a block an older magpie wrote there is taken out. A folder
  git-inited later gets its block on the next KeepLinked.
- Worktrees: the project's folder in each worktree of its repository gets
  the same skills, servers and offs, found on KeepLinked, let go when
  removed.
- GUI: a project's card lights each agent that has an item from the
  Library; a click turns it off (or back on) in that project. An agent that
  can't take an off (Gemini CLI etc., or a skill that goes through the
  skill router) stays lit and says why. The Skills menu ticks inherited
  skills; unticking turns one off. zh, zh-TW, ja, de.

Limits, per agent:
- Offs only for Claude Code (servers and skills) and Codex (servers).
  Codex reads the project config only in a trusted project.
- A skill reached through the skill router can't be turned off in one
  project.
- Claude Code keys its record by the repository's main top folder, so a
  project in a subfolder turns its server offs on repo-wide.

Run (mote's SSH refused every try today, kex reset; every run went to
the WSL box through wsl-run, linux, at load 60 to 80 from other runs):
- go test -tags nogui ./internal/library: ok at this head. At the base
  before (4a9142ccd) TestEveryAgentInLibrary was red on main's own
  avibe/obsidian, fixed upstream since.
- go test -tags nogui ./internal/gateway ./internal/gui, one rebase back:
  gateway ok; gui ok but for TestSetAnswersWhileDevinAndProvidersHang
  (a set waited 37s; #1375, numbers added there). An earlier run had one
  TestMiddlewareThroughGateway red (the reply's first delta skipped a
  middleware's onEvent; nothing here touches middleware), 5 of 5 alone,
  filed as #5955.
- go vet: linux (-tags nogui) and windows clean; darwin (-tags nogui,
  cross from linux, no cgo) clean but for internal/gui's
  traywindows_darwin_test.go, which needs trayImagePNG from a
  darwin && cgo file, untouched here.
- gofmt -l: clean
- GUI, chromium + webkit: project-*, i18n-* and library-* 4 wide, then
  each red file alone at this head. Alone, all pass, project-scope
  included, but for library-mcp-copy-config ja chromium (#5941) and
  library-browser-setup (#5974); both are red the same way at origin/main
  without this change (40ca0c88d and 6bac8f8a5). library-all webkit
  (#4967) was red alone before the rebase, also at 40ca0c88d.

At 82a8acb09 (this change on 065ca02c2): go vet -tags nogui ./...
clean, ./internal/library ok, project-* and i18n-* GUI 32 of 32. Then rebased over b2b83d4f9's four commits (lessons,
gateway plugin models through a remote, a plugin hook test, agent auto
mode), none of them in a file this change touches.

Broken by hand, each red:
- Claude offs not written: TestProjectServerOff (no record)
- Codex offs not written: TestProjectServerOff (codex project config)
- hubServers ignoring a project's offs: TestProjectSetThroughRouter
- skill offs not written: TestProjectSkillOff
- worktrees not listed: TestProjectWorktreeFollows
- writeExclude a no-op: TestProjectServerOff, TestProjectKeptOutOfGitByExclude,
  TestProjectOutsideGit
- every chip click sent to the add path: project-scope.test.cjs

Not tried: a real Claude Code or Codex run in a project with an off (the
record and table shapes are read from Claude Code 2.1.316's and Codex's
config code, not watched working); darwin (mote down), Windows runs;
a real `git worktree add` (the test writes git's worktree files by hand).
2026-11-10 22:39:29 +08:00
yetone 7e1858515b remote magpie: name its models by the provider serving them there (lcc580 on X)
lcc580 asked for a pass-through on the Remote magpie provider: show the
upstream magpie's own provider beside each model, so an agent can tell the
same model from two of its providers apart. Before, the names followed
both magpies' Provider in model names: with either one Off, both relays'
DeepSeek Chat reached the agents as "DeepSeek Chat · Office" (or plain
"DeepSeek Chat").

- The list a magpie gives another magpie (X-Magpie-Drawers) now names,
  as magpie_by, the provider serving each model there (Entry.ServedBy):
  "routing group" for a group, and for a model of its own Remote magpie
  the provider at the start of that chain. The fetch keeps it as the
  model's By (catalog/live.go).
- A Remote magpie provider gets upstreamProviders: the editor's "Model
  names" tick ("With the provider serving it there"), or
  `magpie provider set <id> upstream-providers=on`. With it on, each of
  its models is labelled "DeepSeek Chat · Office › Relay A" in every
  agent's list, whatever either magpie's Provider in model names says,
  unless the user named the model themselves under Own
  (Entry.Label/upstream, LabelsFor). Model settings' "Agents' lists show"
  line follows the tick at once.
- Ids are unchanged, so a request still goes by office/relay-b/model.
  Off (the default) names everything as before. A remote older than
  magpie_by has nothing to add, so its names stay as before.
- The core's scripts stay in budget: four long comments in app.js were
  cut to pay for it, no raise.

Run:
- Tests that fail on the old code: TestRemoteMagpieUpstreamNames
  (gateway: an httptest remote with two relays' DeepSeek Chat and a
  group, every Provider in model names mode, on and off, the third
  magpie's magpie_by, ids kept), TestServedByAndUpstreamLabel (provider),
  and name-suffix-remote.test.cjs's new case (tick, hint, save body).
- Broken by hand: upstream() returning "" and the magpie_by line removed;
  both Go tests went red with the plain labels, then restored.
- Two real gateways, built -tags nogui on the Linux box (WSL) under
  sandbox HOMEs: B with Relay A and Relay B both serving deepseek-chat,
  A with B as Remote magpie "Office". A's /v1/models before:
  "DeepSeek Chat · Relay A · Office"; after
  `provider set office upstream-providers=on`:
  "DeepSeek Chat · Office › Relay A" / "› Relay B" / "› routing group".
  A request for office/relay-b/deepseek-chat reached relay-b on B.
- gofmt -l clean; go vet darwin, linux (nogui), windows on the touched
  packages; go test catalog, provider, gateway, cli, gui on mote
  (macOS) at the rebased head: ok (catalog 2.6s, provider 165s, gateway 948s, cli 56s, gui 149s).
- GUI on mote, chromium and webkit: name-suffix-remote, remote-magpie,
  remote-self, i18n-keys, i18n-en-no-cjk, gui-ja, gui-de, gui-zh-tw,
  provider-detect-draft, provider-unmasked, routing-remote-windows,
  usage-remote-cards: all green except reds that fail the same on origin/main 388ca9ad4 (run there on the Linux box): gui-ja "ja has every zh string" (#5943) and remote-magpie "asks for the other magpie's address" in both engines (#4398); name-suffix-remote's old "named alone under Off" once in chromium de (#5147, scrollends.js import under load). The new case first failed in webkit (route lost after the save, the page's host went to DNS); it now uses one route whose server is swapped, 20 of 20 on the Linux box (WSL), both engines.

Not tried: the full suite (starts after the tag); the real desktop app's
editor by hand; a chain of three real magpies (the third magpie's
magpie_by is covered by the gateway test only).
2026-11-10 22:20:17 +08:00
yetone 6bac8f8a59 gui: magpie web on a phone has a tab bar with More (geraldpppppp on X)
On a phone, magpie web's pages sat in a strip under the header that
scrolled sideways, with nothing to show that more pages lay past its
edge. Agents, Library and the rest looked missing. The pages are now a
tab bar at the foot, as an iPhone app's (HIG): each tab its mark over its
word, the page open marked. Five tabs at most: with more pages than
that, the fifth is More, and its menu lists the rest with their marks
and a tick on the open one. More is marked while one of them is open,
and it carries the dot when one of them has one. phonetabs.js does
this. app.js loads it lazily only on a phone, so the core script
doesn't grow. A status line comes up over the bar. The bar is only for
the window, never the tray panel (body.panel).

Agents still isn't shown in gateway mode on a machine with no agents,
as designed (Settings > General > Gateway mode brings it back). Library
has been shown in gateway mode since f285426ac.

Tests: phone-tabs.test.cjs (new) runs at 390x844 in chromium and webkit,
in en, zh, zh-TW, ja and de, with gateway mode on and off. It checks:
- five tabs with More fifth, at the foot, 44px tall;
- nothing scrolls sideways;
- every page is reached from the bar or from More, and More's menu opens
  above the bar;
- the bar covers no page content and no status line;
- a desktop browser has no More.
reader.cjs gets openPage() (the tab, or More's menu). mobile-web,
phone-no-sideways, routing-held-dot and name-suffix-saved open pages
through it. phone-web checks the bar at the foot. old-webkit lists
phonetabs.js as lazy. market-more waits for the view's own foot, not the
window's, which is now above the bar. group-from-model-add wheels Add
wholly into the view before its press, because at 600x420 WebKit took a
press on Add's half-hidden middle as one on the header.

Run on mote:
- The whole GUI suite once (450 files, concurrency 3). 33 red files
  were then run on this change's base and on the branch. The reds only
  on the branch were the four tests that tapped tabs now under More,
  phone-web's old label check, market-more, group-from-model-add (webkit
  600x420), and the panel tests agent-menu-label, zcode-models and
  panel-fit-tabs (webkit). The panel tests are web:true at 360-380px, so
  the bar's padding reached the panel. It is now scoped :not(.panel).
- After the fixes: phone-web, market-more, group-from-model-add,
  agent-menu-label, zcode-models, panel-fit-tabs, phone-tabs,
  mobile-web, phone-no-sideways, routing-held-dot, name-suffix-saved,
  old-webkit and i18n-keys. All are green except reds already filed on
  main: #5919 (old-webkit :has), #5869 (phone-no-sideways de 375) and
  #5215 (tray-cell-click, a web:false panel test). mobile-web's 900/1280
  desktop screenshots need git, so they were run with BASE_REF set to a
  commit of the base's assets: 30/30 pass in both engines, so the
  desktop is unchanged.
- gofmt, go vet for darwin, linux (nogui) and windows, and go test
  ./internal/gui.
- Again at the pushed head, rebased on origin/main ca7a39291: the 13
  GUI files above (239 pass; reds only #5919, #5869 and mobile-web's
  git-less desktop compare), gofmt, vet on all three, and go test
  ./internal/gui ok. TestCoreScriptBudget was over at the old base
  662546e78 and passes here: app.js is ~430 bytes smaller.
- Rebased again on 388ca9ad4 (two agent commits touching app.js and
  i18n.js): the budget tests, i18n-keys, phone-tabs and phone-web
  pass (34 of 34). Then onto 0baa223ec (Kun; a one-line app.js change)
  with no further run before the push.

Broken by hand:
- Without layoutNav's import of phonetabs.js, phone-tabs is 20 of 24 red.
- Without :not(.panel), panel-fit-tabs (webkit, 5 languages) and
  agent-menu-label go red.

Not tried: a real iPhone's Safari, or the LAN share opened on a real
phone.
2026-11-10 22:10:55 +08:00
yetone 388ca9ad45 agent: Claude Desktop says how to go on with the signed-in chats on magpie (Jacky_yyyyyyyy on X)
Jacky_yyyyyyyy on X asked that connecting Claude Desktop keep the earlier
chats and let them be continued. They are kept already: in 3p mode Desktop
runs in Claude-3p (its own userData), the signed-in profile's Code and
Cowork sessions stay untouched in Claude/, claude.ai chats stay on
Anthropic's servers, and Off brings them all back (57e58595b). What was
missing was how to go on with them while on magpie.

Desktop does that itself. magpie's profile already turns on its 3p
import policy (claudeAiImport.enabled, 5be7d05d2). Read from the app
bundles (2.7032 on this Mac, 4.16336's asar from an earlier scratch, read
only): with it on, Settings → Import offers Claude.ai's chats and projects
(arm "direct": a Claude.ai sign-in inside the importer, remotePull in
getImportCapabilities; or a Claude.ai data export zip, localZip) and this
computer's earlier Code and Cowork sessions (localSessions), copied in
under new ids that run on the gateway, originals left alone.
allowedOrganizationUuids unset (as magpie leaves it) allows any org.

So the notice after On and the opened row's "Once connected" line add:
"To go on with them on magpie, open Settings → Import in Desktop: it can
copy in your Claude.ai chats and projects and this computer's earlier
sessions, and leaves the originals as they are." (noticeClaudedesktop5),
in en, zh, zh-TW, ja, de. CONNECT_COST takes a list of sentences, each
translated. agent-wiring.md says the importer covers Claude.ai chats too.
No mimicry, nothing new written to Desktop's files. The isolated
Claude Magpie app is unchanged (the user's own Claude stays signed in).
app.js paid for the sentence with comments cut, no budget raise.

Run (worktree on origin/main a1ba92ad8; mote refused SSH all session,
so Linux runs went to wsl-run magpie-desktop, Windows to win-run):
- gofmt -l internal/agent internal/gui: nothing.
- wsl-run: go test -run 'ClaudeDesktop|Notice|Desktop' ./internal/agent
  ok; TestEveryNoticeIsTranslated ok; go vet -tags nogui ./internal/agent
  ok; go test -tags nogui -run Budget ./internal/gui ok (it was 140
  bytes over before the comment cuts).
- win-run: go vet ./internal/agent ok.
- GUI, Chromium and WebKit (wsl-run): desktop-history 10+10, i18n-keys
  4+4, agent-connect 2+2, desktop-isolated 11+11, all pass.
Broken by hand:
- Notice without noticeClaudedesktop5: TestClaudeDesktopKeepsTheSignedInHistory
  red ("doesn't say how to go on with the history on magpie").
- The opened row rendering only the first sentence: desktop-history 0 of
  10 in Chromium.
Not tried: a real Desktop importing a Claude.ai account's chats in 3p
(would need a Claude.ai sign-in inside a sandbox Desktop); a darwin go
vet and the macOS run (mote unreachable); the full suite.
2026-11-10 22:01:17 +08:00
yetone a1ba92ad8c library: a market of Pi's packages, installed and removed by pi itself (nineruiing on X)
Library -> Pi now has a Discover list of Pi packages: npm packages with
the pi-package keyword (pi's own docs: the keyword makes a package
eligible for the pi.dev/packages gallery), sorted by monthly downloads,
with search. Like the other markets it ships a 500-entry snapshot
(market_pi.json), keeps a 6h memory and disk cache, and refreshes from
npm. Install and remove run that Pi's own `pi install npm:<name>` /
`pi remove npm:<name>` with PI_CODING_AGENT_DIR set to its folder, so
settings.json's packages list and <agentDir>/npm are written by pi, not
by magpie. Each card says which Pis have it; Install goes straight to
the only Pi without it or asks which one; the Pi's list gets a remove
button behind a confirm. New routes: GET /api/library/market/pi, POST
/api/library/pi/install and /api/library/pi/remove.

Run:
- mote: go test -count=1 -timeout 45m ./internal/library ./internal/cli
  ./internal/gui at this head: ok, ok, ok.
- mote: gofmt -l clean; go vet of library, gui, cli for darwin, linux
  (-tags nogui) and windows: ok.
- mote: library-pi-market, library-pi-extensions, i18n-keys,
  i18n-en-no-cjk in chromium and webkit: 52 of 52; the 17 market and
  library GUI files: 598 pass, 0 fail (pre-rebase tree).
- win-run: go test -tags nogui ./internal/library -run 'TestPi|TestMarket'
  ok (TestPiRunGivesAgentDir skips on Windows).
- wsl-run: library TestPi|TestMarket ok; library-pi-market 22 of 22.
- Real pi 1.5.1 in a sandbox HOME on WSL: PI_CODING_AGENT_DIR=$A pi
  install npm:pi-btw wrote packages ["npm:pi-btw"] beside the existing
  theme and installed node_modules/pi-btw; pi remove put packages back
  to []. The live ~/.pi was untouched.

Broken by hand (each red, then green restored):
- the pi-package keyword filter dropped: TestPiMarketFromNPM;
- the name check dropped in the market: TestPiMarketFromNPM;
- the name check dropped in install: TestPiInstallAndRemove;
- PI_CODING_AGENT_DIR not set: TestPiRunGivesAgentDir;
- the identity dedupe dropped: TestPiInstallAndRemove;
- the installed marking always "live": library-pi-market 11 of 11 red.

Not tried: a real magpie binary driving pi install end to end; pi on
native Windows; git: and local package sources (the market lists npm
only, and the Pi's list still shows and removes them as before).
2026-11-10 21:15:14 +08:00
yetone 10c4dc109a update: a restart by itself waits while magpie's window is in use (BESTLJP0412 on X)
With Restart automatically on, magpie restarted to update as soon as the
gateway was idle, even while the user was adding a provider or changing
settings in its own window, which closed what they were doing.

The page now tells the app it is in use: any pointerdown, keydown, input
or wheel posts /api/update/using (at most every 20s, and at once when a
dialog opens or closes, with whether #modal is open). inUseAt holds a
restart for 2 minutes after the last input (usingFor), or 15 minutes
while a dialog was open at the last input (openFor). waitFor skips the
restart while the window is in use, unless the restart was asked for
(the tray's Restart to update, Settings' Restart now), which still
restarts at once. A `magpie update` from a terminal (restartBeside) waits
the same way. The route writes nothing, so held doesn't drop caches for
it. /api/update says `using`, and Settings' Version row and the Update
pill add "waiting while you use magpie" (en, zh, zh-TW, ja, de).
docs/subsystems/gui-shell.md describes it.

Run (mote, at this head):
- go test -run 'AutoRestart|Wait|Idle|Restart|Using|EveryRoute|CoreScript|Budget'
  ./internal/gui/ ./internal/cli/: ok.
- go vet darwin, GOOS=linux -tags nogui, GOOS=windows for internal/gui
  and internal/cli: ok. gofmt -l: clean.
- GUI, chromium and webkit: update-using (new), every update-*.test.cjs
  and i18n-keys.
- TestCoreScriptBudget: fits with no raise. Main had 40 bytes left, so
  the update code's comments next to this change were cut to one line
  each (no code, every issue and reporter kept): 1,533,641 of 1,533,802.
- One webkit run of update-wait.test.cjs had a red subtest while mote
  needed 10 ssh tries (its output was cut by my grep, so not filed);
  update-wait passed 3 of 3 in webkit at this change and 3 of 3 on
  origin/main 016763f23.

Broken by hand (a separate worktree): waitFor's in-use check made `if
false && …`, restartBeside's !inUseAt dropped, and the page's listeners
given no events: TestAutoRestartWaitsWhileTheWindowIsUsed and
TestTerminalUpdateWaitsWhileTheWindowIsUsed went red, and update-using's
"a restart by itself waits while magpie is used" went red in chromium.

Not tried: the real app on any OS (only Playwright's engines and the Go
tests), WebKitGTK, and a real update downloaded and applied. A dialog
left open with no more input holds the restart for 15 minutes, then it
goes ahead; the wait still gives up after an hour (waitMost) as before.
2026-11-10 21:09:39 +08:00