Commit Graph
85 Commits
Author SHA1 Message Date
yetone 8607a7a029 library: a skill GitHub's limit left unchecked leads to the token's row
A skill check that ran into GitHub's 60-an-hour limit says "Add a
GitHub token in Settings → Network and sharing", in a status line that
fades and a tag's tooltip, and nothing there went to Settings (the
scattered settings audit after netube99 on X). The Not checked tag is
now a link when the limit was the one without a token: it opens
Settings › Network and sharing and lights the GitHub token's row. A
token's own limit has nothing to add there, so its tag stays plain.

github-token.test.cjs swaps its route between rounds with
unrouteAll({ behavior: "ignoreErrors" }): the click leaves Settings'
lazy files being served, and the old unroute made the next round's
handler fulfil a route already handled.

Run (mote, through mote-run): github-token.test.cjs, Chromium and
WebKit, en and zh, 8 of 8; github-token plus every
library-*.test.cjs before the route fix: 1211 pass, the one red that
route race.
Broken by hand: the tag never a link, 4 of 8 red (each limited case).
Not tried: the real app's window; the whole GUI suite runs after the
last of these changes.
2026-11-10 00:01:15 +08:00
yetone 88b541a25c images: every pointer names Settings › Models › Images, where the page is
The image models moved under Settings › Models, but the Library's Magpie
Image sheet, the MCP server's instructions to agents, the gateway's
"no image model" errors, the video tool's text and the docs still sent
users to "Settings › Images", a tab that no longer exists (the scattered
settings audit after netube99 on X). Every user-facing string now names
Settings › Models › Images in en, zh, zh-TW, ja and de, as do the site's
Qwen docs (en, zh, ja), llms-full.txt, the subsystem pages and comments.

Run in the tree with this change and the rest of the audit's fixes
(mote, base cd0ba05c2):
- go vet ./internal/gui ./internal/gateway ./internal/agent
  ./internal/provider ./internal/settingsapi: ok
- go test -run 'Image|Draw|Video|Hidden|Group|Settings' ./internal/gui
  ./internal/gateway ./internal/settingsapi: ok; ./internal/imagemcp,
  ./internal/library, ./internal/catalog: ok
- GUI: i18n-keys, i18n-en-no-cjk, image-models-hide,
  library-browser-setup: pass in Chromium and WebKit
- gofmt -l: nothing
Not tried: a real agent reading the new MCP instructions (text only).
2026-11-09 21:51:53 +08:00
yetone ff7d84b9b2 gui: a built-in's switch, settings and page lead to each other (netube99 on X)
netube99 (X, 2119721422918742222): masking is switched on in Plugins ›
Built-in, set in Settings › Privacy and seen in Insights › Masking, and
none of the three leads to the others. Web search had the same split.
One pattern for every built-in whose switch, settings and page are apart:

- pluginrt.Manifest.SetAt ("privacy #redactList") says where Settings has
  its settings: redact, search, gateway and otel set one. builtins.go
  sends setAt and page (its nav.page Part).
- Its Built-in row (featGo): "Settings › <tab>" and, while on, its page
  ("Masking"). No settings link while off when those settings hide with
  the plugin (Observability).
- Its settings, while off (featOff): a first row "Off in Plugins ›
  Built-in", what being off means, and Turn on. Privacy and Web search
  use it; search's own off row went.
- Insights › Masking's head: "Settings › Privacy", unless Turn off
  already goes there. At 600px and under its buttons wrap below the title.
- docs/subsystems/plugin-runtime.md documents SetAt.

Proposal for the owner, not built: give each feature one home with its
switch, settings and page together. This commit only links the three.

Core budget: no raise. +~1.9KB of code is paid for by shortening six
app.js comments (logo mask shelf, copy, sidebar, account models,
fitSend, the hold room).

Run on mote at fe672ce69's tree (origin/main 2b22425b4 + these two):
- go vet ./internal/gui ./internal/pluginrt ./plugins/...;
  GOOS=linux -tags nogui and GOOS=windows vet of gui and plugins: clean.
  gofmt -l: clean.
- go test -run 'TestBuiltin|TestCoreScriptBudget|Translated'
  ./internal/gui ./internal/pluginrt: ok (budget passes after the cuts).
