Commit Graph
40 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 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 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 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 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 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 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 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 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
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 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
yetone b0ab8420c1 library: the MCP hub's mark is magpie's bird, its address row says Hub address, and magpie-image is said to go direct
The owner, on Library > MCP servers: "我不喜欢这个logo" (the hub row's
crosshair glyph), "其他应用的这个文案好莫名其妙" (the row with the hub's
address was titled "Other apps"), and "我明明有两个MCP,这里为什么只显示
一个" (the Connect sheet counted linear and left magpie-image out).

- The hub row and the Connect sheet's head draw magpie's bird (#bird),
  the one server each agent is given, in place of GLYPH.hub.
- The address row is titled "Hub address"; who connects there (Cursor,
  VS Code, any other app) moved to its tooltip.
- magpie-image is never served through the hub: it asks its agent for
  the project's folder (MCP roots; inHub in internal/library/mcp_hub.go).
  The hub's stats and the sheet's line now say "magpie-image is given to
  each agent directly", so the count adds up. The image-server test is
  one isSelf for both.
- zh/zh-TW/ja/de for the three strings.

Run at this commit (d8dc8a114's tree, worktree of its own), on mote:
library-mcp-hub, library-mcp-health and i18n-keys,
both engines, 5 languages, 1100 and 420 wide: 32/32 ok. The hub test's
fixture has a magpie-image server now, and checks the bird in the row
and the sheet, the "Hub address" name and the direct line.

The whole library/mcp/i18n GUI set with the later two commits on top:
944 tests, 942 ok; the 2 reds are library-row-remove's chromium ja
hook row (#3099, open, its trash has no box yet), not touched here.
go test ./internal/gui: TestMainWindowCorners/macOS_26_SDK red on
mote's macOS 27 (#3949), the rest ok.
Not tried: the real app with a real magpie-image entry.
2026-10-29 22:58:52 +08:00
yetone c1da9ccda3 library: a stopped WSL distro's agents are listed, and a tick for one is written there once it runs (cybercaius on Discord)
cybercaius: with WSL not started, the Library's MCP page didn't list the
agents in the distro at all, and nothing ticked for them could be kept.
A stopped distro's agents are no targets (#3896: opening their files
starts the distro), so they fell off the page.

While a distro runs, each agent's places and what its MCP file takes are
kept in wsl.json (keepShape, agent.WSLKeep, key library:<kind>). While it
is stopped, Read lists its agents from that (asleepView, asleep: <distro>)
with the library's ticks; one magpie never saw is listed only on rows that
name it, as unseen, its chip disabled and kept by every click (keptOf). A
tick on a stopped agent is kept in library.json (Takes accepts a known
shape, serversAgents judges it by shape.reaches); nothing is opened or run
in the distro. Woken, from KeepLinked's 30s loop, syncs once a distro the
library names goes from stopped to running (wsl.exe -l --running starts
nothing). The page greys a stopped agent's chip and says why in its
tooltip and one line per distro; the MCP hub leaves them out. The CLI says
the same on stderr (AsleepIn). en, zh, zh-TW, ja, de.

Run at this tree (20695ad8b before this message; on adc618bbf):
- mote: gofmt -l clean; go vet -tags nogui for darwin, GOOS=windows and
  GOOS=linux on internal/library, internal/agent, internal/cli; go test
  -tags nogui -timeout 45m ./internal/library ./internal/agent
  ./internal/cli: ok (internal/gui ok too at the 96a703a59 base).
- WSL magpie-desktop: library-wsl-asleep, i18n-keys, library-gone-agents,
  library-items and library-mcp-hub, Chromium and WebKit: 88/88. At the
  96a703a59 base every library-*, mcp-*, skill-* file and i18n-keys:
  1148 of 1164; the reds were library-chip-fan (WebKit),
  library-mcp-tools (chromium ja 420), library-items and
  skill-group-shared (WebKit) beside another session's full GUI suite.
  Alone, library-items and skill-group-shared pass, and chip-fan and
  mcp-tools are red the same on an origin/main 96a703a59 copy (#4120,
  commented).

Broken by hand: asleepView returning nothing made TestWSLStoppedListedAndQueued
("a stopped distro's Codex isn't listed") and TestWSLStoppedUnseen red;
Woken never syncing made TestWSLStoppedListedAndQueued red ("no sync once
the distro ran"); keptOf without unseen made library-wsl-asleep red in
all 10 Chromium cases (Pi's tick dropped by a click on Claude Code).

Rebased onto fa2332976 (gateway, provider and Codex effort commits, nothing
in internal/library, internal/agent/wsl or the Library page) before the
push: go vet of the three packages and go test -run TestWSL
./internal/library ok there; the full packages ran at adc618bbf.

Not tried: a real distro stopped and started. magpie-desktop was running
another session's full GUI suite, which stopping it would have killed, and
the other distros are other people's. The tests use FakeWSL, which counts
every wsl.exe -d command run in the stopped distro (none). Not changed:
the Instructions, Hooks and Subagents pages still leave a stopped
distro's agents out (#4182, #4237, #4238).
2026-10-29 18:34:44 +08:00
yetone da8039368f library: skills kept in ~/.agents/skills can be handed over to the library, and then turned off per agent
tnt1223 on Discord asked for the skills in ~/.agents/skills to move into
magpie's library folder and be managed there ("统一移入 magpie 的资源库文件
夹,交给 magpie 管理"), since a skill there can't be turned off for one agent
("不能决定某个 skill 是否自由开启"). Codex, Gemini CLI and the other readers
of that folder read it themselves, whatever the library ticks. Goose, Kimi
Code and Cindy use it as their own folder.

HandOverSkills (POST /api/library/skills/hand-over with names) does the
hand-over only when the user asks for it:
- A folder kept in ~/.agents/skills moves into library/skills/<name>
  (moveIn). It is renamed, or, across disks, copied. A copy has to read
  back the same (sameTree) before the original is set aside with the
  backups. On any failure the folder stays where it was and the library's
  link stays as it was.
- An entry there that only links to a folder elsewhere is removed, and
  the library links straight to that folder. The folder itself stays.
- The user's own links to the skill in agents' folders are removed too,
  since they would point at nothing. The library gives those agents its
  own link.
- Every agent here that read the skill there (readsSharedHere, plus the
  agent of each such link) is ticked. So each agent keeps the skill, now
  from the library, until the user unticks it or turns it off here.
- A skill found there that isn't in the library yet is imported first.
- A name that can't be handed over is listed in Result.Unmoved, and the
  other names are handed over all the same.
HandBackSkill moves the folder back and links the library to it again.

"Kept there" is now sharedEntry: the skill's own entry in the shared
folder, by its name, or, for a library link into it under another
folder's name, by that folder's name. Everything that read the old
by-name check follows it:
- SkillView.Always, plus the new Shared and SharedElsewhere fields;
- syncSkills' in-shared check;
- the shared folder's own target, which no longer gets a second link
  beside such an entry. TestSharedUnderAnotherName covers this, and it
  fails without the guard.

Where:
- GUI, Library > Skills: a row kept there has "Manage in magpie"
  ("交给 magpie 管理") in its source line. With more than one such row,
  the skills heading has "Manage {n} in magpie". Each asks first, in the
  page, and says:
  - where the folder goes, or that only the link goes;
  - which agents keep the skill, ticked;
  - how to put it back.
  Cancel sends nothing. The strings are in en, zh, zh-TW, ja and de.
- CLI: `magpie library skill hand-over <name…>|--all` and
  `magpie library skill hand-back <name>`.

Existing users: nothing changes until they click. A library.json gains
no new key.

Run (mote, at 58e926e5d/d4b7c0586 rebased on 3142a5559 unless said):
- gofmt -l: clean.
- go vet on darwin, GOOS=linux -tags nogui and GOOS=windows, for
  library, cli and gui. GOOS=linux and GOOS=windows builds.
- go test -tags nogui ./... -timeout 45m, at the pre-rebase base
  a14f5c9c9: 76 packages ok. The one red was internal/gui's
  TestCoreScriptBudget (1531446 > 1530861), which is red on main since
  a4e929212 (#4133). This change adds no core script.
- Windows (win-run, xiaomi-gpu): TestHandOver*, TestSharedUnderAnotherName
  and TestSharedAgentsSkills pass. TestHandOverFailureKeepsOriginal
  skips there, because a read-only folder can still be written.
- GUI: skill-handover.test.cjs in Chromium and WebKit, at 860 and 400px,
  in five languages, plus the heading's all-at-once case. It ran with the
  library skill files and i18n-keys: 84/84.
- Whole GUI suite, on the Windows box (mote was running another
  session's full suite). Nine reds, all in pages this change doesn't
  touch:
  - webkit: agents' sign-ins read, or not at all;
  - disconnect previews use the full body width (chromium and webkit,
    en and zh);
  - webkit zh: an agent's model list;
  - webkit en/ja 1100: an agent's own settings are in its opened row;
  - webkit: a token on a new custom provider with no Balance URL.
  These are NOT yet compared with main. The local disk filled up before
  the run's summary could be read.

- At the head rebased on 4d9058a98 (WSL magpie-desktop): go vet
  -tags nogui on library and cli; TestHandOver*,
  TestSharedUnderAnotherName, TestSharedAgentsSkills and
  TestLibrarySkillHandOver pass; skill-handover and i18n-keys pass 28/28.
  i18n-keys was red there first: the hand-over tooltip "Move these {n}
  out of ~/.agents/skills…" said the usage plugin's word "{n} out".
  It now reads "Move these {n} from ~/.agents/skills…".

Broken by hand:
- Without the ticking, the HandOver tests fail.
- Without syncSkills' guard, TestSharedUnderAnotherName fails ("goose
  was given it twice").
(At 400px the first layout squeezed the path to nothing. The button
now shrinks first, and the test checks the path's width. That check
wasn't run against the old CSS.)

Not covered:
- Another computer whose skill is still in its own ~/.agents/skills gets
  the library's copy from a sync, beside its own, until it is handed over
  there too.
- The skills CLI's lock (npx skills update) may put the entry back.
- No hand-back button in the GUI; the sheet names the CLI command.
- Tried in a sandbox HOME only, never on a real ~/.agents.
2026-10-29 15:52:42 +08:00
yetone 85d159a288 library: Connect an app is two tabs, agents in groups with a switch each (#2679)
The sheet behind Connect… is redesigned, closer to how Composio's MCP
router reads, and holds up with 25+ agents.

Agents tab: agents → magpie → servers drawn as icon stacks with
magpie's own bird in the middle (no accent block), one line of where
things stand ("19 of 23 agents use…", or the lone agent named), then
the agents in three groups: not connected, connected, keeping each
server's own entry. Each row is a switch (servers/agents-all
{agents:[id], on}); a kept agent shows a short word for why with the
full reason behind (i). Connect all in the bar connects the rest in
one post. With more than 8 agents a search narrows every group, and
the connected and kept groups fold to one row each ("Claude Code,
Cursor and 17 more") so the sheet fits the window.

Other apps tab: the address, then a row per app (Cursor when it isn't
an agent, VS Code, Windsurf, any JSON app) saying where its entry goes,
with Copy entry; Cursor and VS Code get Add in the app (hub-open).

Behaviour change: the switch's off takes every Library server away from
that agent (as By agent's Turn all off does), so turning it on again
gives it all of them, not the ones it had before.

"Why", "Connected" and "Not connected" moved to the core i18n.js: Go
files say them too, so i18n-keys refuses them as plugin words. zh says
已连接 / 未连接.

docs/subsystems/mcp-hub.md's GUI row describes the new sheet (and loses
a duplicated cell).

Run at 239981794 (rebased on origin/main fa2dfc145), on mote:
- node --test library-mcp-hub + i18n-keys: 26/26 pass, chromium and
  webkit, en/zh/zh-TW/ja/de, 1100px app and 420px browser.
- go test -tags nogui -count=1 ./internal/gui: ok (55s), core budgets
  included. gofmt -l: clean.
- Before the rebase (5292964f1), the whole GUI suite was started on
  mote; it had not finished when this was pushed, its result goes on
  #2679.
- Screenshots of every language/engine/width checked against the
  approved mockup.

Broken by hand, both went red: no fold at 25 agents (the fits-the-window
and group assertions failed), and Windsurf's entry written with "url"
instead of "serverUrl" (the copied-entry assertion failed).

Not tried: real VS Code / Cursor install links from the new Add, and the
sheet in the real Windows and Linux apps.
2026-10-29 05:37:34 +08:00
yetone fe05f0a721 library: a skill can be turned off on this computer alone, and a sync neither carries that nor turns it on
hanslin1666 on Discord (#general 1565016936344191096) wanted a library
skill off on one computer only ("只在这台电脑上关掉"). The only way to do
that was to untick its agents, and the ticks are what a sync carries, so
every other computer lost it too. A sync from a computer that had it on
also gave it back here.

Skill.OffHere (library.json "offHere", omitempty) turns a skill off on
this computer. No agent here gets it, whatever Agents says. Every reader
that gives a skill to an agent now asks gives():
- syncSkills, including the shared ~/.agents/skills check;
- desktop_skills.go;
- skill_changed.go;
- skill_edits.go;
- behind;
- Targets.
Agents stays what a sync carries, and the page shows those chips faded.

Collect never carries OffHere, so turning a skill off changes no part a
sync uploads. Put keeps this computer's OffHere for a skill it puts, so
a sync from a computer that has it on (or that gives it to more agents)
leaves it off here.

Where to turn it off:
- GUI: a power button on the skill row (aria-pressed). When off, an
  "Off on this computer" tag sits on its own line under the name; it
  says why and turns the skill on when clicked.
- CLI: `magpie library skill off-here|on-here <name>`.
- TUI: the row says the skill is off.
The strings are in en, zh, zh-TW, ja and de.

Existing users: nothing changes. An older library.json has no offHere,
so every skill stays on, and a skill that was never turned off writes no
key (TestSkillOffHereOldLibraryIsOn).

Not covered:
- a project's skills;
- a library skill whose own folder is inside ~/.agents/skills, which
  agents read in place;
- a skill another computer removes (the flag goes with it).
The skill's files in the library folder still update while it is off.

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

Run at the parent aeacc6358 (rebased on origin/main), on mote:
- gofmt -l: clean.
- go vet ./...; GOOS=linux go vet -tags nogui ./...; GOOS=windows go
  vet ./...; go build ./...: ok.
- go test -tags nogui -timeout 45m ./internal/library ./internal/davsync
  ./internal/cli ./internal/tui ./internal/gui ./internal/backup: all ok.
- GUI, Chromium and WebKit:
  - skill-off-here: 22/22 (en, zh, zh-TW, ja, de at 860 and 400px).
  - i18n-keys, gui-ja, gui-de, gui-zh-tw, library-items, library-mcp-hub,
    library-all and library-toggle-status: green. The first try timed out
    in browserType.launch (mote at load ~60); run again one file at a
    time, they passed.
  - library-row-remove: Chromium red in the hooks part, 2 or 3 of 11
    each run. It is red the same way on origin/main aeacc6358, 3 of 3
    runs there too (#3099); this change doesn't touch hook rows.
- Before the rebase, at e5e2aa58e plus this change: the 98 GUI files
  that reach the library page (1350 tests). 68 reds, nearly all
  browserType.launch timeouts under load; run again one file at a time,
  all passed except mobile-web's "desktop matches origin/main"
  subtests. Those need .git, which mote-run doesn't copy.

Then rebased onto ec3dad75a, which changes no library file. At this
pushed head: go build ./..., go vet of library and gui, the gui Budget
tests, and i18n-keys plus skill-off-here in both engines (26/26), all
ok.

Broken by hand (restored afterwards):
- Put dropping OffHere:
  - TestSkillOffHereStaysHere:96 failed: "a sync from a computer with it
    on gave pdf to an agent here again".
  - TestSkillOffHereThroughSync:108 failed: "a sync from A, with pdf on,
    gave it to an agent on B again".
- gives() ignoring OffHere: TestSkillOffHereStaysHere:74 failed: "off
  here, claude still has pdf".
- The GUI test fails on the old code, which has no button.

Not tried:
- no real WebDAV or GitHub backend (the sync test uses the fake S3);
- no real app run with real agents;
- no Windows or Linux test runs (only GOOS=windows and GOOS=linux vet);
- not the whole GUI suite, only the 98 files that reach the library page,
  the i18n checks and gui-ja, gui-de and gui-zh-tw.
2026-10-29 04:23:33 +08:00
yetone e0ea15b8e8 library: an MCP hub, one magpie server in place of every library server (#2679)
With Library → MCP → "MCP hub" on (off by default), each agent that takes
an MCP server over HTTP is given one entry, magpie, at
/mcp/magpie/hub/<agent>, in place of the library servers ticked for it.
magpie runs those servers itself, once for every agent: a command starts
on its first call and ends after 10 idle minutes, a URL server is reached
with its headers and MCP sign-in. Tools are <server>__<tool>; a tool off
in the library is neither listed nor run. Any other app connects at
/mcp/magpie/hub, which serves every library server. Both are guarded as
/mcp/magpie/tools is (local or a gateway key, no foreign page, 4 MiB,
the key's limit per call). An agent that reaches no server over HTTP
(Claude Desktop), has a magpie entry of its own, or sits beside a library
server called magpie keeps each server's own entry, and the page says why.
Off gives every agent its servers back and ends every process the hub
started.

GUI: a switch under the MCP list, a line of what it serves, the address,
and a Connect… sheet. The sheet lists every agent magpie detects that
takes MCP (not a fixed four), each with where it stands; one given none of
the hub's servers has a Connect that ticks it for every server it can
reach (servers/agents-all), so it gets the entry, and the sheet stays
open. Then any other app: Cursor (when it isn't a detected agent), VS
Code, Other, with the JSON and, in the app, "Add to …" through the app's
own install link built in Go (servers/hub-open; the page never sends a
link). CLI: magpie library mcp hub on|off. Design: docs/subsystems/mcp-hub.md.

With #3885 (62045475b): with the hub on, Codex is given the one magpie
URL entry, and the servers behind it never reach runVia, which takes a
command server only; with the hub off Codex gets /mcp/run/<name> as before.
Rebased onto it; the one conflict was both commits declaring base in
syncMCP.

Run:
- At 62045475b + this (the pushed tree), on mote: gofmt -l, go vet,
  GOOS=windows go vet, GOOS=linux go vet -tags nogui clean; go test
  -timeout 45m internal/library (108s), gateway (510s), cli (50s) ok.
  The GUI files and internal/gui weren't run again: 62045475b touches
  neither, and the rebase changed nothing in them.
- At ddf31ca30 + this: go test -timeout 45m for
  internal/library, gateway, cli and gui on mote; gofmt -l; go vet,
  GOOS=windows go vet, GOOS=linux go vet -tags nogui; win-run of
  library-mcp-hub and i18n-keys (both engines, en zh zh-TW ja de, 420px).
  gofmt and the three vets clean; library, gateway (554s) and cli ok;
  gui ok but TestMainWindowCorners, red the same on origin/main ddf31ca30
  on mote (#3949); GUI 26 of 26 pass.
- Earlier base (582bd8036, before TestHubConnectAnAgent and the oneport
  consts): full go test ./... on mote, every package ok but gateway's
  TestClientPathCoversHandler (fixed here: HubMCPPath, HubMCPAll and
  {agent} added to its consts; passes) and internal/gui's AppKit tests.
  Of those, TestMainWindowCorners fails the same on origin/main ddf31ca30
  on mote's macOS 27 (#3949); the other six (dock, panel, plugin page,
  right-to-left) passed rerun alone at load ~95 (#2645).
- win-run of every library-*, gui-*, i18n*, click-scroll and menu-scroll
  GUI file: 49 files, 839 tests, 839 pass.
- Real use in WSL (magpie-desktop), sandbox HOME, real echo MCP server:
  hub on, Cursor given servers → ~/.cursor/mcp.json holds only magpie at
  /mcp/magpie/hub/cursor; initialize, tools/list (echo__echo) and two
  calls ran on one server pid; a foreign Origin got 403; hub off → the
  echo process ended, tools [].

Broken by hand: Connect button removed → 6 GUI cases red; the old row
wrap rule → 6 red (icon on its own line at 420px); EveryServerAgents
call removed from TestHubConnectAnAgent → red (hub "").

Not run: the whole GUI suite (~960 files); Windows agents (VS Code, Cursor
on Windows) against a real hub; an "Add to Cursor" click in the real app
(the link is built and tested, the app's own confirm wasn't driven).
2026-10-29 03:17:58 +08:00
yetone 2ff85f8a2b gui: a page's bar room comes out of its right padding, so both sides match
v0.1.1904 had every page keep its scrollbar's room, so nothing moves
when a page grows past the window. The owner asked whether the clear
bar now makes the sides uneven: it did, by the bar's width (8px on the
Mac, 10px on Windows and Linux), and the centred pages sat 4px to the
left.

layout.js measures the bar of a .view into --bar (again on resize, so
a text-size zoom is followed), and app.css takes it from each page's
right padding: the panel's 12px, the window's 16px, the centred pages'
max(16px, 50% - 600px) and the phone web's safe-area right. The heads
and strips that reach over the padding (Library's and Settings' sticky
heads, Providers' after-list fade, the masking record's bar) reach that
much less on the right, or they would run the page sideways. A plugin's
page, whose frame scrolls itself, shows a bar only when it needs one.

layout.js's measuring adds 254 bytes to the core's scripts; the budget is
raised by exactly that, with no room added.

page-width-steady.test.cjs now checks every page's left gap against its
right gap with the bar (chromium and webkit, the Mac's 8px bar and the
10px one, 1100 and 1600 wide) and that no page scrolls sideways; that
check found Providers' after-list fade running 4px past the page. With
v0.1.1904's CSS it is red ("agents: 16px on the left, 24px on the
right (bar 8px)", 26px with the 10px bar, 94/102 centred). page-width's
"centred" check compared paddings only, and now counts the bar too.

Run on mote at this head (f70cb6825's tree, on origin/main 174250b27):
page-width-steady, page-width, inner-scroll-contain, settings-tabs-stick,
library-all, agent-layout, i18n-keys, text-size, view-scrollbar: 168 of
168 pass; go test ./internal/gui -run Budget ok. Before the last rebase,
209 GUI files that reach pages, heads, panels, providers, masking,
library, settings and the gateway (3087 tests) had 29 reds; the same
files on origin/main d4f1d6480 had the same ones, apart from flakes:
gateway-key-limit and gateway-key-cycle (#4072, from f835bd713),
gateway-older (waits for #gateway .dot, which f835bd713 replaced; filed
with #4072's fix next), menu-input-scroll (#3402), header-centre webkit
(a ResizeObserver loop message, red on main too), account-mask chromium
zh, and gateway-caller-keys / gateway-key-models reading the page right
after a resize to 560 (#3523, #3797).
Not tried: the real Windows and Linux apps.
2026-10-28 22:44:22 +08:00
yetone a8c71f1987 library: an opaque logo has no white corners
The user's MCP servers page drew Linear's, Context7's and GitHub's
logos (GitHub avatars, opaque) with a white fringe at each of the four
corners. The tile (.mk-icon) had a white background under the picture,
and its rounded clip's soft edge let that white through. The white now
sits on a plate 1px inside the tile (::before, border-radius inherit),
which the clip never reaches, so an opaque logo meets the row's own
background at its corners. A logo with see-through parts (an .svg) still
sits on white, an initial keeps its grey (no plate), and the skeleton
looks as before. The same tile is the library rows' 26px/24px logo, the
market cards' 36px and the market sheet's 44px.

Tried first in a page of the three real avatars at 2x in WebKit and
Chromium: background:none removed the fringe, clip-path inset(round)
beside or instead of overflow:hidden did not.

New: internal/gui/tests/market-icon-corners.test.cjs, dark theme, 2x,
every language, both engines. It reads the tile's own pixels: no corner
of an opaque black logo is brighter than the card plus 30, an svg tile
is white along its edges, and an initial's tile is not white.

Run (mote, at this commit's tree on origin/main ca499953e):
- market-icon-corners: 8/8 ok.
- Broken by hand: the old library.css with the new test, 8/8 red
  ("corner at 0,0: 76 against the card's 35" in Chromium, 75 in WebKit).
- Every GUI file that loads the library page, its market or MCP views,
  plus i18n and the font files: 60 files, 1018 tests, 1017 ok. The one
  red, i18n-keys "a plugin's words are its own", is red the same at a
  fresh origin/main 6104e88aa (#4053, a masking.go comment).
- go test ./internal/gui: TestMainWindowCorners/macOS_26_SDK red, the
  same at origin/main 6104e88aa (#3949, macOS 27); everything else ok.

Rebased after the run onto 6104e88aa, which changes internal/usage only.

Not run: the whole GUI suite (the change is one plugin's stylesheet;
the files above are every one that loads it or reads .mk-icon); the
real app on Linux WebKitGTK.
2026-10-28 22:00:25 +08:00
yetone 769355ab93 library: an MCP server's startup timeout reaches Codex as startup_timeout_sec, a hand-written one stays (#3168, miaomiaozi)
The Library's MCP server editor has a "Startup timeout" field (seconds),
shown when an agent that reads one is installed (AgentView.Startup; Codex
only). It is written to Codex's [mcp_servers.<name>] startup_timeout_sec,
user-wide and in a project's .codex/config.toml. Empty writes nothing, so
Codex keeps its own 30s, as before. The key and its unit are from Codex's
own source: RawMcpServerConfig in codex-rs/config/src/mcp_types.rs
(cb2581dae8de) has startup_timeout_sec: Option<f64> in seconds, and the
older startup_timeout_ms, which is read only when _sec is absent.

A value the user wrote in config.toml is never written over. magpie
records the value it last wrote (Applied.Startup per agent,
Project.Startup per project file). A value in the entry that differs from
that record, one there before magpie wrote any, or any
startup_timeout_ms, is the user's (startupTheirs), and magpie leaves the
key alone. Once the user takes theirs out, magpie's goes in. The TUI's
server editor keeps the GUI-set value, as it does for OAuth.

Other agents with a startup timeout (Grok Build, Hermes, OpenCode) and a
`magpie mcp add` flag are #3536.

Run, in a sandbox HOME with pinned GOMODCACHE/GOCACHE:
- go test -tags nogui ./internal/library ./internal/tui: ok (162s, 16s).
- New tests: TestCodexStartupTimeout, TestCodexStartupTimeoutKeepsUsers,
  TestCodexProjectStartupTimeout. Broken by hand, each red:
  every existing value counted as the user's -> "startup_timeout_sec =
  120, want 45"; magpie always winning -> "= 20, want 90"; no encode (the
  old code) -> "= <nil>, want 120".
- GUI: new mcp-startup-timeout.test.cjs, Chromium and WebKit, en zh zh-TW
  ja de, 1100 and 390px: 22/22; red on the old client.js (no field).
  The 59 GUI files the change reaches (mcp-*, library-*, i18n-keys,
  gui-de/ja/zh-tw, every editServer/lib-editor file): 935 of 937 pass.
  The red, library-row-remove's hook-row trash in Chromium, fails the
  same way on origin/main 208bd5c48 run alone (2 of 2); it is #3099.
- gofmt -l clean; go vet ./...; GOOS=linux go vet -tags nogui ./...;
  GOOS=windows go vet ./...; linux nogui, windows and darwin builds ok.
- Real Codex: config.toml written by magpie under a scratch CODEX_HOME,
  read by codex-cli 0.162.1 `codex mcp list --json`:
  "startup_timeout_sec": 2.0.

After rebasing on origin/main 208bd5c48: go vet library+tui, linux nogui
and windows builds ok; go test -tags nogui internal/library (130s), tui
ok; internal/gui red once on TestRestartHandsTheGatewayOver (#3451, a
handover EOF, untouched here), then -count=3 alone and the package again
ok; GUI mcp-startup-timeout + i18n-keys 26/26.

Not tried: a real Codex start that actually times out (codex exec needs
a signed-in account in the scratch home); the full ./... suite.
2026-10-25 09:41:32 +08:00
yetone c417b1f4e3 library: a skill removed from its source is said so, and every such skill goes in one click, asked first
スライム on Discord (#help, 10-22): taste-skills took some of its skills
out, Update all reported each of them as a failure, and the only way
out was to delete them one by one.

An update or a check that reads the source whole and finds the skill's
folder (or its SKILL.md) gone now calls it removed upstream, not a
failure. GitHub tarballs and other git repositories both work this way.
- UpdateSkill returns *GoneError.
- UpdateSkills and UpdateSomeSkills list it in Result.Gone, not
  Unupdated.
- A check gives status "gone".
- Each marks Skill.Gone. The mark is cleared when a check or an update
  finds the skill there again.
- A fetch that failed, a skill left out of a fetch as too big, and a
  folder that can't be read stay unknown, never gone (goneFrom).

Nothing is deleted by itself. RemoveGoneSkills takes the named skills
out, or every marked one when none are named, through RemoveSkills, so
the folders go to the backups. A skill found in its source again is
kept and said so.
- GUI: a "Removed upstream" tag replaces Update available and the
  update icon. Update all says gone skills apart from failures. "Clean
  up N" sits in the group heading, or in the bar when there is one
  group, and opens a sheet naming each skill. One changed here carries
  "Changed here". Strings are in en, zh, zh-TW, ja and de.
- CLI: `magpie library skill rm --gone [--yes]` asks at a terminal and
  refuses without --yes otherwise. It names the ones changed here.
  update and status print the hint.
- TUI: the row says "removed from <repo> · d takes it out".
- API: POST /api/library/skills/remove-gone {names}.
- Docs: the Skill updates row and Verification in
  docs/subsystems/library.md.

Record for this push: 13 commits on origin/main ca4a1cde0, head tree
539c84e92. Go 1.26.8, sandbox HOME, GOMODCACHE/GOCACHE pinned. The full Go
run and vet were at tree d6393dfc8, the same Go code as this head: only
app.js comments (cut under the core script budget) and one ja string
changed after it.
- gofmt -l: nothing. go build ./...; go vet ./... (darwin), GOOS=linux
  go vet -tags nogui ./..., GOOS=windows go vet ./...: clean.
- go test -timeout 45m ./..., through tee, one suite on the machine:
  68 packages ok. The one red was internal/gui's
  TestCoreScriptBudget: app.js 1,335,314 > 1,335,000, since main grew
  app.js under the stack. The autoscroll commit's own comments were cut
  (to 1,334,629) rather than the budget raised, and go test -count=1
  ./internal/gui is ok at this head (113s). Packages the run took from
  Go's test cache had the same inputs.
- GUI: the 18 files this stack touches or names, both engines,
  202 of 204 pass (tree 068acf128, this push less the last commit). The
  two reds: gui-ja, red on main since c2636b7b5 and fixed by this push's
  last commit (gui-ja and i18n-keys 6 of 6 there), and usage-fold's
  chromium "several accounts" (#2163, red on main the same way).
- skill-gone passes, chromium and webkit, en and zh, 860 and 400px.
- internal/library, internal/cli and internal/tui ok, the Gone tests and
  TestLibrarySkillRm among them.
- The rebase onto main met c2636b7b5's Verification line in library.md;
  both sides' tests are kept in it.
  The whole GUI suite ran at 1c1fc7183 (this stack's first 12 commits on
  0ddcf28a1): 11713 of 11769 pass. Each of the 21 red files was then run
  alone at the stack and at origin/main 8278fd9b0. Eight are red the same
  way on main: plugin-card-update (#3079), quota-count-wrap and
  quota-name-translated (#2228), s3-sync (#2448), usage-agents-hide
  (#2276), usage-checkin (#3091), usage-fold's chromium "several
  accounts" (#2163), usage-ledger (#3104). The other 13 pass alone on both
  and were red only under that run's load (50 to 335): currency #3101,
  plugin-github #3218, provider-fetch-again #3292, rest-try-now #2564,
  routing-auto-reset #3293, routing-keys-fold #1612, routing-steady #1804,
  routing-wb-restricted #1905, sessions-folder-delete #2218,
  sessions-manage #3294, switch-only #3295, text-size #1866, usage-pack
  #3296.

Broken by hand, each red, then restored:
- prepare not returning GoneError
- apply not clearing Gone
- leftOutAt ignored
- every Stat error read as absent
- the git check not saying gone
- RemoveGoneSkills taking a skill that isn't marked

Not tried:
- the real taste-skills repo over the network
- the Windows box
- a skill CC Switch installed (Origin, adopt path), which still reports
  as a failure
- a GitHub check with a known commit, which keeps an existing gone
  mark but only marks gone after an update
2026-10-23 01:58:00 +08:00
yetone 0dbb1a8490 library: subagents are written once and given to every agent in its own format, with what each agent can't bind shown (#2283, chuanchinatest)
The Library has a Subagents tab beside Hooks. A subagent is a name, a
description, a prompt, and the library's skills and MCP servers it uses.
magpie writes it to each ticked agent's user-level folder in that agent's
format, rewrites it on every change, and takes back only files it wrote.

Where each one goes (syncSubagents, subagentSpecOf):
- Claude Code: ~/.claude/agents/<n>.md, with skills and mcpServers
- Codex: $CODEX_HOME/agents/<n>.toml (name, description, developer_instructions)
- OpenCode: ~/.config/opencode/agents/<n>.md (mode: subagent)
- Gemini CLI ~/.gemini/agents, Qwen Code ~/.qwen/agents, Grok ~/.grok/agents,
  Cursor ~/.cursor/agents, Copilot CLI ~/.copilot/agents/<n>.agent.md
- Factory Droid: ~/.factory/droids/<n>.md, with mcpServers
Skills and servers are named only where the agent's file can name them.
The page says, per agent, which of the two it won't bind, and that only
the Cursor app reads ~/.cursor/agents (cursor-agent reads a project's only).
Agents in WSL and agents with no user-level folder are greyed out.

The user's own files: every file is recorded by the hash of what magpie
wrote (Applied.Subagents). A same-name file of the user's is never written
over (the agent gets a problem). A file the user edited is theirs from then
on: it is neither rewritten nor removed. A carried library doesn't carry
subagents yet (as with hooks).

The Library's tabs now wrap onto a second line rather than scroll a narrow
window sideways (eight tabs in German at 560px). library-servers-bulk's
window goes from 1000 to 1100px tall to keep its stated premise that the
whole list fits.

Run:
- gofmt -l, and go vet -tags nogui for darwin, windows and linux: clean.
- go test of internal/library, internal/gui and the packages that import
  internal/library, at this head: green.
Full suite: SUITE_LINE
- New tests: TestSubagentsEachAgentsFile, TestSubagentsLeaveTheUsersFiles
  (covers the user editing magpie's file and then a sync), TestSubagentCheck.
- GUI: library-subagents (new) passes in Chromium and WebKit, at 1100 and
  420, in en, zh, zh-TW, ja and de. Also all library-*, gui-ja, gui-de,
  gui-zh-tw, i18n-keys, images-library-way, skill-* and mcp-* tests pass.
  Greying out the WSL agent was broken by hand, and library-subagents
  went red.
- Real binaries in a sandbox HOME against a fake upstream: each one sees
  the subagent magpie wrote.
  - Claude Code 2.1.300: it is listed in the system prompt.
  - OpenCode 2.0.25: debug agents.
  - Grok 1.0.50: grok inspect.
  - Codex 0.162.1: spawn_agent's roles, with --enable multi_agent_v2. v1
    showed no spawn_agent with a custom provider.
  - Gemini CLI 0.63.0: <subagent> in the request.
  - Qwen Code 0.21.9: its agent types.

Not tried: Factory Droid and Copilot CLI (both need a sign-in; Copilot
stops on auth before it reads agents), and the Cursor app.
2026-10-15 23:08:03 +08:00
yetone 24a1f92446 gui: Library's intro text is as wide as the cards under it, not broken off at 640px (#2319, emo172)
.lib-intro had max-width: 640px, the only cap on a paragraph in the
Library plugin's CSS. On a wide window RTK's intro broke mid-sentence
("…只输出模型需要的部分," / "节省 token。") while the RTK card under it
ran across the whole column, which read as text cut for no reason. Every
tab's intro shares the class (RTK, MCP servers, Instructions, Hooks,
Skills), so the cap goes for all of them; text-wrap: pretty keeps a last
word from standing alone on its line (ignored where unsupported). No other
change to the layout.

Test: library-intro-width.test.cjs, Chromium and WebKit, en/zh/zh-TW/ja/de,
at 1100px and 420px, on the RTK, MCP and Instructions tabs: the intro spans
its column less its 2px sides, ends where the RTK card ends, and the page
doesn't scroll sideways. With the old CSS it fails at 1100px ("intro 640px
in a 856px column"); with the fix 62/62 pass.

Run: node --test internal/gui/tests/library*.test.cjs
internal/gui/tests/view-no-sideways.test.cjs (both engines): 610 pass,
0 fail.

Full suite: SUITE_LINE
2026-10-15 23:08:01 +08:00
yetone b9e5c28997 gui: a Library MCP server magpie can't check for a variable only its agent sets shows not checked, not a red error (#2308, ASD-max)
Codex's host-only codex_app (codex-app-tools, imported into the Library)
names ${CODEX_APP_TOOLS_PIPE_PATH} and ${CODEX_MCP_NODE_PATH}, which only
the Codex app sets when it starts the server. magpie's check expands them
from its own environment, finds them unset and returns novar before
starting anything. The page painted that red, the same as a server that
exited or doesn't answer, so a working server read as broken. Its tooltip
already said magpie can't check it there.

A novar result is now painted as not checked: a grey ring and muted
words ("CODEX_APP_TOOLS_PIPE_PATH, ... not set"), the same tooltip. Other
errors stay red. The check itself is unchanged: magpie doesn't start
codex_app with Codex's pipe, as the reporter's own probe shows Codex
turns away a peer that isn't its signed binary
(untrusted-code-signing-identity), and it doesn't learn the pipe's path.

Run: library-env-refs.test.cjs (Chromium and WebKit, en/zh/ja/de at
440px) now also checks the novar status isn't "err" and isn't the red
colour; with client.js put back to HEAD it fails. library-env-refs and
library-mcp-health pass (16). Go tests not run (no Go file changed; disk
under 6G free).

Full suite: SUITE_LINE
2026-10-15 23:08:01 +08:00
yetone 9829d2f553 gui: a hook's description is shown whole, wrapped, and written in a box that wraps (#2085, emo172)
Library › Hooks cut a hook's description to one line with an ellipsis and
no tooltip, and the editor's Description was a one-line input, so an
80–150 character Chinese description could neither be read nor seen while
written.

- The list wraps the description (at most 200 characters, the user's own
  words). The row's text block takes a 240px basis, so the long text no
  longer pushes the name under the glyph at narrow widths.
- The editor's Description is a textarea that wraps and grows to fit. It
  stays one paragraph (library.SaveHook joins its lines), so Enter still
  saves, an IME's Enter still doesn't, as in every other field there.
- Siblings left as they are on purpose: skills, subagents and market rows
  hold one line with the whole text in a tooltip, because their lists are
  windowed to a fixed row height and their descriptions are authors'
  paragraphs, not the user's 200 characters.

Verified:
- library-hooks.test.cjs now gives a hook a 90-character Chinese
  description and checks it is not clipped and wraps at 440 and 1100 (1100
  in a window of its own: resizing one window across the page's breakpoint
  raises a WebKit ResizeObserver-loop error under load), that the name
  stays beside its glyph, and that the editor's box is a textarea showing
  all of it. On the old code it fails 12/12 ("the description is cut off
  at 440"); without the 240px basis, "the name is 38px off its glyph at
  440".
- All 484 library*.test.cjs pass in Chromium and WebKit, en/zh/zh-TW/ja/de;
  the hooks test 4x concurrently in both engines, 48/48.
- Screenshots at 440 and 1100, both engines, looked at.
Not run: Go checks (no Go changed); not tried in the built app.
2026-10-14 13:30:06 +08:00
yetone aa6a0d6b20 library: one skill over 200 MB is left out, not the whole repository (#2062)
mikubaka88/CCFA-Skills couldn't be installed at all: "the skills in ... are
too big to install (over 200 MB)". The repository is over the 200 MB
tarball cap, so fetchSkillFiles fetched it file by file, and that refused
the whole repository once the files summed past 200 MB. One skill,
ccf-paper-writer, is 297 MB on its own (exemplar paper PDFs, llava-4d.pdf
alone 46.8 MB); the other 16 are small.

The 200 MB limit per skill stays: a skill is copied into every agent that
gets one as a copy, and treeOf stops comparing at 256 MB, so a 297 MB skill
can't be told current or edited. What changes is that one such skill no
longer blocks the rest:
- fetchSkillFiles sums each skill's files (the deepest skill folder a file
  is under) and leaves out a skill over maxFetch; its files are never
  asked for. Only when every skill is over it does it fail as before.
- The left-out skills reach ProbeSkills as Probe.Left (path, size), kept
  per temp folder and taken once (tookLeftOut).
- The GUI's probe names each under the list ("{name} is too big to
  install: 283 MB, over the 200 MB a skill may be"), or in place of "No
  skills there" when nothing else is left; zh, zh-TW, ja, de. The TUI says
  it in its flash.
- docs/subsystems/library.md says how a big repository is fetched.

Run:
- Real: probe of mikubaka88/CCFA-Skills under a sandbox HOME lists 16
  skills and leaves out ccf-paper-writer (296736735 bytes). Not installed
  into a real agent.
- gofmt -l internal/: clean. go vet ./internal/gateway ./internal/library
  ./internal/tui on darwin, GOOS=linux -tags nogui, GOOS=windows (set -o
  pipefail): clean.
- go test -count=1 ./internal/library ./internal/tui: ok.
- TestOneSkillTooBigLeavesTheOthers (new): fails with the per-skill
  leave-out turned off by hand, passes with it.
  TestTooBigRepositoryChecksWhatArrives now makes every skill too big.
- skill-too-big.test.cjs (new), chromium and webkit, en 980 and zh,
  zh-TW, ja 440, de 420, plus every-skill-too-big: 14/14; red (0/7 in
  chromium) with client.js at origin/main. skill-*.test.cjs 190/190 and
  library-*.test.cjs 484/484 in both engines.
2026-10-14 09:32:21 +08:00
yetone b319657301 gui: a sign-in whose browser didn't open says why and shows its link, and Windows names rundll32 by its path (#2043)
xiaobaifly7: on Windows, signing in to Cloudflare's MCP server (and any
sign-in) opened no browser, and the window said to finish in the
browser until the sign-in timed out. Wails' Browser.OpenURL starts
rundll32 by its bare name, which Go looks up with PATHEXT's extensions;
a PATHEXT without .EXE (WSL passes one on as ".CPL") finds nothing, and
host.OpenURL dropped the error.

- proc.OpenBrowser starts %SystemRoot%\System32\rundll32.exe by its
  path (open / xdg-open / termux-open-url elsewhere) and returns the
  launcher's error. host.OpenURL falls back to it when Wails' fails, and
  the CLI's account sign-in uses it.
- Windows.OpenURL returns the error. /api/signin, the plugin sign-in and
  /api/library/mcp-signin answer it as openError; /api/open fails with
  it, so Open again says why.
- The sign-in card shows "magpie couldn't open your browser: {error}.
  Open the sign-in link below in a browser yourself." where it said
  magpie opened the page, with the link already shown below; the MCP
  editor shows the error with the link and a copy button. Translated
  (zh, zh-TW, ja, de).
- Open again matched its sign-in by identity, so a poll that put a fresh
  copy of the same sign-in in place kept the old error after a
  successful retry; it now matches by id.

Run:
- TestBrowserNamesRundll32ByItsPath, TestMCPSignInSaysTheBrowserDidntOpen
  and the /api/open and /api/signin tests in signin_open_2043_test.go.
  Broken by hand: the bare name back in browserCommand fails the first;
  openError returning "" fails the gui tests.
- On the Windows box (amd64, cmd with PATHEXT=.CPL): exec.Command
  ("rundll32", ...).Start() gave `exec: "rundll32": executable file not
  found in %PATH%`; proc.OpenBrowser started it (nil). The proc test
  binary's TestBrowserNamesRundll32ByItsPath passed there.
- signin-browser-down.test.cjs (new): the card's text, the link, no
  sideways overflow, Open again failing then succeeding, and the MCP
  editor's error and link, in Chromium and WebKit at 1100 and 420 in
  every language: 20/20. The related sign-in GUI tests: 451/452, the
  one a signin-proxy flake also on main (fixed in its own commit).
- gofmt -l clean; go vet darwin, linux -tags nogui, windows; GOOS=linux
  and windows builds; go test -tags nogui ./internal/gui/
  ./internal/proc/ ./internal/cli/.

Not tried: the real Wails app on Windows under PATHEXT=.CPL (the
fallback path is exercised only through proc.OpenBrowser), WSL itself,
the reporter's machine. Not covered: internal/tui/sessions.go and
internal/provider/install.go start `powershell` by its bare name, which
would miss the same way under such a PATHEXT.
2026-10-14 08:36:07 +08:00
yetone 8da304767a gui: Library is a plugin's page, its script, style and words in plugins/library
P2 of docs/subsystems/plugin-runtime.md, the second page after Sessions.

- library.js and library.css move to assets/plugins/library/ (client.js,
  library.css). The script registers with the kernel
  (magpie.plugin("library")) and adds its page to the "page" slot. Its
  hooks: open and relang load, redraw, close (its modal), dirty, discard.
  What it set up at load (list scroll and resize, the modal's backdrop
  and Escape, beforeunload, the stuck header, a quiet reload on focus)
  runs in mount.
- app.js calls those through magpie.call instead of window.loadLibrary,
  redrawLibrary, closeLibraryModal, libraryDirty and discardLibrary. It
  no longer lists library in its title map, hide loop or OPEN_VIEWS; the
  kernel's pages are in them.
- index.html: <main id="view-library"> goes, the kernel makes it.
  library.css keeps its place in the cascade.
- The 560 strings only Library says move from i18n.js to
  plugins/library/i18n.js (4 languages). i18n.js: 18826 → 16584 lines.
- plugins/library/library.go lists the client files.
- Tests that read i18n.js for a Library string read strings.cjs (i18n.js
  and the plugins'): 8 library tests and mcp-editor-cancel,
  mcp-oauth-app, mcp-signin-health. font-cascade, win-fonts and
  assets_revalidate_test.go name the new paths.
- "Check again" stays in i18n.js: Library said it alone when the words
  were split, and a5d72a095 (Settings' search keys) says it too since.
  i18n-keys has a new test, "a plugin's words are its own": a key in a
  plugin's i18n.js that any file outside the plugin's folder says fails
  it, naming the file. It was red on this key, and search-keys.test.cjs
  said "Check again" had no zh translation.
- docs: library.md, gui-shell.md, plugin-runtime.md.

Run, at this tree:
- 101 GUI test files touching Library, skills, MCP, the plugins, the
  shell and every language (gui-de/ja/zh-tw, i18n-keys, page-width,
  view-no-sideways, mobile-web, text-size, …): Chromium and WebKit, 4 at
  a time, all green but one. text-size's "zh: 100% picked at the foot"
  failed once in Chromium under load ("scrolled from 160 to 109 (max
  115)"); it passed alone, 6 at once here and on origin/main 8f34bbcd1,
  and at 6× and 12× CPU throttling. It's the Settings page, already
  "fixed" by 50dd39104, so I filed it as #2058.
- After rebasing onto origin/main 75cbc7e1e: i18n-keys, search-keys,
  library-mcp-tools, library-all, gui-de, mono-icon-redraw,
  group-first-token, Chromium and WebKit, green.
- go test ./internal/gui/ ./internal/pluginrt/ ./plugins/...; gofmt;
  go vet on darwin, GOOS=linux -tags nogui, GOOS=windows: clean.
2026-10-14 08:33:25 +08:00