- node --test builtin-places, websearch-places, builtins, i18n-keys,
  i18n-en-no-cjk: 235 pass, 1 fail. The fail is i18n-keys "a plugin's
  words are its own" on plugins/usage "View routing", red on origin/main
  too (#5332, #5426, #5482).
  builtin-places and websearch-places cover en, zh, zh-TW, ja and de in
  Chromium and WebKit, at 1100 and 420 wide, nothing past the edge.
Broken by hand: featGo and featOff made to return at once, and 40
builtin-places subtests went red (42 fails with their parents). Round 1's
files reverted made websearch-places 102 of 142 red.

Queued, not waited for (owner: push each verified fix at once): the full
`go test -timeout 45m ./...` then `make test-ui` on mote behind
~/suite.lock; log at
~/workspace/projects/magpie-wt/websearch-surfaces-scratch/full.log. Any
red gets an issue.
Not tried: the real app on Linux/Windows; warm-ups have no SetAt (their
settings moved into the provider editor).
2026-11-09 17:58:11 +08:00
yetone f2ac9ae357 gui: web search's three places say what each does and point to the others (netube99 on X)
netube99 (X, 2119707804370084128) couldn't tell how web search is set up:
Plugins › Built-in has a Web search switch, the Library offers search
MCPs, and Settings › Models has Web search, and none of them names the
others.

- Plugins › Built-in, Web search: while on, the row says what it
  searches with ("Searches with Tavily → Brave"), or "Nothing to search
  with yet" in the warning colour (builtins.go searchesNow, featWho.search).
- Settings › Models › Web search: off, its first row says so and turns
  it on.
- Library, a search MCP's card: says agents call it with its own key,
  and links to Settings for magpie's own search.

Tests for this commit (TestBuiltinSearchSaysWhatSearches,
websearch-places.test.cjs) come in the next commit, which generalises
the off row and the links. The record for both is there.
2026-11-09 17:58:11 +08:00
yetone b475004d52 library: Pi's extensions and packages, switched and copied between Pis
leokon3 runs Pi on Windows and in WSL and asked for magpie's Library to
manage Pi's extensions and packages. A new "Pi packages" tab in the
Library lists each Pi here (this computer's and each WSL distro's), with
the extensions and packages it loads, read by Pi's own rules
(@earendil-works/pi-coding-agent 1.4.0). Each has a switch, written as
`pi config` writes it, and a "Copy to…" menu for the other running Pis.

- A package is copied as its settings.json entry; Pi installs it itself
  when it next starts. node_modules is never copied. A local package, and
  one the other Pi already has by Pi's identity (npm name, git host/path),
  is refused.
- An extension file or folder is copied as files, without node_modules,
  .git or symlinks, never over one of the same name. The page says to run
  npm install there when it has dependencies.
- A package that already picks some parts (filtered in `pi config`) shows
  its switch disabled. A settings.json that can't be parsed lists nothing
  and is never written; a stopped distro is never started; every write is
  backed up first.
- GET/POST /api/library/pi, POST /api/library/pi/copy (notYet in the CLI
  parity list, stage 3: the library).

Run at 29d63e2dd (this tree on origin/main c7ebb6f8d; rebased after onto
608c1543e, which changes only internal/gateway), on mote:
- gofmt -l clean; go vet -tags nogui for darwin, linux and windows on
  internal/library and internal/gui: ok.
- go test -tags nogui ./internal/library ./internal/gui ./internal/cli:
  ok, ok, ok.
- A real pi 1.4.0 (npm) in a sandbox HOME and PI_CODING_AGENT_DIR, through
  an uncommitted pireal test: pi -p loads hello.ts (a marker file), the
  switch turns it off (no marker) and on again; a todo folder copied from
  a second Pi's dir is loaded by the real pi; npm:pi-web-access@0.47.0
  copied as a settings entry was installed by pi itself into
  <agentDir>/npm/node_modules and read back as installed v0.47.0; switched
  off, `pi list` still lists it and magpie reads it off.
- GUI, 70 files (library-*, i18n-*, gui-* and the Library's neighbours),
  both engines: 1503 of 1515 pass. The 12 reds are the same on origin/main
  c7ebb6f8d: page-width-steady's 11 (run there alone, 11 of 20 red; #5013)
  and i18n-keys "a plugin's words are its own" for "Use the library's",
  "No session ID" and "View routing" (#5482, #5426, #5332).
  library-pi-extensions runs en, zh, zh-TW, ja and de at 980 and 380px.
On Windows (win-run): go vet with and without the pireal tag ok; go test
-run TestPi ./internal/library ok.

Broken by hand: the first run named the tab "Pi extensions", which a
comment in internal/provider/discovery.go says too, and i18n-keys went
red for it; library-loading went red for the new tab next to RTK while a
Pi is here; and TestEveryRouteHasACommandOrIsNamed went red for the three
routes. All three were fixed and pass in the run above.

Not tried: a real copy between a WSL Pi and the Windows Pi (the WSL side
is covered by the unit tests' fake distro only), the full go test ./...,
and the whole GUI suite.

Reported-by: leokon3 (Discord)
2026-11-09 16:33:28 +08:00
yetone dc098c1e82 library: a skill from a folder follows GitHub once installed from there (biubiu8802 on X)
biubiu8802 (X, 2119602075864903924) downloaded a skill from GitHub and
put it in the Library from its folder, so it had nothing to update from
and no way to link it to GitHub. Installing it from its GitHub link now
links the two, the way an update of a CC Switch skill already does: the
library's skill by that name takes GitHub's files and GitHub as its
source. A check and an update cover it from then on, and the agents'
links keep pointing at it. When its own files aren't GitHub's, they go to
the backups like UpdateSkill's replace does, and the result says so. A
folder of the user's it was linked to stays as it is.

followsHere (skill_link.go) decides it. It links only a skill with no
remote source that wasn't renamed and is that skill: it traces to this
repository (CC Switch, the skills CLI's lock, a git checkout, From), or
it traces nowhere and its SKILL.md has the same description as GitHub's,
as an older download of it does. One traced to another repository, or
an untraced one that describes something else (mora1n's case,
TestInstallSetPutsAnotherByTheSameNameBeside), still goes in beside it
(skill_beside.go). A had skill with
the same files and no source is bound to the GitHub source it was found
in, so a later install of another repository's skill by that name goes
beside it, not over it (TestSameFilesByNameAreHad).

The probe marks such a candidate links:true. The GUI's Add list tags it
"links to GitHub" with a tooltip, and the report names "updates from
GitHub now" and "files of their own kept with the backups". The TUI's
probe list and result line say the same. The new strings are in zh,
zh-TW, ja and de.

Run on mote (macOS), on 64ecd0f69, then rebased on 8a58c0e30, whose
new commits touch none of internal/library, the TUI's library or the
library page:
- gofmt -l clean; go vet ./..., GOOS=windows go vet ./...,
  GOOS=linux go vet -tags nogui ./..., GOOS=linux go build -tags nogui
  ./..., GOOS=windows go build ./... all ok
- go test ./internal/library/... ok at this tree; ./internal/tui/...,
  ./internal/cli/... and ./internal/gui/ ok at the tree before the
  description check (that change touches internal/library only)
- GUI (chromium + webkit, 5 languages, wide and narrow):
  skill-install-link (new), skill-install-beside, skill-install-skip,
  skill-install-agents-all, skill-git-source, skill-too-big,
  provider-discovery, i18n-en-no-cjk pass. i18n-keys' "a plugin's words
  are its own" is red on main for three strings this change doesn't
  touch, already filed: #5332/#5327 ("View routing"), #5482 ("Use the
  library's"), #5426 ("No session ID").

Broken by hand: without the description check (the first version),
TestInstallSetPutsAnotherByTheSameNameBeside is red (caveman taken over).
followsHere returning false always turns
TestFolderSkillFollowsGitHub red (probed As:pdf-pro-biubiu) and
TestOwnSkillFollowsGitHubKeepsItsFiles red (linked [] kept []).

Not run: the full go test ./... suite. mote's suite lock had a queue
waiting up to 16h, so this change ran the packages it touches.
No real GitHub install either: the tests use a fake tarball server. Not
tried on Windows or Linux. The market's had-check (haveSkill) is
unchanged: a market skill with a folder copy by that name still counts
as had.
2026-11-09 11:29:51 +08:00
yetone 4fac4c863b library: a long "In your agents" list shows its first 5 rows
The owner's Skills page listed 52 skills found in the agents, three
lines each, and the list took the whole page. A list of more than 7
now shows its first 5 rows and "Show 47 more" under them; the click
shows every row and "Show less" folds them again, for the session.
Select shows every row to pick, and Bring in all still takes every
one. MCP servers found in the agents fold the same way.

Run on mote at 8935abcf5 plus this change:
- found-fold.test.cjs (new), found-skill-pick-remove, chromium and
  webkit: 32 of 32 ok. found-fold is red on the old client.js (5 of 5,
  chromium).
- before the rebase, at 4f3ec591a: import-all-skills, every-skill,
  library-own-folder, shared-skills, remove-found-skill,
  remove-found-server, view-no-sideways, both engines: ok.
- i18n-keys from the repo root: "a plugin's words are its own" red for
  words this change doesn't touch (#5482, #5426); the rest ok.

A first run after the rebase had found-fold and found-skill-pick-remove
red at load 400-500 on mote; both were 32 of 32 ok at load 50, and the
red run's errors weren't kept.

Not run: the whole GUI suite, other languages than en and zh for the
new button (its words are core keys said in all five).
2026-11-09 09:22:25 +08:00
yetone 2a64b4bcb7 library: a skill router, one magpie-skills skill listing an agent's skills
Like the MCP router, for skills. With the Skills tab's new "Skill
router" switch on (off by default), each agent's skills folder gets
one skill of magpie's, magpie-skills, in place of a link of each skill
ticked for it. Its SKILL.md lists them, each with its description and
the path of its SKILL.md, and the agent reads that file when a task
fits. An agent then carries one skill's description in its prompt
however many the Library gives it.

- The entry is a link to <settings dir>/skill-router/<hash of the
  folder>/, which holds SKILL.md and a hidden .skills/<name> link of
  each listed skill (hidden, so Codex, OpenCode and Pi don't find a
  skill twice). Its description stays within 1024 bytes (Codex's
  limit), cut on a whole character.
- Every skill is listed unless it is kept direct (a button on the
  skill, or `magpie library skill router <name> direct`; carried by a
  sync), is only for the user to type (disable-model-invocation), is
  in ~/.agents/skills, is blocked, or the agent has its own by that
  name. Those keep their own links.
- An agent whose folder can't take it keeps every link, and the page
  says why: given copies, a live agent picking its own, the shared
  ~/.agents/skills, a Library skill called magpie-skills, or a
  magpie-skills of the user's (never written over).
- Claude Code 2.1.316 asks before reading outside its project, its
  skills folder too, so magpie adds Read rules for the entry and the
  folders behind it to permissions.allow, records them, and takes out
  only its own when they go (as permissions.deny does).
- The switch is this computer's alone; `magpie library skill router
  on|off` sets it from the CLI.
- Sessions count a routed read of .skills/<name>/SKILL.md as <name>
  (Claude Code, Alma, Droid), and calling up magpie-skills itself as no
  skill, so a use counts once.
- docs/subsystems/skill-router.md, with a row in the index.

Run at this tree (rebased on origin/main 8f74442e4), on mote unless
named:
- go test -tags nogui ./internal/library ./internal/sessions -count=1: ok
- go test -tags nogui ./internal/cli ./internal/gui: ok at bca122bf9;
  ./internal/gui again at 8f74442e4 (app.js changed there): ok
- node --test of every library-*, *skill*, i18n* and gui-* GUI file
  (96 files), in the Linux VM (wsl-run): mote's browsers didn't start
  while another session's simulators ran. 1678 pass, 11 fail at
  bca122bf9, every red also red on origin/main and filed: library-all
  WebKit (#4967), skill-where WebKit 400px (#5154), i18n-keys' plugin
  words (below), and library-own-folder under load, fixed here. The
  files this change touches, add-partners-shine and i18n-keys again
  at 8f74442e4: 111 pass, i18n-keys the 1 red.
- The router's row under the skill list moved four GUI tests'
  footing, fixed in the tests: remove-all-skills counted it as a skill
  (now rows of lists other than a hub's, as list-sort does);
  found-skill-pick-remove and library-pick-remove's reach only wheeled
  down from above the target, so a Select pushed under the sticky tabs
  or below the fold was never reached (now toward it, over the list,
  and the scroll at rest before the click, WebKit's settled a pixel
  late); library-own-folder's Playwright click scrolled the now
  taller page under load (now a click where the button is). Each red
  on the branch before, 22/22 or 14/14 after, twice.
- skill-router.test.cjs: 22/22 (chromium and webkit, 1100 and 420px,
  en zh zh-TW ja de)
- go vet -tags nogui, GOOS=linux and GOOS=windows: ok
- win-run (xiaomi-gpu) go test ./internal/library: ok but
  TestGoneAgentListedToTakeOut and TestCheckMixedServerEachSide, red the
  same at origin/main 6b0b7a96e and filed in #4115 (run at that
  base; nothing in internal/library has changed on main since). The
  router tests' expected rules were /C:/…; Claude Code's form is
  //c/… (claudePath), which the code wrote, so the tests now ask
  claudePath too.
- Broken by hand: routable returning true is red in TestSkillRouter (a
  skill for the user to type is listed); with the routerSkill check
  out of the sessions reader, TestClaudeRoutedSkillCounted is red.
- Real Codex 0.165.0, sandbox HOME, through the live gateway with no
  sign-in copied: a binary built from this change at 6b0b7a96e ran `library skill
  hand-over`, `skill agents secret-word codex` and `skill router on`;
  `codex exec "What is the project's secret word?"` read
  magpie-skills/SKILL.md, then .skills/secret-word/SKILL.md at the path
  given, and answered PELICAN-7319. `router off` put the skill's link
  back and removed the router's folder.
- Real Claude Code 2.1.316, sandbox HOME, through the live gateway on
  auto/gpt-5.6-luna: that binary wrote the router and two
  Read rules into settings.json (the user's "model" kept). "Check your
  skills for one that fits, then greet me." ran Skill magpie-skills,
  then Read .skills/greet-user/SKILL.md without asking, and answered
  with the skill's words. Without the rules that Read was refused
  (tried earlier with hand-written settings). Not tried on the Claude
  subscription route with this binary: there the live gateway drops a
  skill's body, which the gateway commit before this one fixes.

Known: Alma reads Claude Code's and Codex's folders too, so it may find
several magpie-skills (#5722, not tried with a real Alma).
i18n-keys is red on 3 keys that aren't this change's, the same
on origin/main (#5327, #5332, #5482, #5426).
2026-11-09 08:38:02 +08:00
yetone 4f3ec591ae browser: an extension older than magpie's is to be reloaded, says the sheet and the agent
magpie rewrites the extension's folder when an older one connects, but
Chrome runs what it loaded until the extension is reloaded on
chrome://extensions or the browser starts again, so a user who never does
either stays on the old code. Now that is said:

- Library → Magpie Browser: under "Connected to your browser · 0.1.8" a
  line says "Magpie Browser 0.1.9 is ready: reload Magpie Browser on
  chrome://extensions (edge://extensions in Edge)." Looked at from another
  computer (the zip install), it says to download it again, unzip it over
  the old folder and reload it. /api/library/browser has outdated.
- The agent: the first browser answer on such a connection starts with a
  line telling it to have the user reload it (or download it again, for
  one connected with a gateway key). Once a connection.

The extension still isn't made to reload itself: an unpacked one that
calls chrome.runtime.reload() doesn't come back (the finding in
browser.go's hello).

The fake extension in the gateway's tests now says magpie's own version
(it said 0.1.0, which every test would now be told about).

Run (on mote):
- internal/gateway TestBrowser* (new TestBrowserSaysTheExtensionIsOlder,
  TestBrowserSaysNothingOfACurrentExtension), ok.
- internal/gui TestBrowser* (new TestBrowserStateOutdated), ok.
- GUI: library-browser-setup, library-browser-away, library-browser-ask,
  browser-access, i18n-keys in Chromium and WebKit, every language, at
  1100 and 420 wide: 127 of 128. The red is i18n-keys "a plugin's words
  are its own" for three keys this change doesn't touch, red on main and
  filed (#5332, #5482, #5426).
- go vet for darwin, linux (nogui) and windows; gofmt -l clean.

Broken by hand:
- the once-a-connection check removed: TestBrowserSaysTheExtensionIsOlder
  red ("s1's next answer" has the note again).
- the sheet's line never shown: library-browser-setup red, 20 of 20.
- Outdated without Connected: TestBrowserStateOutdated red.

Not tried: the whole GUI suite before this push (run next), and a real
Chrome with an older extension loaded by hand.
2026-11-09 06:57:40 +08:00
yetone 922cc0ccf8 library: a plugin's tools hidden from every agent from its Plugins row
chengming0v0 (Discord) keeps a plugin for its providers but doesn't want
the MCP server it brings (minimax_query_video_generation and the rest)
shown to agents, and doesn't want to remove the plugin.

Before: a plugin that gives tools is a Library server of its own
(plugin_tools.go), switched per agent with the row's chips in Library ›
MCP, which held through updates and off/on. Nothing on the Plugins page
said so: its line read "Tools for every agent" whatever the Library had,
and an app at the router's address (/mcp/magpie/hub, agent "") was given
every server, ticked for any agent or none, so taking every chip off
still left the tools there.

Now:
- The plugin's tools line says "Tools for agents" or "Tools, hidden from
  agents", with Hide from agents / Give to agents beside the copy button
  (plugins.js, toolsServer in /api/plugins from library.PluginServers).
- PluginServerOn (servers/plugin-on {name, on}) sets Server.Hidden and
  keeps the agents it had in Paused. Hidden, no agent is given it and
  hubServers leaves it out for the router's address too. Give to agents
  gives the kept agents back; with none kept, the router's agents
  (hubAgents), or else every shown agent that can take it.
- It holds through a plugin update, the plugin off and on, an edit in the
  Library editor (SaveServer keeps it) and an agent's "every server"
  (serversAgents with no names skips a hidden one). Ticking an agent for
  it in Library › MCP shows it again (save clears Hidden).
- Library › MCP tags the server "Plugin", its tooltip pointing at Plugins.
- /mcp/magpie/tools (every plugin's tools, wired by hand) is unchanged.
- Docs: plugin-tools.md, mcp-router.md, site docs plugins (en, zh, ja).
- The core script budget is not raised: two plugins.js comments cut, the
  button's tooltips and status lines left out.

Run on mote at this tree (before the site docs, html only):
- go build ./..., go vet ./internal/library ./internal/gui, GOOS=windows
  go vet of both, GOOS=linux go vet ./internal/library: ok.
- go test -count=1 ./internal/library/: ok (187s).
- go test -count=1 ./internal/gui/ -run 'Plugin|Library|Budget|Script':
  ok (TestCoreScriptBudget 1,533,514 of 1,533,802).
- node --test plugin-tools.test.cjs (new: the line's words, Hide and Give
  posting {name, on}, the button inside its row at 980 and 420, all five
  languages, Chromium and WebKit): ok; builtins, every library-mcp-* and
  mcp-* file: ok.
- i18n-keys "a plugin's words are its own": red, the same three words on
  origin/main 61394481c (#5327/#5332, #5426, #5482); nothing of mine.
- library-mcp-first-click: one 1500ms wait red per run (chromium en 1100
  once, webkit zh-TW 1100 once) with several files at once; green alone on
  origin/main 61394481c. Not filed yet; the whole GUI suite comes next.
- site/worker.test.mjs: ok.

Broken by hand: without `!s.Hidden` in hubServers, TestPluginToolsHidden
is red ("hidden: still listed"); without the every-server skip, red at
"every server given to claude".

Not tried: a real MiniMax plugin or the real app; the whole GUI suite and
go test ./... (queued under the suite lock on mote after the push); a Go
test of toolsServer in pluginsState (the GUI test fakes /api/plugins);
Windows and Linux runs.

Reported-by: chengming0v0 (Discord)
2026-11-07 20:14:49 +08:00
yetone a2b552a34b library: a session-start hook can be narrowed to some starts (#5604)
A Library hook on "When a session starts" can now carry a matcher of
starts: one or more of startup, resume, clear, compact and fork (Claude
Code's words, library.HookStarts), joined by "|". NEKO-CwC's case is a
hook that re-injects a file after compaction alone; written whole, it
also ran at startup and once for every subagent fork.

Each agent's format was read from its own source:
- Claude Code 2.1.316 tests the matcher against source, which has all
  five starts. Its entry is written as given.
- Codex (codex-rs/hooks, rust-v0.165.0): SessionStartSource has the
  same five, and a "|" list is read as exact names. Written as given.
- Gemini CLI 0.63.0 has startup, resume and clear only, and its
  matchesTrigger compares the matcher whole. It takes one of those.
- Grok 1.0.67 tells only "new" (fresh, /new, /clear) from "load"
  (resumed). It takes a set that is exactly one of those groups.
- Cursor (cursor-agent 2026.10.01) takes no matcher: its Claude-hooks
  importer warns that a SessionStart trigger matcher "is not supported
  in Cursor, hooks will fire for all triggers".

startMatcher keeps the chosen starts that the agent has. With none
left, the agent is refused; with every one it has, it gets the hook
whole. An agent that can't run the hook at exactly the starts picked is
refused with why, and its chip is greyed, as for any other per-agent
limit. This is the least surprising choice. Widening the hook to every
start would run it at the very starts the user excluded (the fork runs
the issue is about), and a matcher the agent never matches would do
nothing without saying so. SomeHooksAgents (Select) gives a narrowed
hook only to the agents that can run it.

Tool-event validation is unchanged: only tool events take shell or
edit, and only session-start takes starts. check() refuses an unknown
start, a start named twice, an empty part and a wrong case. The matcher
as written is recorded in Applied.Hooks, so an agent's own edit of the
entry is still theirs, and is kept when the hook changes or is removed.

GUI: the editor shows an "At which starts" app menu for session-start
(openProtoMenu, no <select>), with Any start, A fresh session, A
resumed session, After /clear, After the context is compacted, A
forked session and Any start but a fork. HookAgentView.Starts and
StartSources tell the page which matchers each agent takes. A chip that
can't take the matcher greys with one of three reasons, in the editor
and on the row, and save leaves it out. Every new string is in zh,
zh-TW, ja and de. docs/subsystems/library.md's Hooks row says all this.

Run, at 7f60927fd (origin/main 61394481c + this), all on mote:
- go test -tags nogui -count=1 ./internal/library ./internal/backup
  ./internal/davsync: ok.
- GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./...:
  ok. gofmt -l: clean.
- node --test --test-concurrency=4 library-*.test.cjs (57 files)
  i18n-keys.test.cjs, both engines: 1183 of 1186 passed.
  - i18n-keys "a plugin's words are its own" is red for three strings
    already filed: #5482, #5426 and #5332/#5327. My "A new session"
    hit that test too (internal/claudetui says it), so it became "A
    fresh session".
  - library-mcp-json chromium "ja 390" timed out once. It passed 11/11
    run alone, twice. Filed as #5613.

Broken by hand:
- With the old hooks.go, TestHookSessionStartNarrowed and
  TestHookMatcherKeptToItsEvent fail ("session-start can't be narrowed
  to compact").
- With entry() writing no matcher and the sync check skipped, 17
  assertions fail: Claude and Codex are given matcher "", Gemini,
  Cursor and Grok get the hook whole, and no problems are shown.
- With the old client.js, library-hooks.test.cjs fails in every
  language, waiting for .lib-hookstart.

Not tried:
- No real agent ran a narrowed hook. The formats come from each
  agent's source and docs, not from a live session start.
- Old data: a hook saved before this has no matcher and is unchanged.
  A narrowed hook carried in a backup or sync to an older magpie is
  written whole there, because that magpie's sync doesn't check the
  matcher.
- The full go test ./... and the whole GUI suite run after the push,
  as agent-rules.md orders.

Reported-by: NEKO-CwC
2026-11-07 20:14:25 +08:00
yetone 25b201eb67 library: the Skills and MCP headings keep Select and put the rest under ⋯
ryanpascal on Discord: the Library › Skills heading had too many
buttons, up to a dozen beside the sort. The heading now shows the sort,
Select, Clean up and Update n when they apply, and a ⋯ (the app's row
menu, openRowMenu) holding Check for updates, Update all, Group again,
Collapse all / Expand all, Turn all on, Turn all off, By agent, Manage
n in magpie and Remove all, in that order with separators. The MCP
servers heading does the same with Turn all on, Turn all off, By agent
and Remove all. A busy action stays in sight on the bar (Checking…,
Grouping…, Updating…), so the wait is seen. Each menu item is the old
button: its words, its title, greyed when it was, its click; Remove
all is red as it was. No new words: ⋯ is the core's "More".

barMore builds the menu from the buttons as they are when ⋯ is
pressed, so a count or a greyed state is never stale; a hidden button
is left out and the ⋯ itself is hidden when nothing is left.

The tests that pressed these buttons on the bar (by-agent, every-skill,
github-token, library-gone-agents, library-null-agents,
library-servers-bulk, remove-all-skills, skill-fold-all,
skill-git-source, skill-handover, skill-new-in-repo, skill-regroup)
now open ⋯ and press the item. docs/subsystems/library.md says where
the buttons are.

Run (mote, through mote-run):
- node --test library-bar-more.test.cjs: 22 pass (en, zh, zh-TW, ja,
  de at 420 and 1180 px, Chromium and WebKit): nothing moved is on the
  bar, ⋯'s label, one line at 1180, the menu's items and order in each
  language, the menu inside the window, a second ⋯ closes it, Turn all
  off's sheet, Check for updates posting once, the MCP heading's menu,
  no sideways scroll.
- the 12 updated files plus library-bar-more: 176 pass before the
  usage fix below, the 22 reds all library-bar-more's (its second ⋯
  click eaten, the cause fixed in the commit before this; then the
  wide window's tabs, which are the side nav's, fixed in the test).
- skill-manual, list-sort, skill-gone, skill-update-edited, skill-how,
  library-hooks, library-pick-remove, library-row-remove,
  menu-first-second, i18n-keys, i18n-en-no-cjk: 127 pass, 1 fail, the
  "a plugin's words are its own" red that origin/main fe61503e6 has
  (#5327, #5426, #5482).
- the whole GUI suite under the suite lock: 21630 tests, 21295 pass, 335 fail in 63
  files. Those 62 files (i18n-keys apart) again at fresh origin/main
  18a9a2d88 and at this head, concurrency 6: 308 fail at main, 291
  here, in the same files, each with an open issue (umbrella #5475).
  The five red only here (account-arrange, account-mask,
  codex-subagent-model, connect-snippet-shell, ledger-swipe), each
  failing different cases each run, pass 52 of 52 run alone here.

At the pushed head (rebased on origin/main 361da10ee, which brought
77bda84a6's folder Check for updates: its condition and title kept,
the button moved under ⋯ like the rest, and skill-new-in-repo's new
folder case opens ⋯), on mote: the 17 files above plus
skill-new-in-repo, 239 pass, 1 fail, the known i18n-keys red (#5332).

Broken by hand: HEAD's client.js and library.css (the old bar) put
back, library-bar-more red in all 22 cases ("a moved button is still
on the bar", 7 !== 0).

Not tried: the real app with the user's own library; the tray panel
has no Library; keyboard order through the menu beyond the first
item's focus (openRowMenu's, unchanged).

Reported-by: ryanpascal (Discord)
2026-11-06 22:27:09 +08:00
yetone adcb69107c library: a skill set to disable-model-invocation is marked Manual only
sunset3279 on Discord asked to see which skills set
disable-model-invocation: true in their SKILL.md, the ones Claude Code
runs only when the user types /name. parseMeta reads the field into
meta.Manual; the library's rows (SkillView.Manual) and the agents' own
(FoundSkill.Manual) carry it, and the page puts a quiet "Manual only"
tag after the name, its tooltip naming /name and the field. A front
matter that doesn't parse, or a value that isn't a bool, is not known
to be manual: no tag. Translated in zh, zh-TW, ja and de.

Run (mote, through mote-run):
- go test -run 'TestSkillManualFromFrontMatter|TestSkillsFromFolder|TestFoundInLibraryFolder' ./internal/library: ok
- node --test internal/gui/tests/skill-manual.test.cjs: 22 pass, 0 fail
  (en, zh, zh-TW, ja, de at 420 and 1180 px, Chromium and WebKit)
- go test ./internal/library: ok (692s)
- go vet ./internal/library for darwin, windows and linux (nogui): ok
- node --test i18n-keys and i18n-en-no-cjk: 7 pass, 1 fail. The fail is
  "a plugin's words are its own", the same three entries on origin/main
  fe61503e6 (#5327, #5426, #5482); none is a word of this change.

Broken by hand:
- the Manual assignments in sync.go and skills.go taken out:
  TestSkillManualFromFrontMatter red ("deploy: manual false, want
  true", "crlf: …", "release: {…Manual:false…}").
- the manualTag calls in client.js taken out: all 22 GUI cases red
  (null, want 'Manual only').
- an explicit error branch in parseMeta was tried and left out: the test
  passed with and without it, since yaml.v3 decodes nothing on a syntax
  error and leaves a wrong-typed field zero.

Not tried: the real app with the user's own skills; the TUI and CLI show
no mark. A long name clips its tag in a narrow window, as every name tag
in the row does (.row .name is nowrap; #5512); the test uses short names.

Reported-by: sunset3279 (Discord)
2026-11-06 22:22:20 +08:00
yetone 483b131ef0 browser: magpie in Docker uses the host's own browser, through a key the page hands out
noahhrreion ran magpie in a container and its Magpie Browser never
connected. The host's Chrome dials ws://127.0.0.1:3425/v1/magpie/browser/
extension, which reaches the container from the bridge (172.17.0.1). That
is not loopback, so the gateway refused it (403). The browser MCP also
refused every caller from elsewhere, and the hub marked the browser
HereOnly. The extension's folder under the container's HOME can't be
loaded by the host's browser either.

Nothing is opened to the network without a key:

- The extension takes a gateway key: its popup has a Gateway key field,
  and config.js carries KEY (extension 0.1.7). From another computer the
  extension connects only with ?key= of a gateway key that is on, and
  only from the extension's own Origin (checked first). Loopback is
  unchanged, and a page's origin, null, a keyless call or a rebound Host
  are all still refused (TestBrowserExtensionOnlyFromItsOrigin).
- A browser that connects with a key belongs to that key. Sessions are
  tagged key:<id>/... (browserOwner, keyedSession), and a remote caller's
  session is forced to its own key's whatever it names. The relay filters
  every lookup (forSession, all, choose) through browserConn.serves. The
  browser MCP admits a remote caller only with a gateway key; a web page
  is refused as before.
- The key the page makes is recorded as this magpie's own browser's: its
  id goes in settings.Dir()/browser-key, written temp-and-rename. This
  goes by where the key came from, not by its name. A browser connecting
  with it serves this computer's sessions too, so agents inside the
  container use it as they would one on loopback. A record that can't be
  read names no key, so no keyed browser is this computer's.
- Router: magpie mcp browser is HubServer.Keyed. A visitor from
  elsewhere gets it only with a key (HubVisitor.Key), and hubCall names
  its session key:<id>/..., so it reaches only that key's browser.
- GUI: a page whose browser can't reach magpie's folders (InContainer, or
  a page from another computer) is "away". The Magpie Browser sheet's
  button then reads Download the extension. It does a POST to
  /api/library/browser/extension with the page's origin, which answers a
  zip pointed at that origin (3430 passes the gateway's routes on) and
  holding the recorded key's secret. The key is made the first time and
  reused while it is on. The steps (unzip, chrome://extensions, Developer
  mode, Load unpacked) are shown in every language. It is a POST so that
  a link from another site can't mint a key.
- Docs: reference.md (Docker), subsystems/library.md and mcp-router.md,
  and site docker.html in en, zh and ja.

Run, at this tree rebased on origin/main 6302f88bf, on mote:
- gofmt -l, go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./..., and darwin, linux and windows builds:
  clean, all ok
- go test -tags nogui -run 'Browser|Hub|OwnBrowser' ./internal/gateway/,
  and the whole of internal/library, internal/gui and internal/browserext:
  ok (gateway 2.4s, library 166s, gui 104s, browserext 0.3s)
- GUI tests library-browser-away (new: every language, Chromium and
  WebKit, 1100 and 420 wide), library-browser-setup, library-browser-ask,
  i18n-keys and i18n-en-no-cjk: 115 pass. One red, i18n-keys "a plugin's words are its own", is for three
  strings this change doesn't touch and is already filed (#5332, #5426,
  #5482)

Real use, in Docker Desktop on xiaomi-gpu (Windows 11): this tree's
Dockerfile image, run as `web --addr 0.0.0.0:3430` with 3425 and 3430
published to the host's localhost. The host's Node and Playwright Chromium:
- signed in to the page, which says away:true;
- downloaded the zip (GATEWAY "ws://localhost:3530" and a KEY), twice,
  getting the same key both times;
- a keyless /mcp/magpie/browser call from the host got 401;
- loaded the unzipped extension with --load-extension. The container's log
  says "Magpie Browser 0.1.7 connected with gateway key 12d2702a…" and
  /api/library/browser says connected:true;
- an MCP client on the host with that key listed b1 (Chrome 151), opened
  http://localhost:3531/ (served on the host) and read "hello from the
  host";
- a second gateway key made in the container got "isn't connected with
  this gateway key";
- a curl inside the container to 127.0.0.1:3425/mcp/magpie/browser with no
  key listed the host browser's tabs, the host page included.

Broken by hand, each red:
- forSession left unfiltered;
- a remote session not forced to its key;
- no Origin check on a keyed connect;
- hubCall not prefixing the session;
- Keyed given to a visitor with no key;
- the old MCP guard;
- browserKey not reusing the key;
- the away peer check removed;
- serves("") without own (TestOwnBrowserKeyIsThisComputers,
  TestOwnBrowserKeyUnreadable);
- OwnBrowserKey reading the wrong file (the gateway tests and
  TestBrowserExtensionDownload).

Not tried:
- the reporter's own setup (their compose file and Chrome);
- a real agent's MCP client calling the browser from the host. Node's
  fetch sends Sec-Fetch-Mode: cors, which fromBrowser counts as a web page
  and refuses. The e2e used node's http instead. Whether an agent's MCP
  client built on fetch is hit by this is not checked; filed as #5522.
- Edge, Brave and Firefox;
- a remote page over https/wss through a proxy.

What the user does: update magpie and publish 3425 and 3430. In the web
UI open Library -> Magpie Browser -> Download the extension, unzip it and
Load unpacked in chrome://extensions. An extension 0.1.7 already loaded
can take the address and key in its popup instead.

Reported-by: noahhrreion (Discord)
2026-11-06 20:06:15 +08:00
yetone 77bda84a6f library: a check offers the skills a git repository or folder added since
refeccd (Discord): skills added from a repository or a folder only had
the existing ones updated; ones the source added later never reached
the library. GitHub sources already had this (findNew); git repositories
on other hosts and folders on this machine did not, and a folder install
didn't even remember the folder it came from.

- git: when ls-remote gives the ref a head, findNewGit reads the fetch
  the check shares and offers skills under newBase that the library
  doesn't have and hasn't offered. Once per head while its finds are
  kept (gitLooked). The address is kept as the library has it (.git and
  all), so an Add lands on the same repo@ref key.
- folder: an install from a folder now records "folder:<path>" in
  SeenSkills (offered), which is how the library knows where to look
  again. findNewFolder reads it as Add from folder does and skips a
  folder the library links, has offered, or has a skill by that name of.
- A check never adds or writes a skill: each is offered with Add and
  Ignore, as GitHub's are. A skill the user removed or set aside isn't
  offered again, and a folder edit is never written over.
- View.CheckFolders shows Check for updates with only linked skills and
  makes checkDue true; its title says it looks in folders too. A find's
  row shows its folder (pathLink) or git address. The old head note
  ("on GitHub beside skills you have…") is gone; the new title is in all
  five languages.
- docs/subsystems/library.md says so.

Old data: a folder added before this kept no folder: key, so it is
looked in only after the user adds from that folder once more (the
picker then lists the new skills, and the install records the folder).

Run (mote, at fcc0daa23 plus this change):
- gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...; go build ./... and the CGO_ENABLED=0
  nogui build: ok.
- go test ./internal/library: ok. go test ./internal/gui: ok except
  TestPanelHiddenByWailsMarksPageOutOfSight (#5322) and
  TestMainWindowCorners (#3949), both red the same on origin/main
  19c45d5d4 run alone.
- GUI, both engines: every library-*, skill-*, github-token,
  plugin-check-*, plugin-git, i18n-keys, i18n-en-no-cjk, gui-de,
  gui-ja, gui-zh-tw file: 1526 of 1529. Reds: i18n-keys "a plugin's
  words are its own" (#5332, #5426, #5482, red on origin/main) and
  skill-where "the switch scrolls nothing", flaky on origin/main
  19c45d5d4 too (1, 0 and 2 reds in three runs; noted on #5154).
  skill-new-in-repo's new folder case runs en and zh at 860 and 440px.

At the pushed head (rebased on origin/main 94d4866b5), again on mote:
go vet of internal/library and internal/gui, go test ./internal/library
ok, internal/gui's Budget/Size tests ok, skill-new-in-repo 4 of 4 and
i18n-keys with only the known red above.

Broken by hand: with the git branch of CheckSkills and lookInFolders
off, TestCheckSkillsFindsNewInGitRepo and TestCheckSkillsFindsNewInFolder
fail ("new: []"); with offered() not recording the picker's shown
skills, both fail offering what the picker showed ([review], [xlsx]).

Not tried: a real GitLab or intranet repository (the test uses a local
file:// bare repo with the real git); the CLI and TUI, which don't list
new skills; the Windows and Linux boxes.

Reported-by: refeccd (Discord)
2026-11-06 19:50:40 +08:00
yetone de0f5691a8 library: a Remote magpie's MCP server says why it isn't synced, its switch held off
treeman_26897 (Discord), on v0.1.3135: the MCP server added from a
Remote magpie can't have "Sync to your other computers" turned on. That
is meant: the server holds this computer's key for that Remote magpie
and goes with the provider, so adoptBridges keeps it Local. But the
editor showed a live switch: it turned on, Save took it, and the next
read put it back off, with nothing saying why.

Now a server with a bridge has the switch off and held (aria-disabled,
a click does nothing), and the field's hint and the row's "Not synced"
tag say "Added from a Remote magpie with this computer's key for it,
so it stays on this computer", in every language. A server edited to
another address or key is the user's own (keptBridge drops its bridge)
and its switch works as any other's. Nothing changes in Go.

Run (mote, at this tree):
- node --test mcp-local-server (Chromium + WebKit, en zh zh-TW ja de,
  1100 and 390 wide): 22 of 22 ok.
- node --test i18n-keys: ok but "a plugin's words are its own", red the
  same on origin/main and filed (#5332, #5426, #5482; none of its three
  words are this change's).
- node --test library-mcp-*, mcp-*, library-all, library-items,
  library-servers-bulk, library-toggle-status, old-webkit: 480 of 480 ok, both engines.

Broken by hand: origin/main's library client.js under the new test:
red in every language at the tag's title ("Sync never carries it to
your other computers") and, with the hint and title checks taken out,
at "a click doesn't turn it on" ('true' !== 'false').

Not tried: the real app with a real Remote magpie's server; the test
fakes /api/library with a bridge server.

Reported-by: treeman_26897 (Discord)
2026-11-06 17:03:42 +08:00
yetone f285426ac2 library: the MCP router turns on with no agent, and in gateway mode
treeman_26897 on Discord runs magpie as an MCP entry point for remote
clients on a server with no agents. The router could only be turned on
from the Library, and the Library said "No agents to write to" with no
agent. In gateway mode (magpie web on a headless server, on by itself
with no agents) GATEWAY_HIDES left the Library out altogether. The
router's switch also showed only once a server was in the library. The
gateway and `magpie library mcp router on` had no agent gate: the gate
was the page's alone.

Now, with no agent to write to, or in gateway mode (where no agent is
shown), the Library is its MCP tab alone (`agentless` in client.js):
- servers without agent chips, found servers or projects;
- the router's switch, there before the first server too;
- its lines and status say any app connects at its address, the
  router is on or off;
- the servers it serves are checked once it is on;
- Connect… has Other apps alone, with the gateway key line.
Gateway mode hides only Agents now. The two keys of the empty state
are gone; the gateway-mode subtitle no longer says "no Library".

Remote use goes through the guard /v1 has, unchanged: lanGuard and
serveMCP. TestHubMCPRemoteEntryNeedsKey holds /mcp/magpie/hub to it
from another computer: not shared 403; shared with no key 401 (no
Origin, tools/list, a wrong key); Origin null, chrome-extension://,
file://, moz-extension://, a foreign site and another computer's page
refused from there and from here; a rebound Host with a browser's
marks (Origin = Host, Sec-Fetch only, a Mozilla UA) refused from
here and there; a proxy or tunnel here (X-Forwarded-For,
Cf-Connecting-IP) with no key refused; nothing ran for any of them;
with the key it runs, through the proxy too.

Run on mote at ef20ff690 (on origin/main b4799a6bb); rebased again on
6a78060c6 (gateway.go changed there), the gateway's Hub and LAN tests
and the Budget test ran again ok:
- go test -tags nogui ./internal/gateway -run Hub: ok
- go test ./internal/gui -run Budget: ok (no budget raised; the core
  scripts were 137 bytes over with a longer comment, cut back)
- gofmt -l clean; GOOS=linux and GOOS=windows go vet of gateway, gui: ok
- GUI, both engines, every language: library-mcp-agentless (new, 22
  of 22), gateway-mode, last-page, library-mcp-hub, mcp-hub-direct,
  library-servers-bulk, i18n-keys: 87 of 88; the red is i18n-keys
  "a plugin's words are its own", below.
- Before the rebase, the GUI files a change here can reach (every
  library-*, gateway-mode*, last-page, i18n-*, mcp-hub-direct,
  agent-prefs, bare-ids, images-library-way, search-/vision-mcp-library,
  gateway-conversations; 70 files): 1535 of 1536. The one red is
  i18n-keys "a plugin's words are its own", on main already: #5327,
  #5332, #5426 (files this change doesn't touch).

Broken by hand:
- library-mcp-agentless against origin/main's client.js and app.js:
  22 of 22 red (no router row with no agent; no Library tab in
  gateway mode).
- rebound() returning false and serveMCP's Origin check off:
  TestHubMCPRemoteEntryNeedsKey red on the rebound Host cases and on
  chrome-extension://, file:// and moz-extension:// from here. The
  test passes on the old Go code: the guard was there already.

Not tried: a real remote MCP client against a headless magpie serve
or magpie web on another machine; the TUI (it has no Library page of
its own for the router; the CLI's router on needs no agent).

Reported-by: treeman_26897
2026-11-06 12:12:20 +08:00
yetone 326e72f4c5 routing: the "No session ID" group folds like the others, and one button folds or opens every group (zzzkl on Discord)
zzzkl: the Routing page's 未提供会话标识 group couldn't be collapsed. Its
head was a div with no click handler, no arrow and no aria-expanded,
because only a group with a key could be folded (`g.key ? "button" :
"div"`). closedSessions is keyed by the group's key, and "" is a key a Set
holds, so the no-session group now uses the same button, arrow and
handler as the rest.

Also, as asked: an icon button in the request list's existing header row
(.rt-fold-all, beside Replay) folds every group while any is open, and
opens them all otherwise. It shows only when the list is grouped (by
session or by key) into two or more groups. It has a tooltip and an
aria-label only, no text: "Collapse all" / "Expand all". Those two words
moved from plugins/library/i18n.js to the core i18n.js (zh, zh-TW, ja,
de), since Library and Routing now both say them (i18n-keys: a word used
by two plugins is the core's). The core script budget doesn't count
i18n.js or plugins/, so it isn't raised.

routing-sessions and inner-scroll-contain found group heads by
`button.rt-session` with a key; they now filter .rt-session by text, as
the no-session head is a button too.

Run (mote, node --test, Chromium + WebKit):
- routing-fold-all.test.cjs (new): 2 engines x 1100/420 x en, zh,
  zh-TW, ja, de. It covers the no-session group folding on click, the
  fold-all button folding then opening every group, its tooltip in each
  language, and it being hidden with one group.
- i18n-keys, i18n-en-no-cjk, routing-sessions, inner-scroll-contain,
  skill-fold-all, routing-row-swap, routing-rule-drag,
  routing-order-unknown, routing-many-keys, in one run at concurrency
  3 with routing-fold-all: 170 tests, 157 ok, 13 red. Every red is also
  red on a clean origin/main 8bfc551ee checkout run alone (concurrency
  1, 42 tests, 14 red), and each already has an issue:
  i18n-keys "a plugin's words are its own" ("View routing", "No session
  ID" said by Go tests, #5332), routing-many-keys "2 keys in sight"
  (#4082), routing-order-unknown webkit de 420 (#4627),
  routing-row-swap (#3799), routing-rule-drag chromium (#3789, #5088).
  routing-fold-all, routing-sessions, inner-scroll-contain,
  skill-fold-all and i18n-en-no-cjk are all ok.

Broken by hand: on the old client.js, routing-fold-all fails with "the
no-session group can't be folded" (and finds no fold-all button).

Not tried: the real app's WebKitGTK on Linux, or Windows WebView2.
2026-11-05 22:07:46 +08:00
yetone 06508f2bf5 library: a stdio server that refuses home is checked again in a project folder (fff)
math_milian on Discord: fff-mcp worked in their agent, but Library → MCP
said "fff exited (1)". fff-mcp indexes the folder it starts in and
refuses a file system root or home ("Can not run certain FFF features in
a file system root or home directories"), exiting 1. magpie's check
starts every stdio server in home (#1727), where agents never start it;
they start it in their project.

When a local check exits, it now starts the server once more in an empty
project folder of its own (removed after). If it answers there:
- given to agents that start it themselves (no router, not Codex on
  magpie, or hub "direct"), the row shows its tools, and the tooltip says
  it exits in home, with what it said;
- run by magpie in home for agents (the MCP router, or Codex on magpie's
  RunPath), the row says "won't start in home" (why "home"), and its
  editor offers "Through the MCP router" to turn off, even with the router
  off, so each agent starts it in its project.
A server that exits in both places reads as before. WSL checks are
unchanged. healthKey (Go and client.js) now includes whether magpie runs
it in home, so a router change checks it again. startServer takes the
dir; the hub and the RunPath runner still pass home.

Run:
- go test -count=1 -timeout 30m ./internal/library on mote: ok (159s).
- TestCheckServerThatRefusesHome red on the old code: State error, Why
  exited, Code 1, with fff's text, the reporter's case.
- Real fff-mcp 0.11.0 (cargo-built on mote, sandbox HOME resolved through
  /private/var) via CheckServer: direct ok, 3 tools, Project; router on,
  Why home, Code 1.
- go vet ./internal/library ./internal/gui (darwin), GOOS=windows and
  GOOS=linux go vet ./internal/library on mote; gofmt -l clean.
- GUI on mote, Chromium + WebKit: mcp-home-health (new, every language,
  1100 and 390), library-mcp-health, mcp-hub-direct, library-mcp-hub,
  library-mcp-health-wsl, i18n-en-no-cjk, i18n-keys: 91 of 92 ok. The red
  is i18n-keys "a plugin's words are its own" on search_row_archive_test.go's
  "View routing", red on main since 73c98ebc2 (#5327, #5332).

Broken by hand: the new test run against the old mcp_check.go (red as
above).

Not tried: Windows and WSL runs; a real agent session through the router
or Codex's RunPath; the whole GUI suite.
2026-11-05 14:50:02 +08:00
yetone f280b12e51 library: the Copies note says an edit in a copy goes to the library and the other agents
The note under "Give skills as: Copies" on the Library page said edits made
in a copy are replaced. Since takeEdits (internal/library/skill_edits.go,
TestSkillCopyEditReachesTheOthers) the opposite is true: a sync takes the
newest edit made in an agent's copy into the library and gives it to every
other agent; one that loses to a newer change is kept with the backups.
The note now says "An edit made in a copy goes into the library and to the
other agents.", in en, zh, zh-TW, ja and de (zh-TW's old text also had a
Simplified 里). site/public/docs/library.html and its zh and ja pages
already say this; unchanged.

Not changed: the project card's "Copy files instead of linking" note
("edits made to them are replaced") is right. Project copies are not
targets of takeEdits; Project.place makes a copy again from the library's
whenever it differs (copyIsFresh), so an edit there is replaced.

Run on mote (mote-run) at this tree, rebased on origin/main 6bef4fe04:
- node --test, Chromium and WebKit: skill-how (asserts the note's exact
  text in en and zh), i18n-keys, i18n-en-no-cjk, gui-zh-tw, gui-ja,
  gui-de, skill-where, shared-skills, skill-off-here-fits, library-all:
  99 of 99 pass.
- go test -run TestCoreScriptBudget -v ./internal/gui: PASS.
Not run: the whole GUI suite (a string-only change in one plugin file, no
new API, selector, class or layout), the Go suite (no Go change). Not
broken by hand: skill-how compares the note's text exactly, so the old
text fails it by construction.
2026-11-04 22:56:19 +08:00
yetone 7564e46690 library: a subagent names its model, written into Codex's role as model (#4421)
luckymanjc (Discord) set Codex's subagent model to Default on the Agents
page and gave a Library subagent a prompt that named a routing group.
Codex knew the group's name, but the subagent ran on Codex's own model.
A Library subagent had no model field, and Codex's role file
($CODEX_HOME/agents/<name>.toml) got only name, description and
developer_instructions. So Codex started the subagent on the model the
lead passed in spawn_agent, or on the lead's own model. The group was
only text in the prompt.

codex-rs reads a role file's model (AgentRoleOverrides). In
child_config.rs, prepare_agent_spawn_config applies the lead's
spawn_agent model, or [agents] default_subagent_model, first, and then
the role. So the role's model wins. A subagent now has a Model field: an
app menu with "Picked by the agent", the models and routing groups Codex
lists (groups noted as a routing group), and a saved id Codex no longer
lists. The Model is written as model = "..." to Codex's role only. A
subagent without a Model is written as before, byte for byte. Other
agents' files don't change; the hint names the agents that don't take
it. When the Agents page's Codex subagent model is set, the gateway still
puts that in place of the role's model (codexSubagentPick), and the hint
says so.

Run:
- Real codex 0.165.0 on mote, sandbox CODEX_HOME, fake Responses
  server. With no role model, the collab_spawn request carried the
  lead's model. With model = "group/review" in the role, it carried
  group/review, also when the lead named gpt-6-sol in spawn_agent.
- mote-run go test ./internal/library: ok. TestSubagentModelGoesToCodex
  went red with codexRole given "" for the model by hand.
- GUI library-subagents.test.cjs: 12/12 in Chromium and WebKit, in en,
  zh, zh-TW, ja and de. Red with origin/main's client.js (timed out
  waiting for the model picker).
- i18n-keys 4/4: it was red at first, because the plugin defined
  "Routing group" and "Find a model". The change now uses core's
  "routing group" and "Find a model…".
- gui-zh-tw, gui-ja, gui-de, library-all, library-gone-agents,
  library-wsl-asleep: ok.
- gofmt -l is clean. go vet, GOOS=windows go vet, and GOOS=linux go vet
  -tags nogui on internal/library and internal/gui: ok.
- go test ./internal/gui: only TestMainWindowCorners/macOS_26_SDK is
  red. It is red alone on origin/main 93d5c76c0 too: #3949.

Not tried: a real magpie gateway with a real routing group end to end,
the Codex app or IDE extension, and Windows and Linux runs. A
reasoning effort per subagent, and a model for Claude Code, OpenCode,
Droid and the other agents, stay open in #4421.
2026-11-04 21:18:56 +08:00
yetone 93d5c76c0d router: an agent with many tools is given them on demand
ArvinCharl on X: the MCP router's tools fill the context. An agent that
doesn't search its MCP tools itself (all but Claude Code, Claude
Desktop, Codex and Pi) sends every tool's whole schema on every
request. Given more than 10 router tools, such an agent now lists two in
their place: find_tools (matches by name and description, the first 5
with their inputSchema, 15 more by name) and call_tool (runs one by
<server>__<tool>, its bare name, or arguments sent as a string; an
unknown name is told the close ones). The instructions still name every
server and its tools, and a tool called by its own name still runs. The
request log names the tool call_tool ran. The address for any other app
lists every tool, since which app connects isn't known.

Library → MCP gains a "Tools on demand" toggle (settings
routerAllTools, kept by KeepOwn and the settings API); turned off,
every agent gets every tool whole as before.

Run on mote (after the rebase onto 083821dc9: gateway vet, -run
'Hub|MCP|Settings|Search' and the four GUI files again, ok, 70 of 70):
- gofmt -l: empty. go vet, GOOS=linux go vet -tags nogui, GOOS=windows
  go vet of gateway, settings, settingsapi, gui, library: ok.
- go test -tags nogui -count=1 -timeout 45m ./internal/settings
  ./internal/settingsapi ./internal/gui ./internal/library: ok;
  ./internal/gateway -run 'Hub|MCP|Settings': ok.
- GUI (Chromium + WebKit, every language): library-mcp-router-tools,
  library-mcp-router-note, library-mcp-hub, i18n-keys: 70 of 70.
Broken by hand: hubOnDemand forced false turns TestHubMCPToolsOnDemand
red.
Not tried: a real OpenCode or Gemini CLI session against the router;
the full gateway package and full GUI suite.
2026-11-04 21:00:51 +08:00
yetone 50265256ba library: a note on a skill or an MCP server, the library's own (youyo.p_10001)
youyo.p_10001 on Discord: with many skills and MCP servers installed,
you can't tell what each is for or which to use. A skill has the
description its author wrote for models, often in English and about
what it does, not why you installed it. An MCP server has nothing but
its command and its tool list. So each now takes a note in the user's
own words.

- Server.Note and Skill.Note in library.json: one line of at most 200
  characters, whitespace run together (checkNote), as a hook's
  description (#2011). A longer one is turned away, not cut.
- The server editor has a Note field under the name. A skill's reader
  (2a19043af's file reader) has one over its files: Save shows once it
  changes, saves the file being edited with it, and a changed note is
  asked about before the dialog closes. SkillNote, POST skills/note.
- A row shows the note in place of its command or description, so rows
  keep their height; the tooltip gives the note, then that line. The
  skills' filter matches notes.
- No agent is given a note: not in any agent's MCP entry, a project's
  file, the MCP router's list or a skill's copied SKILL.md.
- A sync carries it (CarriedSkill.Note; a server goes whole), and
  clearing it is carried too. An older magpie on another computer
  doesn't know notes: a bundle it writes has none, so a sync from it
  clears them. The TUI's server editor keeps a note as it was.

Run at the pushed head:
Run at the pushed head (on origin/main f168dd278, then
rebased onto 94d0fbfcd, whose two commits change only
migrate_zcode.go and the searcher-pick test):
- mote: go test -timeout 45m internal/library (TestNoteNeverGiven,
  TestNoteCarried, TestNoteTooLong), gui, tui, davsync, backup: ok,
  except internal/gui's TestMainWindowCorners/macOS_26_SDK, mote's SDK
  (#3949). GOOS=windows go vet of library, gui, tui and GOOS=linux of
  library, tui: clean. gofmt -l: clean.
- mote, both engines, every language, narrow and wide: skill-edit (the
  skill reader's note), library-mcp-json (the server's note, its row and
  the filter), mcp-editor-cancel, library-mcp-win-line, market-address,
  market-have, i18n-keys: 108 of 108.
- WSL, the whole GUI suite: no red in a library file that origin/main
  hasn't too (see the command commit; #4120, #4471 for the rest).
- "Note" is in core i18n.js, not the plugin's: agent code says it as a
  word. The rebase had dropped main's title on a server row's command
  line (library-mcp-win-line went red); it is back, and with a note the
  tooltip gives the note, then that line.

Broken by hand, each red, then restored:
- add("note", s.Note) in Claude's MCP format: TestNoteNeverGiven
  (.claude.json held the note).
- the carry of Note left out: TestNoteCarried.
- note left out of the server editor's save: the GUI test, 22 of 22.
- notes left out of the skills' filter text: the GUI test, 22 of 22.
- the note's save left out of the skill reader's Save: skill-edit, 22
  of 22 (Save never goes away).
- the note left out of the reader's unsaved check: skill-edit, 22 of 22
  (closing never asks).

Not tried: a real sync between two computers, a real agent reading its
config (the guard reads every file magpie writes in a sandbox HOME), a
real app window, Linux WebKitGTK.
2026-11-03 21:43:54 +08:00
yetone a80575cc86 library: an MCP server's command wraps, and the editor shows the server as JSON (hema_17384)
hema_17384 on Discord: in Library > MCP servers, the editor's Command
field was one line, so `npx -y universal-db-mcp --type sqlserver --host
... --user sa --password ... --database ...` was cut off, and they asked
to see and edit the server as JSON.

- The command is a box that wraps (lineBox, a textarea of one row that
  grows with autosize). It is still one line: Enter saves, Escape
  closes, and a newline is a space between words (a shell's \ before it
  too, except on Windows, whose lines keep their backslashes). At 390
  wide it wraps over several rows; nothing scrolls sideways.
- The editor's head has a Form | JSON switch (the app's segmented
  control, not a <select>). JSON is the server as Copy config gives it
  for Claude Code: {"mcpServers": {name: {type, command, args, env}}},
  or {type, url, headers} for a URL, with ${NAME} references as written.
  An edit there is read as a paste is (serversIn) and becomes the form's
  at once. JSON that isn't one server's marks the box invalid, says so,
  and keeps the dialog from saving or going back to the form, and
  counts as unsaved for Cancel. The agents, sync and the startup
  timeout and OAuth app stay in the form and are kept as they were.
  ⌘/Ctrl-Enter saves from the box; a paste into it is the box's, not
  the dialog's "paste a README's JSON".
- Strings in en, zh, zh-TW, ja and de.

Run at the pushed head (on top of the note commit, which shares these
files):
Run at the pushed head (on origin/main f168dd278, then
rebased onto 94d0fbfcd, whose two commits change only
migrate_zcode.go and the searcher-pick test, with the note commit
on top, which shares these files):
- mote: go test -timeout 45m internal/library, gui, tui, davsync, backup:
  ok, except internal/gui's TestMainWindowCorners/macOS_26_SDK, mote's
  SDK (#3949). GOOS=windows go vet of library, gui, tui and GOOS=linux of
  library, tui: clean (internal/gui's Linux vet needs gtk3 and ran clean
  on WSL before the rebase, with no Go change since). gofmt -l: clean.
- mote, both engines, en/zh/zh-TW/ja/de, 390 to 1100 wide:
  library-mcp-json (new), mcp-editor-cancel, library-mcp-win-line,
  market-address, market-have, skill-edit, i18n-keys: 108 of 108.
- WSL, the whole GUI suite (before this rebase, at the same change):
  541 subtests red in 57 tests, the WSL baseline (#4120, #4471). Those
  in library files are red on origin/main too, run side by side:
  found-skill-pick-remove (#5013, #4097), library-mcp-hub (#4483),
  market-more (#5076), library-chip-fan (#3072), library-mcp-tools ja
  420 (#4693). market-address and market-have were mine: they still
  looked for the command's <input>; they find textarea.lib-cmd now and
  pass 32 of 32 on WSL.
- "Form" is in core i18n.js, not the plugin's: agent code says it as a
  word, which i18n-keys turns away in a plugin.

Broken by hand, each red, then restored:
- .lib-cmd back to white-space: pre: "the command scrolls sideways".
- the command field back to an <input>: the new test and
  library-mcp-win-line fail (28 of 28).
- save without the JSON check: the "isn't an MCP server's JSON" error
  never shows and the broken JSON goes to save.
- (wrap="off" on the textarea alone stays green: the CSS's pre-wrap
  wins, so the CSS is the guard.)

Not tried: a real magpie app window (the GUI tests fake the API), the
reporter's real server, Linux WebKitGTK.
2026-11-03 21:43:54 +08:00
JoeyWu-tech c0dd5838c2 library: the write-failure card can be hidden until a new failure (#3745)
Zachary-wW (#3745): the Library's "Some of the Library couldn't be
written" card had Try again and nothing else. Their Grok Build has an
AGENTS.md magpie can't stat, and every change writes every agent again,
so the card stood over the page through every edit on the Instructions
tab, with no way to put it away.

The card has a × beside Try again now, named "Hide until something new
can't be written". It hides the write failures the card lists, on every
tab, and sends nothing. The page keeps what was hidden by agent and item
("grok" and "instructions"). After every answer, a read or a change, it
lets go of a hidden failure that no longer stands, and a failure not
hidden brings the card back with all it lists; so does a hidden one
whose item was written in between and fails again. So the card stays
hidden while the reporter keeps editing, though each change fails on
Grok Build's file again, and a new write error shows it again.

The key is not the error's text: a write goes through a temp file named
anew at each try (edit.WriteAtomic), so a folder that can't be written
fails with a new text at every sync, and the card would never stay
hidden. Meanwhile each change's toast still names what failed, as
before, and a skill that couldn't be given keeps the dot on its agent's
chip. The list magpie keeps (lastProblems) is not touched. The × is
named by its title, as the Library's other × buttons are.

An agent's own skills in the library's way are the agent's to settle,
not failures: they stay, under their own title, with no ×. The view
keeps its scroll as the card goes, as render() keeps it for Try again;
Chromium's scroll anchoring moved it. From the keyboard the focus goes
to the card's next button, or to the tab open. On a phone the × is 44px
wide and as tall as Try again. The card's title keeps its words whole:
with less than 10em beside it, Try again and the × go to a line of their
own (beside them, a German title at 320px broke "Bibliothek" and
"geschrieben" inside).

library-problems-hide.test.cjs is new. Its API answers as
internal/gui/library.go does: a change's problems are its full sync's,
an Instructions change keeps the rest and puts its own in, and a read
gets the list with no result. Its error texts are the ones magpie's own
sync gave in a sandbox HOME, through Handler in a scratch Go test (not
kept): Grok Build's AGENTS.md a link into a folder magpie can't search,
its folder read-only, and its skills folder read-only.

Not covered: what was hidden lasts as long as the page, so a reload
shows the card again. The × hides, it doesn't fold: while the card is
hidden, its error texts and Try again are out of reach, though any
change writes every agent again. An agent's instructions, and its whole
MCP file, have no mark of their own as a skill's chip has, so with the
card hidden only a change's toast names their failure (#3987).

What was run (tree f98a4b99, on origin/main f8cd964a, go1.26.8,
linux/amd64, Linux 5.15), outside graftcp, umask 077:

  library-problems-hide.test.cjs, Node's runner with Playwright 1.58,
  Chromium and WebKit, three runs each: 16 of 16 pass in every run (15
  cases and the file's own)
  Without this change (f8cd964a's client.js, i18n.js and library.css,
  the new test kept): 16 of 16 red in both. Broken by hand, one at a
  time, Chromium and WebKit unless said:
    any change that fails at all brings the card back (the first
    draft's rule): the reporter's case, the same failure under another
    error and a hidden failure written since, red
    a change's failure not hidden brings it back, nothing let go: a
    hidden failure written since, red
    a new failure never brings it back while anything is hidden: a
    failure not hidden, a hidden failure written since and another
    window's change, red
    the key with the error's text in it (Chromium): the same failure
    under another error, red
    the × writes every agent again (Chromium): 9 red, the reporter's
    case among them
    the view's scroll not kept as the card goes: 9 red in Chromium,
    green in WebKit, which keeps it without
    the × 44px wide on a phone taken out (Chromium): the five locales'
    "named and inside the card", red
    the head as the draft had it, no wrap and the title shrinking: de,
    red
    the focus moved without preventScroll (Chromium): green, 16 of 16;
    no test here tells it apart
  Library and siblings, Chromium and WebKit: 69 files, the Library's
  own tests, the skills' and market's that share its page, gui-de,
  gui-ja, gui-zh-tw and i18n-keys: all pass but two, red the same at
  f8cd964a without this change: i18n-keys "a plugin's words are its
  own", fixed on main since (#3897), and title-bar-tools (Chromium de,
  WebKit all five locales: a locator.waitFor timeout)
  TestCoreScriptBudget: ok (the Library is a plugin, outside the core);
  on origin/main c752082e with this commit applied too (a scratch
  worktree, not this tree)
  On origin/main e9dd8e83 with this commit applied (a scratch
  worktree, not this tree), Chromium and WebKit:
  library-problems-hide, i18n-keys, library-items and
  library-instr-busy, 66 of 66 pass
  gofmt -l of every .go file: nothing. GOOS=linux, windows and darwin
  go vet -tags nogui ./..., GOOS=windows go vet ./...: exit 0.
  GOOS=linux and darwin go build -tags nogui ./..., GOOS=windows go
  build ./...: exit 0. Untagged linux vet and build stop at pkg-config
  (no libsoup-3.0 or gio-unix-2.0 here)
  full suite, go test -tags nogui -count=1 -timeout 45m ./... (8m25s,
  load 35 at its start, Bun 1.4.2): 68 packages ok, reds in 8, none
  in internal/gui's library code:
    internal/agent TestInstalledVersion, TestZedAppPath,
    TestCursorFolderFromTheEditorIsNotTheCLI,
    TestCopilotFolderFromAnIDEPluginIsNotTheCLI,
    TestQoderSettingsFromAnIDEPluginIsNotTheCLI and
    TestOmpDetectedWithPiDir (#3141); TestCodexDriftReached (#3398);
    the two Reasonix tests (#3641); TestWSLColdPlaceOpensNothing
    (#3924, fixed on main since)
    internal/davsync TestSyncTeraCloudStillSeesOtherWrites (#3420)
    internal/edit TestWriteAtomicReadOnlyHardLink and internal/testenv
    TestProgram, umask 077 (#3640)
    internal/gateway TestPluginToldWhereTheAgentWorks (#3675)
    internal/gui TestGatewayHeldByAContainer and
    TestGatewayFixQuitsOnlyAMagpie (#3649)
    internal/provider TestCodexAppServersOnHome (#3906), then "fatal
    error: close of synctest channel from outside bubble" (#3632),
    which ends the package's run
    internal/tui TestTUIFetchesSubscriptionModels/agent (#3919)

Not tried: the × in a running magpie, in macOS's or Windows' window or
WebKitGTK; the page here is the test's, with magpie's own replies.

Batch run, at tree 104d75f0a (the twelve coffemon ports together, on
origin/main 7d022bdb6), mote, macOS, go1.26.8:
- go test -tags nogui -count=1 -timeout 45m on the packages the batch
  changes (agent, autostart, daemon, gateway, library, proc, provider,
  sessions, testenv, tui, gui): ok each.
- GUI, node --test with Playwright 1.62.0, Chromium and WebKit:
  library-*.test.cjs and i18n-keys.test.cjs, 1044 of 1044 pass.
- gofmt -l: nothing. go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./... and go build ./...: ok at cdd7c8e46, the same
  batch on origin/main 00098f12b one rebase before.
- The whole go test ./... at cdd7c8e46: 86 packages ok, one red,
  internal/cli TestEveryRouteHasACommandOrIsNamed (GET
  /api/context/reply has no command), red on main too (#5026).
- Linux (wsl-run, Ubuntu 24.04, at 339055896, the batch on f4c664a09):
  proc, autostart, testenv, tui ok; agent: only TestGrokInstalled red
  (#3548); #4033's proc.Look reds (Zed, Copilot, Qoder, Cursor, Omp)
  pass.
- Windows (win-run, Windows 11, at 339055896): proc, autostart, testenv,
  tui ok; library and agent red in the same tests as on origin/main
  f4c664a09 (#4115, #1827, #4786; #5068, #5069, #5070 filed now).
- Rebased onto origin/main fb1f4856a (three commits, no file in
  common with the batch) and run again at the pushed tree: gofmt -l
  nothing, go build ./... and go vet ./... ok; go test -tags nogui
  sessions, agent, autostart, tui, proc, testenv ok; i18n-keys and
  library-* 1044 of 1044 pass.
- Not run before the push: the whole GUI suite (a run at cdd7c8e46 was
  cut off at 1170 of ~1174 tests when mote rebooted; it runs again after
  the tag and any red is filed).
2026-11-03 20:38:11 +08:00
yetone 00098f12bf library: Magpie Browser's "which agents may use it" is a line of its own under its row
tao0194 on Discord (v0.1.2828, zh, panel-width window): in Library > MCP
servers the magpie-browser row showed the connected ask (green dot, the
question, a button per agent) inside the name's column, wrapped into a
narrow strip between the command and the row's Scope and agent chips,
three lines tall beside every other server's two.

browserAsk's element was appended to the row's .who. It is now the row's
own child: the row gets lib-asking while it shows, wraps, and the ask
takes a line under the name, command and chips, from the name's left
edge (the picture plus the row's gap, 37px, 38px in the window's rows)
to the row's right edge. The first line keeps the name, command and
chips as the other rows have them (.who flex-basis 0 above 560px). At
560px and under, where rows already wrap, a long command now ellipsizes
beside the row's picture instead of taking the name to a line of its
own under it; that was so for any server with a long command, and the
ask's left edge follows the name. docs/subsystems/library.md says where
the ask sits.

library-browser-ask.test.cjs now has three agents (Codex, Zed among
them) and a context7 row beside it, runs at 1100, 600, the panel's 440
and 360, and checks the ask starts under the first line, at the name's
left edge, reaches the chips' right edge, that the first line is as
tall as another server's, and that the name sits beside the picture.

Run (mote, Playwright 1.62.0, Chromium and WebKit, en/zh/zh-TW/ja/de):
- library-browser-ask.test.cjs on the old client.js/library.css: 42 of
  44 red (every layout subtest; the two not-connected/given ones pass).
  With the change: 44 of 44 green.
- The 84 GUI files that open the Library, name lib-row/lib-server or
  library.css, or check budgets and i18n keys: 1480 of 1480 ok, before
  the rebase onto c3593dc49 (no upstream change touches these files);
  library-browser-ask, i18n-keys and builtins again after it: 52 of 52
  ok. go test ./internal/gui at the rebased head: TestMainWindowCorners
  red only (an AppKit window test, the same on origin/main 78cd4e6dd,
  #3949); everything else ok.
Not tried: the real app's panel (WKWebView) with a connected extension;
the full GUI suite.
2026-11-03 18:21:58 +08:00
yetone 2a19043afc library: a skill's files are read as Markdown and edited in the page (refeccd)
refeccd on Discord kept skills in ~/.agents/skills, handed them over to
magpie ("let magpie manage"), and then had nowhere to edit them: the
Library's skill view showed SKILL.md as raw text with no way to change
it. There never was an edit path; this adds one.

- GET /api/library/skill takes `file` and answers library.ReadSkillFile:
  the file (SKILL.md by default), its text, the skill's folder and its
  text files (UTF-8, no NUL, up to 1 MB each, 200 listed, SKILL.md first;
  links, hidden folders and what installing writes left out).
- POST /api/library/skills/save {name, file, text, was} is
  library.SaveSkillFile, through change(): it writes only a regular
  file already in the skill's library folder (no .., no absolute path,
  no link, no folder that is a link out of the skill, nothing under
  node_modules/.venv/…), refuses when the file no longer holds `was`
  (the text the page opened), keeps CRLF line ends, and writes with
  edit.WriteAtomic. The sync after it reaches every agent: a linked
  one reads the library's folder, a copy is made again. A copy edited in
  an agent before the save is older, so takeEdits sets it aside in the
  backups. A GitHub skill saved here reads as Changed here, so an update
  asks first.
- The page (viewSkill in plugins/library/client.js) draws a Markdown
  file with the Plugins page's own renderer (plugins.js exports it as
  window.mdRender, 27 bytes of core script) and its front matter as
  rows; other files as text. Edit swaps in a text box; Save or ⌘S/Ctrl+S
  sends it; Cancel asks when there are changes. Other files are the
  app's menu under the name (no native select). New code is in the
  library plugin, so the core script budget is not raised.
- SkillText is gone (its only caller was the route). One new string, in
  all five languages. docs/subsystems/library.md says all this.

Run on mote at the change rebased on 9335e23d3:
- go test -count=1 -timeout 45m ./internal/library ./internal/gui
  ./internal/cli: library ok. gui: TestCoreScriptBudget passes; the only
  red is TestMainWindowCorners/macOS_26_SDK (#3949, mote's macOS 27).
  cli: the only red is TestEveryRouteHasACommandOrIsNamed on GET
  /api/context/reply (#5026, from 0872bc2a0). Both are red on main and
  filed.
- GOOS=linux and GOOS=windows go vet -tags nogui on the three packages;
  gofmt -l clean.
- skill-edit.test.cjs: 22/22 (chromium and webkit; en, zh, zh-TW, ja,
  de; 860px and 400px). It checks the drawn Markdown and front matter,
  no sideways scroll, ⌘S posting the exact body with `was`, the status,
  the file menu, Cancel sending nothing, Save on a second file, no click
  scrolling the page, no left-border stripe or gradient. i18n-keys ok.
- Whole GUI suite (a new API call), on the Linux box (wsl-run; mote had
  two other full suites): ~4460 of its results in at the push, not
  finished. Its reds are all WebKit and none is in a file this touches.
  The ones near it, run alone at this change and at origin/main
  bc10a6198: click-scroll, found-skill-pick-remove and account-eye fail
  the same on both (#4385, #4097/#5013, #4244).

Again at the pushed head (rebased on b967b1620; its commits change
app.js and the core budget), on the Linux box: TestCoreScriptBudget ok,
go test ./internal/library ok, gofmt -l clean, skill-edit.test.cjs and
i18n-keys 26/26.

Broken by hand: without the `was` check, without the linked-folder check
and without the CRLF handling, TestSkillFileSaveRefusesAChangedFile,
TestSkillFileStaysInTheSkill and TestSkillFileKeepsLineEnds each went red.
skill-edit.test.cjs on the old assets: 0/11 in chromium (.lib-mdview
never appears).

Not tried: refeccd's own skills (the fixture is a made-up handover from
~/.agents/skills, with a copy agent and a link agent); the real app
window (the GUI tests fake the API); the TUI and CLI, which have no
editor; making, renaming or removing a file from the page; Windows.
2026-11-03 16:33:03 +08:00
yetone 6b81344301 library: the keep-here switch says sync, and is on while it syncs (bin.90)
bin.90 on Discord read the Library editor's 「只在这台电脑」 switch as a
LAN-sharing switch: "this computer only" says nothing about what it keeps
from where. It is about sync, so it now says so.

- Library editor (MCP servers, skills): the switch is "Sync to your other
  computers" (同步到其他电脑 / 同步到其他電腦 / ほかのコンピュータと同期 /
  Mit deinen anderen Computern synchronisieren), on while the server or
  skill syncs. Its note says off keeps it here, and a sync from the
  others neither removes it nor replaces it.
- The stored value keeps its meaning: `local` true is still kept here.
  The switch shows !local and saves !on, so every saved library.json,
  sync payload and CLI flag (`magpie library mcp local NAME on|off`)
  means what it meant.
- Row tag: "Not synced" (不同步 / 同步しない / Nicht synchronisiert) where
  it said "This computer only", in the Library, the TUI ("not synced ·")
  and `magpie library` output.
- Agents page sibling (the same words for an agent's picks): its menu
  item is "Don't sync picks to your other computers", its tag "Not
  synced". The agentsHere setting is unchanged.
- docs/subsystems/library.md and sync-backup.md name the new labels.

app.js stays in its budget: origin/main 8af751987 was already 31 bytes
over coreScriptBudget (1,533,833 > 1,533,802), so a comment in
setAgentHidden was cut to one line (core 1,533,756 now), no raise.

Run on mote, rebased on 8af751987, budget again at 2cfeda3d3:
- GUI: mcp-local-server, agent-here, i18n-keys, skill-off-here: 78/78
  before the rebase, in Chromium and WebKit, every language, at 390, 640
  and 1100 wide and in the panel; after it agent-here, i18n-keys and
  mcp-local-server 56/56, agent-here again 30/30 after the trim.
- go test ./internal/tui ./internal/cli ok; ./internal/gui ok except
  TestMainWindowCorners/macOS_26_SDK, mote's macOS 27 (#3949, open,
  the same without this change); TestCoreScriptBudget ok after the trim.
- go vet ./internal/tui ./internal/cli ./internal/gui; GOOS=linux go vet
  -tags nogui and GOOS=windows go vet of tui and cli; gofmt -l clean.

Broken by hand: saving `d.local = on` (no negation) turns
mcp-local-server red (expected 'false', got 'true').

Not tried: a real sync between two computers with the switch flipped;
the stored value's meaning is checked through the saved request only.
2026-11-03 12:21:49 +08:00
yetone 1851ead1a7 library: Pi and omp lock ~/.agents/skills from their versions; Put skills in links every skill there
usrname1833 on Discord asked for two things.

Pi reads ~/.agents/skills itself, so a skill kept there is Pi's whatever
is ticked, with the lock as Codex and OpenCode have. Pi started to in
0.54.0, not 0.19 (its CHANGELOG; userAgentsSkillsDir in
package-manager.js), and omp in 11.0.0 (src/discovery/agents.ts; 10.6.2
doesn't). Target.SharedToo says so from the version, and every reader of
readsShared goes through Target.readsSharedDir: Always (the lock),
syncSkills' inShared (no second link) and a handover's readsSharedHere.
OmO's senpi reads it in every npm version (0.74.0 up), so omo joins
readsShared. A Pi or omp of no known version is taken as older, as
before.

The second ask is a switch: Library > Skills > "Put skills in": each
agent's own folder (the default, today's behaviour) or ~/.agents/skills
(Library.SharedSkills; POST /api/library/skills/where {how};
magpie library skill where agents|shared). On, every library skill on
here gets magpie's link in ~/.agents/skills (syncShared, after
sweepShared), so every agent and tool reading that folder has it and
shows it locked. The files stay in the library rather than moving, so
updates, edit tracking and Off here keep working; existing skills just
get links when it is turned on, nothing is moved. A user's own entry by
the same name is never written over. Off takes out magpie's links there
and nothing else, and agents' own links come back. Per computer:
Collect doesn't carry it. docs/subsystems/library.md says all this.

Not covered, filed: on Windows without link rights the shared entry is
a marked copy, and takeEdits doesn't take edits made in it (#4958).

Run on mote rebased on d76c4b23a (which has 8abdf53a8):
gofmt -l clean; go vet GOOS=linux and GOOS=windows on internal/library,
internal/gui, internal/cli ok; go test internal/library, internal/gui,
internal/cli ok. GUI, every skill-*, library-* and i18n-keys file in
chromium and webkit: 1302 pass, 4 fail, all in library-all (webkit) and
library-null-agents (chromium). Both pass alone at this tree (52/52), so
they are load reds, filed as #4967. skill-where.test.cjs (new) covers en,
zh, zh-TW, ja, de at 900px and 400px. Before the rebase, cli's
TestEveryRouteHasACommandOrIsNamed was red on /api/usage/checkin-account
(not this change); it is green at this base.

Rebased twice more on origin/main (cli's settings_parity_test, app.js,
i18n.js, settings): internal/cli and internal/gui go test ok, i18n-keys
and skill-where green at the pushed tree.

Broken by hand, each red, then restored: since() always false
(TestPiReadsSharedSkillsFromItsVersion, TestSkillsWhereShared red);
syncShared step dropped (red); sweepShared's keepsShared keep dropped
(red on the SameFile no-relink check); the holder line in wanted
(TestSkillsWhereSharedWithKimi red); skillWhereBar not appended
(skill-where 0/11 per engine).

Not tried: a real Pi, omp or OmO run (versions read from their npm
source); the setting on the Windows box or in WSL; the whole GUI suite.
2026-11-03 05:43:12 +08:00
yetone 2ab9235711 agents: an agent's picks can be kept to this computer, as an MCP server can
chenxiang0010 on Discord: 「agent当前选择的模型可不可以像mcp那样 只对当前设备生效」.
Sync carries every agent's picks (model, effort...) between computers;
an MCP server has an opt-in "This computer only" that sync and backup
files never carry. Agents now have the same: the row's menu (right-click
or ...) has This computer only, off by default, so an upgrade changes no
pick on any computer.

- settings: AgentsHere, this computer's own (KeepOwn), and kept by a save
  of the Settings page (settingsapi.Apply), which doesn't send it.
- davsync: each kept agent adds "<id>.*" to the own set (withHere, isOwn),
  so a sync neither pushes its fields nor brings the server's; a Restore
  from the server leaves them. sync-state.json records the list as of the
  last sync (Here): hashes before a sync use it and after use the current
  list, so turning it on or off is no change on either side, and a changed
  list forces the sync past its early returns. Turned off, the next pick
  goes up again. Other agents still sync both ways; the implicit own
  fields (hayden4608) are unchanged.
- backup.Restore skips a kept agent in a backup file.
- gui: POST /api/agents/here; the row says "This computer only" beside
  the version (hidden in the tray panel and in a narrow row), menu ticks.
  Core words moved from the library plugin's i18n into core i18n
  (zh/zh-TW/ja/de). Comments in renderAgents cut to pay for it under the
  core budget (no raise).
- cli: the route is named under stage 3 (no command yet).
- docs/subsystems/sync-backup.md describes it.

Run on mote, at the base eb8b840dd (Go and the GUI files below) and again
at this head's base for internal/gui (core budget) and agent-here,
i18n-keys, agent-menu-label:
- go test -tags nogui ./internal/davsync ./internal/settings
  ./internal/backup ./internal/gui ./internal/settingsapi: ok
- go test ./internal/cli: ok but TestEveryRouteHasACommandOrIsNamed,
  red on main for POST /api/usage/checkin-account alone (#4826)
- GOOS=linux and GOOS=windows go vet ./...: ok; gofmt -l: clean
- GUI, chromium + webkit: agent-here (en/zh/zh-TW/ja/de x 1100/640/360),
  i18n-keys, sync-own-fields, mcp-local-server, agent-menu-label:
  90/90 ok
- the whole GUI suite: cut off at test 3783 by a session restart; the
  rest (key-* on) is still running at push. Reds seen so far, under
  three GUI suites at once on mote, none in an agent file: account-eye,
  balance-fix (Sub2API, /api/user/self), codex-auto-reset, context-map,
  editor-advanced-align; being checked at main and filed there.

Broken by hand, each red then restored:
- hereOf returns nil: TestAgentHereThroughSync "B's kept picks went up"
- backup.Restore's kept skip off: "B after a backup file"
- KeepOwn line dropped: TestAgentsHereIsThisComputers "another
  computer's kept agents came in"
- TestSettingsSaveKeepsWhatItDoesNotSend went red on this change before
  settingsapi kept AgentsHere (a Settings save would have dropped it).

Not tried: a real two-computer sync with real accounts; no CLI/TUI
command for the flag; Settings -> Sync doesn't list kept agents; WSL
agent ids (codex@wsl:...) only through the key format.
2026-11-03 02:27:20 +08:00
yetone 987e019d44 library: a skill off on this computer has room for its description and path (Tao)
Tao (tao0194, Discord #feedback, with a screenshot): in Library -> Skills,
handoff from mattpocock/skills showed "Off on this computer" (本机已关闭)
on a line under its name, and its description and the
mattpocock/skills/tree/HEAD... path line were cut off. grill-me beside it,
on, showed all three lines.

Cause: the windowed skill list holds each row to a fixed height (51px, or
67px with a source) and counts its room from that. fe05f0a72 put the tag
on a line of its own (a narrow row's name has no room for it beside the
name), but the row kept the old height, so the centred content spilled
~11px over the top and the bottom.

Fix: the list counts that line too. A skill off here is HERE_H (23px: the
tag's 20px and its 3px margin) taller in the list's sums (client.js,
skillH), and library.css holds such a row to 74px / 90px. The tag stays
where it was; nothing else moves.

Test: internal/gui/tests/skill-off-here-fits.test.cjs. Tao's case
(github skills from mattpocock/skills, handoff off, grill-me on; the
descriptions are stand-ins), plus an off and an on skill without a
source: every line of each row lies inside its padding, and the path
reads mattpocock/skills/tree/HEAD/skills/handoff. en, zh, zh-TW, ja, de
(every language the tag is in), 860px and 400px, Chromium and WebKit.

Run at this head (31deaac00 rebased on b2f7818d2, then the #4901 comment):
- mote (macOS): skill-off-here-fits + skill-off-here, both engines: 44
  pass, 0 fail.
- Broken by hand: the same file at origin/main b2f7818d2 on mote: 22
  fail ("handoff's name starts above the row's padding (-10.64px)"), and
  on WSL both engines red.
- WSL magpie-desktop (Linux): every GUI file that opens the Library (107
  files, both engines): 1997 pass, 35 fail. Of the reds,
  library-chip-fan (webkit), library-mcp-tools (chromium ja 420),
  mobile-web (both, page.goto ERR_HTTP_RESPONSE_CODE_FAILURE) and
  title-bar-tools (webkit) are red the same at origin/main b2f7818d2 run
  alone on WSL; list-sort, market-more and mcp-editor-cancel passed alone
  at this head (5 files, 92 pass, 0 fail), so they were the run's load.
  The new test was red in Linux ja by 0.64-1.34px on a row *without* the
  tag (a taller CJK font); filed as #4901, and the test allows 2px.
- go test ./internal/gui on mote: ok except TestMainWindowCorners/
  macOS_26_SDK, red on macOS 27 already (#3949).

Not tried: the full GUI suite (mote was running other sessions' full
suites, and mote rebooted mid-run once); the real desktop app with a
real skill turned off here; the library subset on macOS (only the two
files above); Windows.
2026-11-02 16:58:41 +08:00
yetone 679bc412cb library: Magpie Browser's row asks which agents may use it, once connected
Magpie Browser is added with no agents (opt-in), so the router offers it
to none until one is ticked, and an agent asked to use the browser
reached for AppleScript instead. While its extension is connected
(GET /api/library/browser, read again every 3s while the row is shown,
so connecting it needs no reload) and no agent has it, its row asks
"Which agents may use it? They act in your tabs, signed in as you are.",
a button per agent that clicks that agent's chip (servers/agents, as a
chip's click). Once one has it, the row asks nothing more. Not
connected, or given to an agent already, it asks nothing.

Run on mote at this head (8e884421c + this): library-browser-ask (every
language, Chromium and WebKit, 1100/420px) with library-row-remove,
library-open-again, library-mcp* and i18n*: 200/200. Red with the row's
ask taken out by hand (2 pass, 22 fail). An earlier run of every
library* and i18n* file on this change had only library-row-remove red,
the #3099 flake fixed in 8e884421c. Not tried: the real extension
connecting in the owner's Chrome with the window open.
2026-11-02 08:01:47 +08:00
yetone 8e884421cb library: opening the page draws it again only for a change (#3099)
Every opening of the Library (its nav clicked, while on it too, or back
from another page) read the library and drew the whole page again,
changed or not. The rows were replaced under the reader's pointer, so
the trash shown on a row's hover went away mid-click, and
library-row-remove's click measured a row already gone: red about half
the time in Chromium since 10-29 (the test opens the page at
?view=library, then clicks Library again). Opening the page now draws it
again only when the library changed, or on RTK's tab, which is asked
again each time; a language change still draws it all again.

Found by logging render()'s callers: two opens, the second drawing the
same library 10-20ms after the first.

Run on mote at this head (7e201ce20 + this): new
library-open-again.test.cjs (Chromium and WebKit, 1100/420px, en/zh)
10/10, red on the old code ("the row was drawn over again, nothing
changed"). library-row-remove alone 22/22 three runs (it was red 3 of 3
at 7e201ce20). library*, i18n* and plugin* GUI files, both engines:
1914 pass, 6 fail, the 6 in plugin-move-unserved and plugin-card-update,
red the same way on a clean 7e201ce20 copy (filed separately).
go test ./internal/gui: ok.
2026-11-02 07:51:12 +08:00
yetone e44ad72cfd gui: a failed status dot is an x, not a red dot alone
coolmantou on Discord (#feedback), who is red-green colour-weak, could
barely tell the green status dot from the red one. Under a deuteranopia
or protanopia simulation the two are one olive colour, in light and dark.
Making the green lighter would not help a greyscale or protan reader, so
the failed state now says it by shape (Apple HIG: never colour alone).

What changed
- app.css: a --x-mark token (an SVG x, used as a mask). Each failed dot
  keeps its red and its 6-7px box, is drawn through the mask and scaled
  1.5 so it reads as heavy as the round dot. Layout is unchanged.
  Dots: Test models (.tdot.bad), an agent's status (.ag-st.bad .ag-dot),
  the check-in (.ci-dot.bad), the request ledger (.led tr.bad .st .dot).
- routing.css: a try or probe (.rt-req/.rt-probe.bad .to i), a step
  (.rt-steps li.bad::before), the preview (.ps-dst.bad > i).
- library.css: a server that failed (.lib-health.err::before). A ring
  was not used because "not checked" is already a ring there (#2308).
- Not changed: green-only dots with no red pair (gateway, keys, tiles,
  live), chart markers, routing's animated packets, redact's categorical
  facet dots. The tray has no status dots of its own.
- docs/subsystems/gui-shell.md says it beside "State is shown with a dot".

Tests
- status-dot-shape.test.cjs (new): for all 9 pairs with the real
  stylesheets, in chromium and webkit, light and dark, 980 and 420 wide:
  the good dot has no mask, the failed one has the x mask and the good
  one's box, and its pixels have ink on the arms and centre and none
  above the centre.
- library-mcp-health.test.cjs: its "a dot, not a stripe" check now
  expects the x for a failed server and a round dot for the rest.

Run at the pushed head (mote, via mote-run)
- status-dot-shape + library-mcp-health: 16 pass, 0 fail (chromium and
  webkit).
- go test -run 'Asset|CSS|Budget|Compress|Revalidate' ./internal/gui: ok.
- At 377e3ca6e + this change (rebase since added only site/ files):
  the 232 GUI files that touch these dots, Test models, Routing, Library,
  check-in or the ledger, in both engines and every language they run:
  3588 tests, 3526 pass, 62 fail. library-mcp-health (2) was this
  change's and is fixed above. The other reds (import-row, models-works-only,
  provider-typed, rest-try-now, routing-order-unknown, routing-row-swap,
  routing-steady) fail the same on a clean origin/main 377e3ca6e copy and
  are filed: #4619, #4391, #4673, #2564/#4127, #4627, #3799/#4585, #3412.
- go test ./internal/gui: TestMainWindowCorners/macOS_26_SDK red on mote's
  macOS 27, #3949; nothing else.

Broken by hand
- The three stylesheets put back to main's: status-dot-shape 10 of 10 red
  ("the failed dot is drawn through the x").
- The x token swapped for a filled circle: red ("the failed dot isn't a
  round dot").

Checked by eye: screenshots of every pair and of the real Usage ledger,
before and after, normal, deuteranopia, protanopia and greyscale
(Machado 2009 feColorMatrix), light and dark. Before, the pair is one
colour in both simulations; after, dot vs x in all of them.

Not tried: the real app in Linux WebKitGTK, Windows WebView2 and
Omarchy's square-corner theme (the mask doesn't depend on border-radius,
so it should hold there); the Playwright engines only.
2026-11-02 07:41:23 +08:00
yetone e42ee3b816 library: Magpie Browser's extension sits in ~/Magpie Browser Extension, dragged from the sheet onto chrome://extensions
The owner, on the v0.1.2442 sheet: the extension was written to
~/.config/magpie/browser-extension, a hidden folder no one can find to
choose in Load unpacked.

- Set up writes it to "Magpie Browser Extension" in the home folder
  (browserExtDir), where Finder and Explorer show it, and shows it
  selected in its parent (open -R on the Mac, explorer /select, on
  Windows, the home folder on Linux) rather than opened, to drag from.
- On the Mac the sheet has the folder itself: a press on it that moves
  hands the folder to the system's drag (POST /api/library/browser/drag,
  filedrag_darwin.go: beginDraggingSession from the key window with a
  file URL and the folder's icon, only while the button is still down),
  so it drops onto chrome://extensions as from Finder. Chromium's
  extensions page loads a dropped folder as unpacked
  (drag_and_drop_handler.ts: entry.isDirectory -> loadUnpackedFromDrag),
  with Developer mode on, which step 2 asks for.
- Elsewhere step 3 says to drag the folder from the window that opened,
  or Load unpacked and choose it.
- Old installs: a browser that loaded the hidden folder still does, and
  that folder is kept up to date as long as it has a manifest; the sheet
  offers set up again, into the new folder.

Run at ace58117a on mote: go vet ./internal/gui (darwin), GOOS=linux -tags
nogui and GOOS=windows vet; library-browser-setup and i18n-keys GUI
tests, 46 of 46 (5 languages, Chromium and WebKit, 1100 and 420 wide,
with and without the drag: a click posts no drag, a press that moves
posts one); internal/cli parity tests ok. At df0320156: go test
./internal/gui ./internal/cli, cli ok, gui red only in
TestMainWindowCorners, which is #3949 and red the same at df0320156
without this change.
Not tried: the native drag by hand into a real Chrome (no way to drive
a mouse drag here), and Explorer's /select on the Windows box.
2026-11-01 17:28:15 +08:00
yetone df0320156b library: the skill market offers every skill skills.sh lists, 60 at a time
The owner: the Library's markets had too little in them ("这两个市场的
东西都太少了"). The skill market showed at most 60, four a repository.

Now it offers every skill on skills.sh's front page (its 600 most
installed), then each one on its trending page that isn't there, with no
count of installs: trending counts recent installs only, so the card
shows none rather than a wrong one. A repository's first skill comes
before anyone's second, so the first page still isn't one author's, and
nothing is cut. A search asks skills.sh for 200, not 40. The snapshot
magpie ships with has the same 772.

The page shows 60 cards and a "Show more (N left)" button that adds 60
under them; what was shown stays where it is, and skills' about is asked
for the cards shown only. MCP's list pages the same way. Strings in zh,
zh-TW, ja and de.

Run on mote at 0de6f2e57 (origin/main 1d8ded3ec plus this; pushed on 7c712847b, an agent row only): go test
./internal/library ok, gofmt clean, and the GUI files i18n-keys, market-*
and every-skill in both engines, 88/88. Main had changed internal/library
twice since the base below (399385307, 655d23f79).

At 073b3dfbb (origin/main c991733dc plus this):
- gofmt -l internal/library internal/gui: clean; go vet ./internal/library
- go test ./internal/library: ok
- go test -skip TestMainWindowCorners ./internal/gui: ok. That test is
  red on origin/main too (#3949).
- GUI: i18n-keys, market-*, every-skill in Chromium and WebKit: 88/88.
  i18n-keys was red at first, from a Go module cache an earlier run of
  mine had left in mote's copy of the tree; with it removed, 4/4.
- At 098f28929 (origin/main 5dfbca627 plus this), the wider set:
  i18n-keys, market-*, library-*, skeleton-bird, search-mcp-library,
  skill-install-agents-all, every-skill in both engines, 1128/1128.
  Between that base and this one, main changed only internal/library's
  MCP hub, browser and gateway code; none of it is in these pages.
- An earlier run of the same files at 647323409 plus this, with mote at
  load ~130, had 6 reds. All three files pass alone, both on main and on
  this change (110/110), and each has an issue: #4756
  (search-mcp-library), #4483 (library-mcp-hub) and #4125 (browser
  launch).

Broken by hand, red each time: the 4-per-repository cap back
(TestMarketSkillsAll), search limit 40, no trending page, and installs
shown for a trending skill (market-more.test.cjs). Removing the button
before the new cards are put in still passes, because the click scroll
keeper holds the reader's card. So nothing claims that order matters.

Not tried: the real skills.sh from the app. fetchPopular's parsing is the
one it had; the snapshot was made from the live pages today.
2026-11-01 17:00:04 +08:00
yetone 01ccbd40a0 library: an MCP router says which computer it is, so an agent can pick between two (packinggoodsllc_07668 on Discord)
Two magpies, one in China and one in Los Angeles, each serve the same
tools through their MCP router (/mcp/magpie/hub). An agent connected to
both saw two identical web fetches and couldn't pick the one in Los
Angeles to reach Google.

Each router now says where it is:
- initialize's instructions end "This router: <name>. Each of its
  tools' descriptions starts with [<name>]; ...", and serverInfo.title
  is "Magpie MCP hub · <name>";
- each tool's description in tools/list starts "[<name>] " (once: a
  description that starts so already, another magpie's router behind
  this one, isn't given it twice).
<name> is the user's words (settings.RouterNote, one line, 80
characters at most) to every caller. With none it is this computer's
name, to callers on other computers only: an agent on this computer
has one router at hand, and its prompts stay as they were.

RouterNote is this computer's own (KeepOwn): library.json is synced,
settings.json isn't, so a sync never brings the other machine's name.
It is set in the Library's MCP tab, in a Router name row under the
router's address (shown while the router is on): a plain field with the
computer's name as placeholder, saved on Enter or leaving it, Escape
puts the saved words back, an input method's Enter is its own. POST
/api/settings keeps it. Translated in zh, zh-TW, ja, de.
docs/subsystems/mcp-router.md has the rule.

Run (mote, at a5a9cdf7b + this change): go vet ./... for darwin, linux
and windows ok; go test -tags nogui ./... -timeout 45m: every package
ok except internal/gui's TestSettingsSaveKeepsWhatItDoesNotSend on
BusyLoad, red on main since 8d8df0639 (#4739, fixed in the next
commit). After rebasing on 9feb1024c: internal/gui, settings, library
and gateway again, and node --test library-mcp-router-note (new),
library-mcp-hub, mcp-hub-direct and i18n-keys, chromium and webkit,
en/zh/zh-TW/ja/de, at 1100 and 420 wide.

Broken by hand: hubWhere returning "" turns TestHubMCPSaysWhere red;
dropping RouterNote from KeepOwn turns TestRouterNote red; dropping it
from POST /api/settings' carry list turns TestHubNoteSaved and
TestSettingsSaveKeepsWhatItDoesNotSend red. i18n-keys caught a test
comment saying "Router name", reworded.

Not tried: two real magpies on two computers with a real Claude Code
or Codex connected to both, and whether a model actually picks by the
prefix; the Linux and Windows apps' Library tab.
2026-11-01 15:23:15 +08:00
yetone 788057340b library: Magpie Image Recognition in Discover beside Magpie Image and Web Search (matrix0487 on Discord, #4653)
matrix0487 asked on Discord (#feedback) for all three of magpie's own MCP
servers, image recognition, image generation and search, in the Library's
Discover. Image generation and search were there; image recognition was
an address to copy in Settings only (#4653).

- `magpie mcp vision` (browsermcp.RunVision) relays stdio to the
  gateway's /mcp/magpie/vision, as `mcp search` does. analyze_image's
  relative image path is made one in the agent's folder on the way
  (imageFrom), since the gateway can't know where the agent runs; an
  absolute path, ~, a URL or a drive goes as written.
- library: magpie-vision is a featured, opt-in server (no agents until
  picked), any binary's `mcp vision` is one server (serverKey), and it
  gets the 120s tool timeout (selfTimeout).
- Settings › Models › Images: the Image recognition row has Give agents
  Magpie Image Recognition… / Turn on the Library, none with recognition
  off or in gateway mode. The three links are one helper, libWay, used by
  Image generation and Web search too (no budget raised: core 1,533,011
  of 1,533,105).
- Never a dead tool: Discover lists all three whatever is set up, and one
  that can't answer yet says why (gateway.OwnUnready, set by
  /api/library/market/servers as `unready`): a "Not set up yet" badge on
  its card with the reason as its title, and the reason in its sheet
  (nothing set up, or turned off in Settings / Plugins). It can still be
  added; its tools already answer with the same reason until then.
- Strings in en, zh, zh-TW, ja, de; docs/subsystems/library.md.

Run, all on mote (macOS 27) through mote-run, at this head's tree
(rebased on 21882a68d):
- gofmt -l internal/: clean. go vet darwin; GOOS=linux -tags nogui;
  GOOS=windows: browsermcp, cli, library, gateway, gui, imagemcp ok.
- go test -timeout 45m: internal/library, browsermcp, cli, imagemcp ok;
  internal/gateway ok (whole package, 556s, before the rebase; OwnMCP,
  OwnUnready, VisionMCP, SearchMCP after it). internal/gui: three reds,
  none from this change, each red on origin/main 21882a68d too:
  TestSettingsSaveKeepsWhatItDoesNotSend (BusyLoad, from 8d8df0639,
  filed #4739), TestMainWindowCorners/macOS_26_SDK (#3949),
  TestColdTurnsTaken (#4510). Budget tests ok.
- New: TestMagpieImageRecognitionIsOptIn, TestVisionBridgePassesLines,
  TestImageFromLeavesTheRest, TestOwnUnreadyWhileNotListed.
- New GUI test vision-mcp-library.test.cjs: chromium + webkit, en, zh,
  zh-TW, ja, de, 1100 and 420px (link opens the sheet with its hint and
  unready line; Library off → Turn on the Library; one added opens
  Discover with all three, only the unready one badged, inside its card;
  gateway mode and recognition off show no link; no horizontal overflow,
  no page errors): 206/206 with search-mcp-library and
  images-library-way. On e84870f17 (old code), chromium: every link and
  Discover case red.
- i18n-keys, gui-de, gui-zh-tw ok; gui-ja's one red is #4580, the same
  on origin/main 21882a68d.
- Broken by hand: serverKey without "vision" → TestMagpieImageRecognitionIsOptIn
  red; imageFrom not joining the folder → both browsermcp tests red.
- Real use, sandbox HOME on mote, nogui build, `magpie serve` on
  127.0.0.1:3591: `magpie mcp vision` initialize / tools/list answered;
  analyze_image of shots/a.png says "magpie has no model that sees
  images…"; missing/b.png names /…/work/missing/b.png (relative path
  resolved); an extra argument exits 1; gateway down answers id 9 with
  "magpie isn't running, so Magpie Image Recognition can't be reached".

Not tried: analyze_image against a real seeing model through the relay
(the sandbox had no provider; the gateway path is the one /mcp/magpie/vision
already serves); a real agent adding it from Discover; WSL (unchanged,
the MCP router serves it there); the whole GUI suite, queued after
mote's running one.

Reported-by: matrix0487 (Discord)
Closes #4653
2026-11-01 14:12:42 +08:00
yetone b1fc435407 library: Magpie Web Search, magpie's search MCP server in Library › MCP (lutra_fs)
lutra_fs on Discord: magpie's search MCP shows in Settings › Models but
not in Library › MCP servers. They were right. The gateway's web search
MCP (/mcp/magpie/web-search) was only an address to copy in Settings ›
Models › Web search. It was never a Library server, so no agent could be
given it from the Library, and the Library didn't list it.

Change:
- `magpie mcp search`: a stdio relay to the gateway's search MCP, made by
  widening browsermcp's Magpie Browser relay into a bridge with its own
  path, title and an optional session (search sends none, and has a 5
  minute client). It takes no arguments. When magpie isn't running, it
  says "Magpie Web Search can't be reached: start magpie".
- library: Magpie Web Search (magpie-web-search) is a featured,
  opt-in server beside Magpie Image and Magpie Browser. It is installed
  with no agents, so the user picks them in its sheet, and it switches
  per agent like any other row. Its command is the full binary path, and
  serverKey treats any binary's `mcp search` as the same server. Each
  agent's tool timeout is at least 120s.
- Settings › Models › Web search › MCP server: under the address there is
  a "Give agents Magpie Web Search…" link that opens its Library sheet,
  or "Turn on the Library" while the Library is off, as Images does for
  Magpie Image. Gateway mode has no link.
- The sheet's hint says where each search goes and what it costs. All
  strings are in en, zh, zh-TW, ja and de.
- docs/subsystems/library.md names magpie's own servers and the new one.
- An agent in WSL gets it through the MCP router, as Magpie Browser
  does. The image-only WSL side() is unchanged.
- The sibling, Image recognition's MCP server, is still in Settings only.
  That is filed as #4653.

Run, at this head (rebased on origin/main a6217e83d), on mote: gofmt -l
is empty. go vet passes for darwin, linux (nogui) and windows.
internal/library, browsermcp, cli and imagemcp pass. The internal/gui Go
package and the GUI files search-mcp-library, search-mcp,
images-library-way, i18n-keys, gui-ja/de/zh-tw, searcher-pick and
search-keys: 197 passed, 2 failed. The 2 reds are both known. gui-ja is
the {agent} ja string, #4580. searcher-pick's chromium en case reads a
null box: red 1 of 3 here and 2 of 3 at a6217e83d, filed as #4274.
internal/gui's three reds are red at base and filed:
TestSettingsSaveKeepsWhatItDoesNotSend #4514,
TestMainWindowCorners/macOS_26_SDK #3949 and TestColdTurnsTaken #4510.

New test: search-mcp-library.test.cjs covers Chromium and WebKit, 5
languages, at 1100 and 420px. On the old code it is red, 52 failed and
10 passed; the passes are its gateway-mode cases, which expect no link.
TestMagpieWebSearchIsOptIn and TestSearchBridgePassesLines are new too.

Broken by hand: with "search" taken out of serverKey,
TestMagpieWebSearchIsOptIn goes red (Have empty).

Real use: on mote, in a sandbox HOME, with a nogui build and the
gateway on 127.0.0.1:3611. `magpie mcp search` answered initialize with
serverInfo magpie-web-search and listed web_search in tools/list.
web_fetch https://example.com returned "Example Domain". With the
gateway killed it gave -32603 "magpie isn't running, so Magpie Web
Search can't be reached…". With an extra argument it exited 1 with
"takes no arguments".

Whole GUI suite on WSL magpie-desktop (load 120 to 180), at the
pre-rebase tree 73595f737: 17260 tests, 16684 passed, 574 failed. The
base, origin/main da0005df8, ran on the same machine: 516 failed, and
324 top-level tests were red. Each of the 161 files with a red was then
run alone on mote at head:
- At head, 118 of them pass alone. They aren't caused by this change.
- 43 fail alone at head, and every one of those also fails alone at
  base. Two pass at base once: login-import is flaky at both (#1307),
  and usage-curve-zoom-back went red once of two at base and passed 2 of
  2 at head.
  view-open-wheel was red 1 of 2 at both, filed as #4723.
- segs-press-redraw ("searchAllRow option 1") fails the same way at
  base, filed as #4566. gui-ja's {agent} string is #4580, and
  usage-ledger is #4078.
- Reds with no issue are now filed one per test: #4680 to #4728.
  Already filed: #4638 claude-mode, #4650 routing-request-model, #4176
  skeleton-bird and #1937 name-suffix-no-names.
Not tried: web_search with a real search API key (mote has none). An
agent in WSL using it directly. A run on the Windows box.
2026-11-01 12:38:01 +08:00
yetone 0e90572274 browser: Magpie Browser, agents use the user's own browser and its sign-ins
The owner asked for a browser-use MCP of magpie's own, so an agent's
browser keeps working when Claude Code switches accounts, and asked that
it act in the browser the user uses every day: a fresh Playwright
profile is signed in to nothing.

Magpie Browser is an MV3 extension (internal/browserext, ID
dmlhojidlfnkgamkekjhacgkpanbkeko, pinned by its key) that the user loads
once in Chrome, Edge, Arc, Brave or another Chromium browser. It holds a
WebSocket to the gateway's /v1/magpie/browser/extension and carries out
each tool call with chrome.debugger (the DevTools protocol) in the user's
own tabs. The socket is taken only from this computer, with a loopback
Host (no DNS rebinding) and the extension's own Origin; a page or another
extension that connected in its place would be handed every call.

Agents reach it at /mcp/magpie/browser (Streamable HTTP) or through
`magpie mcp browser` (stdio), and the Library's MCP market lists it as
Magpie Browser, opt-in. Like the image server it is magpie's own, but it
is never served to another computer, shared and with a key or not, and
never to a web page, since it acts as the user wherever they are signed
in. 17 tools: navigate (url, back, forward, reload), snapshot (an
accessibility tree with refs, interactive-only on ask), click, type,
press, select, hover, drag, upload, scroll, wait (text, gone, seconds),
dialog, evaluate, text, screenshot (page, full page, element; JPEG or
PNG), console and tabs (list, new, select, close). Each agent session
goes on in its own tab; a link that opens a tab is followed, and a
dialog a click opens is said in the reply.

The Library's sheet for it has Set up the extension…, which writes the
extension to ~/.config/magpie/browser-extension pointed at this gateway
and shows the folder, the three steps to load it, and whether the
browser is connected, polled while the sheet is open.

Run:
- TestBrowserToolsInARealBrowser: the extension magpie writes, loaded in
  a real Chrome for Testing 141 (Playwright's chromium-1234, headless=new)
  with --load-extension, connects, and all 17 tools act in a real tab of
  a fixture site. Green on mote (macOS 27), on xiaomi-gpu (Windows 11,
  win-run) and in magpie-desktop (Ubuntu 24.04, wsl-run). Under a test
  HOME Chrome needs --use-mock-keychain / --password-store=basic, or the
  extension's storage waits on a keychain and it never connects.
- go test ./internal/gateway -run 'Browser|ReadOnly|Image', ./internal/
  browserext, ./internal/browsermcp, ./internal/library, ./internal/gui
  -run 'Library|Browser', ./internal/cli on mote.
- GUI: library-browser-setup.test.cjs (new) in Chromium and WebKit, en,
  zh, zh-TW, ja, de, at 1100 and 420 wide: 22/22. With i18n-keys and
  every library*.test.cjs: 915 pass, 1 fail, i18n-keys' "Unmarked",
  red on main since 5787d758a (#4524, fixed in the next commit).
- gofmt -l, go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows
  go vet ./... on mote.
- Again at this commit, rebased on 2e9df9b1b: gofmt -l, the vet trio,
  ./internal/gui -run 'Budget|Size', ./internal/proc (exec guard),
  ./internal/usage, ./internal/browserext, ./internal/browsermcp, and
  i18n-keys (0 fail with the next commit). The full go test ./... runs
  in magpie-desktop (Linux) as this is pushed; mote had another
  session's suite running.

Broken by hand, each red, then restored:
- browser_click's dispatch in background.js turned into a no-op: the
  E2E test is red at "clicked Ada".
- the extension socket's Origin check, its loopback-Host check and
  local(): TestBrowserExtensionOnlyFromItsOrigin red for each.
- browserMCP's local()/fromBrowser() guard: TestBrowserMCPGuarded red.
- a tool dropped from background.js: TestBrowserToolsAreTheExtensions red.
- the sheet's steps left shown once connected: the GUI test is red.

Not tried: loading it by hand (Load unpacked) in the owner's own daily
Chrome or Edge and driving a site they are signed in to; Arc, Brave and
Edge themselves (only Chrome for Testing); Firefox and Safari, which
have no chrome.debugger and are not supported. Chrome shows its "is
debugging this browser" bar while a tab is being driven; that is
Chrome's and cannot be hidden.
2026-11-01 02:29:55 +08:00
yetone 20482d71ff library: a skill by a name the library has from elsewhere goes in beside it
mora1n on Discord: anthropics/skills' skill-creator and openai/skills'
are two skills by one name, and only the first could be added; the
second was skipped as "another skill called skill-creator, left as it
is". The library keyed being had by name in every place that asked.

Now being had is decided by source (hadSkill): the same source under any
name here, or a skill with no source (taken in from an agent's folder)
by that name with the very same files. Another skill from GitHub or a
git repository whose name is taken goes in beside it as
<name>-<owner> (skill-creator-openai), then owner-repo, repo, a number,
at most 64 bytes (freeSkillName in skill_beside.go). The library's copy
of its SKILL.md gets that name in the front matter's top-level name:
line (nameSkill), so no agent sees two skills by one name; Skill.Called
keeps the name it came with, and the carried bundle carries it. Its hash
is of the renamed copy, and checks (GitHub and git) and updates compare
what they fetch renamed the same way (fetchedHash), so it doesn't read
as edited and an update keeps the name.

The class: probe (Candidate.Have now means this skill; Candidate.As is
the name it has or would get), installFrom (listed and unlisted folder
by that name), the new-skills check (no longer drops a skill because
its name is taken), the market's had check (by name only for a skill
with no repository: none or a folder), carry, the TUI's probe list and
the GUI's probe list ("adds as {name}" with why in its title, "In the
library as {name}"; zh, zh-TW, ja, de; the tag is cut short in its row).

Old data: nothing is renamed. A skill already in the library keeps its
name, folder, SKILL.md and agent links; library.json without "called"
reads as before. Only a skill added from now on can get another name.
Not changed: a folder of the user's own is linked as it is and its
SKILL.md can't be named apart, so one by a taken name is still skipped,
now saying to rename it in its SKILL.md; and an agent's own skills
folder still holds one skill per name (an agent's own skill by the
library's name is settled by Use library / Keep agent's as before).

Run (mote, at c6fd4b37c on origin/main 6a900e0d0, then rebased on
0fe9f97c1, which touches only claudetui, gui and provider):
- gofmt -l, go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./..., go build ./..., go build -tags nogui:
  clean.
- go test -tags nogui -count=1 -timeout 45m ./...: 82 packages ok,
  internal/gui red only in TestSettingsSaveKeepsWhatItDoesNotSend
  (SearchAll, #4514, open on main, not this change).
- After the rebase: internal/library and internal/tui ok.
- GUI, both engines: skill-install-beside (new), every skill-*,
  library-*, found-skill-*, remove-found-*, mcp-*, i18n-keys, gui-ja,
  gui-de, gui-zh-tw, font-cascade, inner-scroll-contain, win-fonts:
  1427 tests, 1423 pass. The 4 reds fail the same at origin/main
  3baf3b6df run alone: gui-ja (#4580), i18n-keys "Unmarked" (#4524),
  library-row-remove chromium (#3099).

Red on the old code: the anthropics-then-openai install against
origin/main code fails with "the library already has another skill
called skill-creator, left as it is". Broken by hand: fetchedHash made
to hash the fetched files unrenamed turns
TestSameNameFromAnotherSourceGoesInBeside red (hash mismatch); the
.lib-pick > .lib-tag rule removed turns skill-install-beside red ("the
tag stays in its row") in both widths.

Not tried: real anthropics/skills and openai/skills installs in a
sandbox HOME (the tests serve both repositories' layouts as tarballs;
the fixtures put both at skills/skill-creator. The real openai/skills
keeps it under skills/.system, which a probe of the repository's top
doesn't walk into; that is how probing has been and isn't changed
here); Windows and Linux runs of the GUI.
2026-11-01 02:02:24 +08:00
yetone 63cb1af3cb library: the MCP router's mark is the bird with its tail routed out to three ends
The owner asked for a mark that says MCP routing and picked, from three
generated drafts, magpie's bird whose tail fans out into lines ending in
dots. It is drawn as SVG on the bird itself, not a picture, so it stays
sharp at 17px and takes the theme's colour: the bird clipped short of its
tail (#bird-notail, beside #bird-tail in index.html), three strokes from
where the tail was and a dot at each end. Every place hubMark draws (the
Library's MCP router row, the Connect an app sheet) gets it.

Run on mote (macOS 27): library-mcp-hub now checks the clip, the three
routes and their ends (red on the old mark). library-*, i18n-keys and
old-webkit, both engines: 895 pass, 5 fail. The reds are i18n-keys
"a plugin's words are its own" (#4524) and library-row-remove's 3
subtests (#4304); both red the same at origin/main 2cfb8351d. Looked at
in dark and light at 17px, 34px and 220px.
2026-10-31 22:06:25 +08:00
JoeyWu-tech 4ff086d1fb library: the Instructions page lists a stopped WSL distro's agents (#4182)
With a WSL distro stopped, the Instructions page listed none of its
agents: instructionsView built its rows from the targets only, and an
agent in a stopped distro is no target (#3896). So Claude Code, Codex
and the rest in WSL couldn't be switched on until the distro ran. And a
switch on the page sent the agents the page listed, so switching any
agent on or off while the distro was stopped took its agents off the
set, and the next sync once the distro ran took magpie's part out of
their files.

The same way c1da9ccda did it for the MCP and Skills pages: keepShape
keeps the instructions file's path in the shape (wsl.json, key
library:<kind>) while the distro runs. While it is stopped,
instructionsView lists its agents from that (asleepInstructions, asleep:
<distro>), switched on as library.json has them, with what each gets
besides, which is in magpie's own folder. The file itself isn't read:
its own lines, an edit to magpie's part and an override file aren't
known then, so the row says nothing of them, and Move its own and Write
again don't show. One switched on whose file magpie never saw (no path
in its shape, or a shape kept before this commit) is listed as unseen.
ReadInstructions, which the page reads after each instructions change,
lists them too, or the rows would go after the first switch. The TUI's
instructions picker sends the agents Read lists as on, so by its code it
had the same loss and keeps them now, with no change of its own (read,
not run).

A switch on one is kept in library.json, as any is. Takes accepts one
with a known file, so the CLI's `library instructions agents` records
it, and says on stderr that the distro isn't running (AsleepIn, as
before). Woken now watches a distro that Instructions.Agents names, or
whose agent still has magpie's part (Applied.Instructions), so a switch
on is written there once the distro runs, and a switch off is taken
out. Nothing is opened or run in the distro while it is stopped.

The page greys a stopped agent's row (icon as on the chips), shows its
path as text, not a button (showing it in Explorer opens the distro),
gives its switch the line's words as its tooltip and as the status after
a switch, and adds the one line per distro under the list
(asleepAsides, now given the page's own rows). An unseen agent's switch
is greyed out (aria-disabled), says why with the unseen chip's tooltip,
and sends nothing; every other switch keeps it on. No new strings: the
line, the unseen tooltip and "{agents} can be changed once it runs." are
c1da9ccda's, in en, zh, zh-TW, ja and de. The "keeps no user-wide
instructions file" line still leaves stopped agents out.

The MCP and Skills pages are the same, except that an agent seen with
an instructions file only (no MCP file or skills folder) now has a
shape: it is listed there as it is while the distro runs, among the
agents with no MCP servers or no skills folder, where before it was
listed only when unseen and named.

What was run (tree 7fd5f65a, on origin/main ec5571d6, go1.26.8,
linux/amd64, Linux 5.15, umask 077):
- TestWSLStoppedInstructions (new): Codex and Claude Code in a FakeWSL
  distro, seen running, then stopped with the distro's folder moved
  away. Both are on the Instructions page, asleep, at their files, Own,
  Edited and Override empty (Codex's AGENTS.md has a line of its own,
  counted once it runs), from Read and from ReadInstructions alike.
  Codex switched on while stopped is kept; Woken writes the shared text
  into its AGENTS.md once the distro runs. Stopped again and switched
  off, Woken takes the part out (the file is "Mine.\n" again). Nothing
  was written into the stopped distro and FakeWSLRuns didn't move.
- TestWSLStoppedInstructionsUnseen (new): Pi switched on in a distro
  stopped before magpie saw its file is listed on and unseen; Codex,
  never seen and off, isn't; Takes refuses it.
- Broken by hand, each alone, the two tests above run:
  instructionsView skipping the stopped agents: "a stopped distro's
  Codex isn't on the Instructions page", "Pi switched on while stopped:
  <nil>". distrosNamed without Instructions.Agents: "no sync once the
  distro ran" at the first start. distrosNamed without
  Applied.Instructions: the same at the second start, the switch off.
  ReadInstructions back on Targets(): "Read lists 15 instructions rows,
  ReadInstructions 11". Takes without instructions: "Takes while
  stopped: ... can be given instructions". keepShape without the path:
  Codex not on the page.
- library-wsl-asleep, its new Instructions case, Chromium and WebKit,
  en, zh, zh-TW, ja and de at 1100 and 390px: Codex's row greyed, its
  path a span, not the reveal button, its switch's tooltip the
  distro's line; Pi's switch aria-disabled with the unseen tooltip; one
  line naming the distro and Pi. A click on the path asks no reveal, a
  click on Pi's switch sends nothing, Codex switched on sends claude,
  Codex and Pi with the line as the status, and Claude Code switched off
  sends Codex and Pi. Broken by hand in the page, in Chromium: Pi's
  switch sending (all 10 red at the deepEqual of the posts with [] after
  Pi's switch is clicked), the path a reveal button again (all 10 red,
  tagName BUTTON for SPAN), no line (all 10 red, 0 .lib-asleep lines for
  1).
- GUI files, each alone, Chromium and WebKit, Node 22.22.1, Playwright
  1.62.1, DISPLAY unset: library-wsl-asleep 22/22 each, i18n-keys 4/4,
  library-instr-sets 3/3, library-instr-busy 6/6, library-linked-set
  11/11, library-alma-profile 6/6, library-gone-agents 11/11,
  library-items 9/9, library-mcp-hub 11/11: 166 of 166.
- go test -tags nogui -count=1 ./internal/library ./internal/agent
  ./internal/cli: library and cli ok; agent red in TestInstalledVersion,
  TestHowInstalled, TestCursorFolderFromTheEditorIsNotTheCLI,
  TestCopilotFolderFromAnIDEPluginIsNotTheCLI,
  TestQoderSettingsFromAnIDEPluginIsNotTheCLI, TestOmpDetectedWithPiDir
  and TestZedAppPath (#3141, a set that varies from run to run;
  five of them red at origin/main ec5571d6 in its suite too). go test
  -race -run TestWSL ./internal/library: ok.
- gofmt -l clean. go vet -tags nogui for linux, windows and darwin, go
  vet for windows, go build -tags nogui for linux and darwin and go
  build for windows: exit 0 each. go vet and go build without the tag on
  linux: exit 1 (no GTK headers here).

Not run at this tree: the full go test ./..., which ran at the
branch's last commit. Not tried: a real distro stopped and started, and
the real app; FakeWSL counts the wsl.exe -d commands run in the stopped
distro (none). Not changed: the Hooks and Subagents pages (#4237,
#4238, the next commits), and the CLI's code for `library
instructions agents`, which already says on stderr that a stopped
distro's agent is written there once it runs.

Reviewed and run again by the maintainer at the stack's tree 45994757c
(this commit and the six beside it, on origin/main 90518de26), go1.26.8:
- mote (macOS, arm64): gofmt -l clean; go vet and go build for darwin,
  GOOS=linux -tags nogui and GOOS=windows (library, plugin, gui): exit 0.
  go test -tags nogui -count=1 -timeout 45m ./...: every package ok but
  internal/gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
  internal/proc TestNoCommandBypassesProc (#4491), both red on main
  from b09349d17 and c59c547c5, in files this stack doesn't touch.
  go test -race -run 'TestWSL|TestTagged|TestPinnedPiCache' for
  library and plugin: ok.
- magpie-desktop (Linux, wsl-run; WebKit hangs on mote), Chromium and
  WebKit: every library-*, sync-*, s3-sync, github-sync and i18n-keys
  file, 4 at a time: 1003 of 1020. The 17 reds are in 6 files no commit here
  touches: i18n-keys ("Unmarked", #4524), library-chip-fan, -items,
  -mcp-health, -mcp-hub (#4483) and -mcp-tools. Those 6 alone, one at a
  time, at load ~60: 74 of 92 here, 77 of 92 at 90518de26 itself. Red
  in both: i18n-keys, -chip-fan and -items in WebKit, -mcp-tools in
  Chromium ja 420; -mcp-health green in both; -mcp-hub's WebKit case
  red here only, the case #4483 has red on main. -chip-fan and -items
  are #3072's and #4501's kind, WebKit under load.
- Broken by hand on mote, each red: instructionsView skipping the
  stopped distro's agents (TestWSLStoppedInstructions, "a stopped
  distro's Codex isn't on the Instructions page", and ...Unseen, "Pi
  switched on while stopped"); keepShape without Instructions (Codex
  not on the page); distrosNamed without Instructions.Agents ("no sync
  once the distro ran"). On Linux, client.js's asleep row back to
  pathLink with the unseen switch's guard gone: library-wsl-asleep's
  Instructions test red in both engines, 10 subtests each.
2026-10-31 17:00:13 +08:00
yetone 7bc602236b library: the MCP hub is called the MCP router
The owner asked why it was a "hub". Composio calls the same thing a Tool
Router; "router" says what it does (one server that routes each call to
the right one), and "gateway" is taken by magpie's LLM gateway. Only
the words change: MCP router / MCP 路由 / MCP 路由 / MCP ルーター /
MCP-Router, "Router address", and the CLI's `magpie library mcp router
on|off`, where `hub` still works. The URL /mcp/magpie/hub, the mcpHub
setting, the servers/hub API and the Go names stay, so nothing a user
or an agent config holds changes. docs/subsystems/mcp-hub.md moves to
mcp-router.md and the pages that link it follow.

#4382's new words follow too: "Through the MCP router", "Not through
the router" and their hints in every language, and the CLI's
`magpie library mcp router <name> shared|direct` (`hub` works there
too; library_hub_test.go says router for direct, hub for shared).

Run at e2583df31 (this stack on 86fef947e), on mote: gofmt -l clean;
go vet for darwin, linux (-tags nogui) and windows; go build ./...;
go test -tags nogui ./... -timeout 45m, 81 packages ok, 0 FAIL;
library, gateway, imagemcp, sessions, cli and gui again alone, ok;
site's node --test, 49 of 49. GUI on xiaomi-gpu (Windows; mote's
browsers crashed under other sessions' suites): library-*, image*,
mcp-hub-direct, i18n-keys, list-sort and plugin-tools, both engines and
every language, 1055 of 1056: i18n-keys found "{name} is given to each
agent directly" dropped from the library's strings in the rebase. Put
back in the first commit; at the pushed head i18n-keys, mcp-hub-direct
and library-mcp-hub are 48 of 48. That is the only difference from
e2583df31.
Broken by hand at e2583df31: imagemcp ignoring magpie/roots fails
TestHubCallSavesInTheCallersProject; the router asking anything but
roots/list fails TestHubAsksTheAgentItsRoots and TestHubRootsUnasked;
inHub leaving magpie-image out fails TestHubGivesMagpieImage.
The CLI's TestProviderAddressMovesALocalServer red at -count=3 was
the same on origin/main 380032cda and is fixed in 65c792410.
Rebased once more onto 2570efb5f, which changed library-mcp-hub,
list-sort, mcp-hub-direct and gateway-routing.md. Run at the pushed
head: go build; gateway, library, cli and imagemcp tests ok; the GUI
budget tests ok; on xiaomi-gpu i18n-keys, mcp-hub-direct,
library-mcp-hub and list-sort, 51 of 54. The three reds were WebKit
420px library-mcp-hub cases with no Connect sheet after a reload.
origin/main d77da5bff goes red the same way (de 420px, 9 of 11). In a
second run of library-mcp-hub on WebKit at this head, 11 of 11 passed.
Filed as #4483.
2026-10-31 02:49:08 +08:00
yetone b78b1de003 library: magpie-image is behind the MCP hub, saving into the calling agent's project
magpie-image was the one MCP server the hub left out, because it saves
what it makes on disk and needs to know whose project that is. The hub
now serves its tools like any other server's and tells it where the
caller works:

1. the hub answers a tools/call as SSE and asks the agent roots/list on
   that stream (3s), as Claude Code answers;
2. else Codex's _meta x-codex-turn-metadata.workspaces (git repos only);
3. else the Codex thread's cwd from its session file
   (sessions.CodexThreadCwd), only with session consent;
4. else none, and the image goes to ~/Pictures/Magpie as before.

The hub passes `magpie/roots` and `magpie/client` in the call's _meta;
imagemcp saves into the first root and names the agent on its usage
row. Its result carries `magpie/model`, which the hub's own usage row
takes, so the row says which image model drew it. A WSL agent keeps
magpie-image as its own entry (the hub can't reach a path inside the
distro). docs/subsystems/mcp-hub.md (mcp-router.md after the next commit), gateway-routing.md and
gateway-sessions.md say so.

It is rebased on #4382 (b889ffe81), which lets the user keep a server
out of the hub (Server.Hub = direct). inHub now asks both: a server
kept direct is out, and magpie-image is in unless the agent is in WSL,
so the user can keep magpie-image direct too; the editor's switch
shows for it like any server, and the hub's line counts it with the
others (mcp-hub-direct.test.cjs follows).

Run at e2583df31 (this stack on 86fef947e), on mote: gofmt -l clean;
go vet for darwin, linux (-tags nogui) and windows; go build ./...;
go test -tags nogui ./... -timeout 45m, 81 packages ok, 0 FAIL;
library, gateway, imagemcp, sessions, cli and gui again alone, ok;
site's node --test, 49 of 49. GUI on xiaomi-gpu (Windows; mote's
browsers crashed under other sessions' suites): library-*, image*,
mcp-hub-direct, i18n-keys, list-sort and plugin-tools, both engines and
every language, 1055 of 1056: i18n-keys found "{name} is given to each
agent directly" dropped from the library's strings in the rebase. Put
back in the first commit; at the pushed head i18n-keys, mcp-hub-direct
and library-mcp-hub are 48 of 48. That is the only difference from
e2583df31.
Broken by hand at e2583df31: imagemcp ignoring magpie/roots fails
TestHubCallSavesInTheCallersProject; the router asking anything but
roots/list fails TestHubAsksTheAgentItsRoots and TestHubRootsUnasked;
inHub leaving magpie-image out fails TestHubGivesMagpieImage.
Real use, sandbox HOME and gateway, at 62421e570 (before the rebase): Claude Code saved into its project
via roots/list; Codex in a git repo via its workspaces _meta; Codex
outside a repo with session consent via the thread's cwd.
At 62421e570 the whole GUI suite ran on WSL magpie-desktop at load 116 to 135 from other
runs: 504 of 15757 red in 118 files, WebKit timeouts, none in a file
this change touches; filed as #4471 with the list.

Rebased once more onto 2570efb5f, which changed library-mcp-hub,
list-sort, mcp-hub-direct and gateway-routing.md. Run at the pushed
head: go build; gateway, library, cli and imagemcp tests ok; the GUI
budget tests ok; on xiaomi-gpu i18n-keys, mcp-hub-direct,
library-mcp-hub and list-sort, 51 of 54. The three reds were WebKit
420px library-mcp-hub cases with no Connect sheet after a reload.
origin/main d77da5bff goes red the same way (de 420px, 9 of 11). In a
second run of library-mcp-hub on WebKit at this head, 11 of 11 passed.
Filed as #4483.
Not tried: Codex outside a git repo without consent (it saves to
~/Pictures/Magpie, #4435); agents on Windows and in WSL with real use.
2026-10-31 02:49:08 +08:00
yetone b889ffe813 library: a server can stay each agent's own entry with the MCP hub on (#4382)
cuipengcx90's #4382, Option A's first step (nifengfanpan asked on
Discord): with the MCP hub on, every Library server went behind magpie's
one entry, so a server that reads its project from the folder it starts
in, or keeps a session's state, resolved the wrong repository or shared
state across agents. A server now has a hub policy, Server.Hub ("hub" in
library.json): "" (shared, the default, so nothing changes for existing
users; "shared" is saved as "") or "direct". A direct server is left out
of the hub through inHub, the test that already keeps magpie's own image
server out, so each agent given it keeps its own entry written as with
the hub off, beside the hub's entry for the rest. An agent whose every
server is direct gets no hub entry. The hub neither lists nor runs a
direct server, at /mcp/magpie/hub either, and hubPrune ends one it held.
Switching goes through change(), so the agents are written again at once
and the entry from the other policy is removed. An unknown policy is an
error.

- GUI: with the hub on, the server editor has a "Through the MCP hub"
  switch (role=switch, not a <select>; not shown with the hub off or for
  the image server), a direct server's row has a "Not through the hub"
  tag, and the hub's line and the Connect sheet name the direct servers
  with the image server as given directly. Strings are in zh, zh-TW, ja
  and de ("MCP 聚合" as the core uses it).
- CLI: magpie library mcp hub <name> shared|direct (ServerHub), and
  magpie library marks a direct server.
- TUI: an edit keeps the policy.
- Not done: Option B (per-roots/project backends behind the hub, keying
  hubPool by roots). It is left for later; #4382 stays open for it.

Run:
- TestHubDirectServer (internal/library) and the extended
  TestLibraryMCPHub (internal/cli) on mote. Broken by hand: inHub back to
  !isSelf(s) makes TestHubDirectServer red ("codex with the hub on:
  [magpie], want [index magpie]").
- Real configs in a sandbox HOME on mote (fake claude on PATH, the real
  binary built from this tree): mcp add index + web for claude and codex,
  hub on, hub index direct, shared, then both direct. The direct index
  entry was in .claude.json and .codex/config.toml beside magpie's; with
  every server direct both files were byte-for-byte as with the hub off
  (json.tool diff and diff); shared again removed the index entry.
- Full Go suite (-tags nogui -timeout 45m ./...) on mote at this tree
  rebased on origin/main 72ed121fd: 81 packages ok. Before the rebase
  the only red was TestQuotaSpanCarriesEveryWindowField (#4457, fixed by
  ccbefe2a2). GOOS=linux and GOOS=windows go vet clean, gofmt clean.
- GUI on WSL (magpie-desktop; mote's GUI is broken, #4125), both engines,
  every language: the new mcp-hub-direct.test.cjs (1100 and 390 wide,
  hub on and off), library-mcp-hub, mcp-local-server, i18n-keys: 88 pass.
  Broken by hand: not sending hub in the save makes mcp-hub-direct red
  (11 of 11 in chromium).
- The 54 library/mcp/i18n GUI files at --test-concurrency=4 on WSL at load
  ~160: 978 of 988 pass. Red: library-chip-fan (webkit, fan positions),
  library-mcp-tools (chromium ja 420, "the click scrolled the page") and
  mcp-oauth-app (chromium de 390). None of them touch the hub switch or
  the editor's new field. They are being rerun alone, here and on
  origin/main, after this push; a red that only this change has is fixed
  next, and a red on main too is filed.

Not tried: the whole GUI suite (1028 files); a real cwd-sensitive
server in a real agent session; the live app window.
2026-10-31 00:34:45 +08:00
yetone 48edbcb674 library: RTK covers Droid, and lists Qoder, Cline and Kimi Code with why
lml0664 on Discord: Library > RTK offered a fixed few agents, even on the
latest magpie. RTK 1.1.0 (rtk-ai/rtk, Latest, 2026-10-25) has `rtk init`
agents claude, cursor, trae, windsurf, cline, kilocode, antigravity, kimi,
pi, hermes, droid, vibe, omp, plus --codex/--gemini/--opencode/--copilot.
Every one with a global hook that magpie has an agent for was already on
the page except Factory's Droid, which is added now:

- droid: rtk's own `rtk init -g --agent droid`, given Droid's folder as
  FACTORY_HOME_OVERRIDE (magpie's droid agent honours it). rtk writes its
  Execute group (`rtk hook droid`) into the root hooks.json, or into
  settings.json's hooks.PreToolUse when Droid's hooks already live there
  (src/hooks/init/droid.rs), so ReadRTK and switching off look at all
  three files rtk may use (hooks.json, hooks/hooks.json, settings.json)
  and leave the user's own hooks and settings. rtk before 0.44 has no
  Droid agent, so it is blocked with "needs RTK 0.44 or newer".
- dropHook no longer slices key[:-1] for a top-level key (hooks.json's
  "PreToolUse"); before, it would have panicked.

Listed with the switch off and their own reason (rtkNoHook and the page's
rtkNoHookWhy, in zh, zh-TW, ja and de too):
- Qoder, Qoder CN: rtk 1.1.0 has no Qoder agent (`--agent qoder` is an
  invalid value), rtk-ai/rtk#1327 (PR #1721 open).
- Cline: `rtk init --agent cline` only writes a .clinerules in the
  current project asking the model to type rtk, no hook (#3841).
- Kimi Code: Kimi's hooks can't rewrite a command; rtk writes only one
  project's AGENTS.md and refuses -g ("Kimi AI is project-scoped").
RTK's Trae, Windsurf, Kilo Code and Mistral Vibe have no magpie agent.

Run:
- go test -tags nogui ./internal/library -run TestRTK on mote: ok
  (TestRTKDroid home/override, TestRTKDroidSettingsHooks,
  TestRTKNoHookQoderClineKimi new, sandbox HOME, fake rtk).
- Red on old code: rtk.go at HEAD^ -> TestRTKDroid, ...SettingsHooks and
  ...NoHookQoderClineKimi red. Broken by hand: version gate at 0.43, the
  settings.json entry dropped -> red; FACTORY_HOME_OVERRIDE not passed ->
  TestRTKDroid/home red. client.js at HEAD^ -> library-rtk-nohook red
  (Qoder's reason was the generic one).
- Real rtk 1.1.0 (release tarball, sha256 checked against checksums.txt)
  on mote in a sandbox HOME through SetRTK/ReadRTK: plain ~/.factory,
  settings.json with the user's own Execute hook (kept, rtk's taken out)
  and FACTORY_HOME_OVERRIDE: on, seen on, off, seen off. Real rtk also
  refuses --agent qoder and -g --agent kimi, and cline writes .clinerules.
- Full suite on mote, go test -count=1 -timeout 45m ./...: 80 packages
  ok; internal/gui red only in its 10 real-window AppKit tests (#4125).
- GOOS=linux and GOOS=windows go vet ./internal/library: ok. gofmt clean.
- GUI on the WSL box (mote's browsers crash at launch, #4125):
  library-rtk-nohook (chromium+webkit, en+zh) and i18n-keys 10/10; all 45
  library-*.test.cjs files 810/824, the 14 reds (library-chip-fan webkit,
  library-items webkit, library-mcp-tools chromium ja 420) are the same
  at origin/main cf9ea977c and are #4120.

Not tried: a real Droid session running the hook; the whole GUI suite
(only the Library files); Windows (Droid's folder there is the same code
path; no run).
2026-10-30 20:03:32 +08:00
yetone 4054251865 library: an MCP server can be kept to this computer, never synced
huhuy72219405 on X: "能不能把不同设备的mcp区分一下,有些mcp属于本地的,
同步之后其他设备不应该读取到". A server in Library > MCP now has a
"This computer only" switch in its editor (Server.Local; CLI
`magpie library mcp add ... --local` and `magpie library mcp local
<name> on|off`; the TUI keeps it on edit and marks the row).

- Collect leaves local servers out (carriedServers), so neither a sync
  nor a backup file takes one to another computer. Turning a shared
  server local takes it out of what is carried, so the other computers
  drop it at their next sync; the flag itself is never carried.
- Put (sync, join, Restore, Undo, backup file) keeps every local
  server, with its agents, and clears Local on what comes in.
- Another computer's server by a local server's name goes to
  Library.Away: given to no agent, not in the hub, carried on as it
  came, so a push from here never removes it from the computers that
  have it. settleAway (every change) promotes it once the name is gone
  here, and drops it once the name is shared here again.
- The hub serves local servers like any other (it runs here);
  subagents aren't carried, so one naming a local server keeps it.

Docs: docs/subsystems/library.md, docs/subsystems/sync-backup.md.

Run at f5dd4e142 + this change; after rebasing on d3898ca8d (gui/provider only, then 2a1ef15ba, routing), vet, the five new Go tests, mcp-local-server and i18n-keys again, ok:
- mote: gofmt -l clean; go vet of library/backup/davsync/cli/tui;
  GOOS=linux and GOOS=windows go vet -tags nogui of the same; go test
  of TestLocalServerNotCarried, TestPutKeepsLocalServer,
  TestPutSameNameAsLocal (library), TestRestoreKeepsLocalServer
  (backup), TestLocalServerThroughSync (davsync, two computers through
  the fake S3) ok.
- mote GUI, Chromium and WebKit: mcp-local-server.test.cjs (new; every
  language, 1100 and 390 wide, switch saves local true/false, row tag,
  no sideways scroll), i18n-keys, mcp-editor-cancel,
  mcp-startup-timeout, every library-mcp-*, mcp-oauth-app, mcp-signin*,
  library-items, library-servers-bulk, library-subagents,
  library-pick-remove, library-env-refs, library-zed-mcp,
  library-loading: all pass (126 of 126 in the last batch).
- Full Go suite, -tags nogui -timeout 45m, on the Linux box (wsl-run;
  mote had another session's full suite running): every package ok
  but internal/agent, whose TestInstalledVersion, TestGrokInstalled,
  TestOmpDetectedWithPiDir and TestZedAppPath fail the same at
  origin/main 9b4d0bda8 on that box; all four are #4033.
- Real CLI in a sandbox HOME on mote: mcp add --local, local on/off,
  `magpie library` shows "this computer only", library.json has
  "local": true; an unknown name and a bad value are refused.

Broken by hand: putServers not keeping local servers turned
TestPutKeepsLocalServer, TestPutSameNameAsLocal,
TestRestoreKeepsLocalServer and TestLocalServerThroughSync red;
carriedServers carrying local servers turned TestLocalServerNotCarried,
TestPutSameNameAsLocal, TestRestoreKeepsLocalServer and
TestLocalServerThroughSync red.

Not tried: a sync between two real computers; the real GUI app (the
Playwright run fakes the API); the full Go suite on macOS or Windows.
2026-10-30 02:31:08 +08:00
yetone f49cebb35b library: a click on an MCP server's needs-sign-in status signs in
The owner, on a remote server's "需要登录" status in Library > MCP
servers: "这里点击应该走登录逻辑。" A click there checked the server
again, which only said the same thing.

- A remote (http) server whose check asked for an OAuth sign-in, and
  that no agent's own sign-in already uses (canSignIn), signs in from
  its status: the same library/mcp-signin the dialog's Sign in starts,
  the browser opened in a browser page as there. No dialog opens unless
  the user has something to do in it: the browser didn't open (the
  link to open by hand) or the sign-in failed.
- While it is under way the status says "Opening the sign-in…", then
  "Finish signing in in your browser…"; a click on it then opens the
  dialog, which has Cancel. The dialog's box and the row's status both
  follow it (followSignIn, lifted out of the dialog so the row is told
  with the dialog closed), and Cancel there repaints the row.
- The tip says "Click to sign in" on such a status; a server with no
  OAuth (a key it lacks) still checks again.
- zh/zh-TW/ja/de for the two new strings.

New mcp-signin-click: linear (a click signs in with no dialog, then 7
tools and Signed in), notion (the browser doesn't open: the dialog with
the link, then Cancel, the row back to needs sign-in) and a keyed
server (no OAuth: a click checks again), both engines, 5 languages,
1100 and 390 wide. Broken by hand (canSignIn false): 22/22 red.
library-mcp-health's tip expectation is "Click to sign in" for linear.

Run at this commit, on mote: mcp-signin-click, mcp-signin,
mcp-signin-health, library-mcp-health, library-mcp-hub, i18n-keys:
82/82 ok. Earlier, this change with the two before it under the whole
library/mcp/i18n GUI set: 944 tests, 942 ok; the 2 reds are
library-row-remove's chromium ja hook row (#3099, open), not touched.
go test ./internal/gui: TestMainWindowCorners/macOS_26_SDK red on
mote's macOS 27 (#3949), the rest ok.
Rebased on origin/main 18005c803 and run again at the pushed head:
gofmt clean, go test -run 'Budget|I18n|Plugin' ./internal/gui ok (the
core-script budget 18005c803 set holds), and the six files above
82/82 ok.
Not tried: a real remote server's OAuth in the real app.
2026-10-29 23:01:28 +08:00
yetone 0aad5d56ac library: the Connect sheet's search has its glass and text on the box's middle
The owner: "这里的文字和icon竟然没有相对于输入框在垂直方向上居中". The
search box is a <label> inside the sheet, an .editor, so app.css's form
rule `.editor label { padding-top: 5px; text-align: right; font-size:
12px }` (8px under body.web) outranked `.lib-hubsearch`'s `padding: 0
8px`. With the box 28px tall, that pushed the glass and the input 2.5px
below the middle (more on a phone page).

- The box's rule is `.editor.lib-hubsheet label.lib-hubsearch`, which
  outranks both, and says its own padding, alignment and size.
- The input fills the box's height with no margin.
- On a phone page (body.web, narrow) every input is 44px with 16px text,
  so iOS doesn't zoom. The box grows to 44px round it rather than
  squeezing the input.

library-mcp-hub now measures, in both engines, 5 languages, 1100 wide
in the app and 420 in a browser, that the glass, the input and its text
line are within 0.5px of the box's middle and the input stays in its
box. Red on the old CSS, 22/22 ("the search's glass is 2.50px off the
box's middle"). The first fix was red 12/22 at 420 (the input stayed
44px and ran 8px out of a 28px box), which is why the box grows on a
phone.

Run at this commit (its own worktree), on mote: library-mcp-hub and
i18n-keys, 26/26 ok. WebKit screenshots at zh 1100 and 420 checked by
eye: the glass and "agent 2" sit on the middle.
Not tried: the real app's WKWebView (Playwright WebKit only).
2026-10-29 22:58:52 +08:00