Commit Graph
345 Commits
Author SHA1 Message Date
yetone e1a2226405 library: EverMe Memory and Nowledge Mem are offered in the market as memory sources, added in one step (OipsAnthony on X)
Both publish an MCP server: EverMe's @everme/memory-mcp (stdio, agent id and evt_ token, managed backend preset) and Nowledge Mem's Streamable HTTP endpoint at 127.0.0.1:14242/mcp (optional Bearer key for a Mem reached over Access Anywhere). Added beside Magpie Memory; their memories stay in their service, and magpie's digest and Memory tab don't read them (docs/subsystems/memory.md).

Run (wsl-run, magpie-wt/memprov at origin/main 032340056): go test -count=1 ./internal/library ok, GOOS=windows go vet ./internal/library, go vet -tags nogui ./internal/library, gofmt -l clean. TestThirdPartyMemoryServers is red without the two entries (the market has no such server). Not tried: a real EverMe token or a running Nowledge Mem; GUI market tests (the page lists servers from the API, no GUI file changed); mote was out of disk, so nothing ran there; full suite not run.
2026-11-11 14:34:30 +08:00
yetone 0052c860e0 library: billion-context installed with bun is found on Windows (Zerenjie on X)
biliPath looked for bili.cmd on PATH and in %APPDATA%\npm only. bun add -g
puts bili.exe (with a bili.bunx) in the bin of BUN_INSTALL or ~\.bun\bin,
so a bun install was never found. It now asks proc.FindTool, which tries
.exe and .cmd in every folder a user's tools are installed in. proc's
UserBinDirs also takes BUN_INSTALL's bin (Windows and elsewhere), and
Kiro Crew's adapter search gets ~/.bun/bin, BUN_INSTALL's bin and, on
Windows, %APPDATA%\npm, its siblings that had the same hole.

Run: on xiaomi-gpu (Windows 11) really `bun add -g billion-context` into a
sandbox BUN_INSTALL with PATH holding no bun bin. Before the fix biliPath
was "" ; after, it was bili.exe and `bili --version` answered 0.1.213. go
vet and go test -run Bili|KiroCrew|ToolIn|UserPath for library, agent and
proc passed on Windows and in WSL (magpie-desktop). The three new tests
fail on the old code in WSL (broken by hand with the sources stashed).
Not run: the full suite, a darwin vet and a mote run (mote's disk was
full, 226Mi free), the GUI suites (no GUI file touched).
2026-11-11 14:04:37 +08:00
yetone cc659c7559 library: Instructions reach MiniMax Code and WorkBuddy (lysyscy8 on X)
MiniMax Code reads AGENTS.md in its data folder ($MINIMAX_DATA_DIR, else
~/.minimax) before every conversation (readGlobalInstructions in
@minimax-ai/code 0.7.6's chunks), so its target now names that file.

WorkBuddy and WorkBuddy AI keep their instructions as the string
personalization.customPrompt in app/app-config.json of their folder
(PersonalizationCollector and AppConfigService in 5.5.6's app.asar, both
builds). Target.Field says the instructions are a JSON string rather than a
file; instrRead/instrSave read and write it through edit.SetJSON/DelJSON, so
every other key, its order and indentation stay, the user's own prompt stays
in the field around magpie's marker part, and taking the part back leaves
the file byte for byte as it was (an empty personalization object magpie
made goes too). A file that is not JSON, or a field that is not text, is
unknown: reported, never written over. Import takes the user's prompt into
the library the same way.

Run: TestMiniMaxCodeInstructions, TestWorkBuddyInstructionsAreAJSONField,
TestWorkBuddyInstructionsFromNothing, TestWorkBuddyInstructionsUnreadFileIsLeftAlone,
TestWorkBuddyInstructionsImport and TestWorkBuddyAIInstructions, in a sandbox
HOME, on Linux (wsl-run) and Windows (win-run); all fail with the two target
assignments taken out (broken by hand), and pass with them. internal/library
whole on Linux (ok) and Windows: 3 reds, TestGoneAgentListedToTakeOut,
TestCheckMixedServerEachSide (both #4115) and TestPluginImportCarryOnOffRemove
(#6065), all three red the same on origin/main d1b4eff5a on Windows.
Not tried: a running WorkBuddy or mcode reading the written values (the apps'
sources were read; WorkBuddy loads its config as it starts, so a running one
may need a restart); WORKBUDDY_USER_DATA_DIR is not followed.
2026-11-11 11:54:21 +08:00
yetoneandvincent 855b97a407 library: an MCP call's stream is open before its request reaches the server (#5433)
ServeRun sent a call to the child server and only then opened the call's
SSE stream. A server that asks roots/list at once could have the ask
land before that stream existed: it went to an older session stream, or
nowhere, and the call's own reply came first. That is #5433's red,
TestRunServerAsks seeing "roots " with nothing after it, which came back
on ubuntu CI at 296a9292c. The stream is now opened before the send and
closed on every return, a failed send included.

This is skygunner's patch (5acae7bee on their fork, posted on #5433 on
11-08), applied to main unchanged.

Run on mote at origin/main 0cc91af3d plus this change: TestRun* -race
-count=10 ok; ./internal/library ok (190s); go vet ok, and GOOS=windows
and GOOS=linux -tags nogui vet ok; gofmt clean.
Red on the old code: the new TestRunServerAsksOnCallStreamBeforeSendReturns,
with main's mcp_run.go, fails 3 of 3: "roots/list delivered to session
stream instead of call stream".
Not tried: Windows and Linux runs (the WSL box answered
Wsl/Service/E_UNEXPECTED), and the full suite.

Co-authored-by: vincent <vincent@users.noreply.github.com>
2026-11-11 10:49:46 +08:00
yetoneandyinwu01 a68f114d9e lazyre: the plugin name and export file name regexps compile on first use (#6020)
6af54dc9a (internal/library/plugin.go, pluginName) and b9f8548d2
(internal/provider/login_export.go, exportUnsafe) each added a
package-level regexp.MustCompile, so TestNoEagerPackageRegexps was red
on main on ubuntu and macOS CI (run 42893454569 at 51da6f1f5). Both go
through lazyre.New now, like the rest since e4197144a. The patterns and
callers are unchanged. yinwu01 found it and had the same patch on a
fork branch.

Run on mote at this tree (on origin/main d2a80b317):
- go vet -tags nogui of internal/library, internal/provider and the
  root package: ok; gofmt -l clean;
- TestNoEagerPackageRegexps: ok (red on main in CI's run above);
- internal/cli TestEveryRouteHasACommandOrIsNamed: ok at this head
  (red in the same CI run, already fixed by 91d4eaa70 and 966ddff20);
- go test -tags nogui ./internal/library ./internal/provider: ok.
Not run: the full suite, and Windows and Linux vet (a two-line change
of how a variable is declared, with no OS-specific files).

Co-authored-by: yinwu01 <yinwu01@users.noreply.github.com>
2026-11-11 05:30:02 +08:00
yetone faffb1e95b library: antigravity leaves noLibrary, it has a target now (xuanwo on X)
Run: go test ./internal/library full (only TestEveryAgentInLibrary red, fixed here), ./internal/agent ok, vet darwin/windows/linux nogui ok, via mote-run.
2026-11-11 03:50:21 +08:00
yetone 076ead5773 library: the Antigravity app is a Library target, MCP servers and skills reach it as they reach agy (xuanwo on X)
The Antigravity app (agent "antigravity", the one magpie takes over) had no
Library target: only agy did, so the app's row offered no MCP servers,
skills or rules. antigravity.google/docs/skills and /mcp put the App's and
the CLI's user-wide skills and mcp_config.json in the same ~/.gemini/config,
so the app uses agy's paths (also in a project's .agents/skills).

Run: TestAntigravityAppTarget red on the old code (target nil), green now;
go test ./internal/library ./internal/agent and darwin/windows/linux vet via
mote-run (see push). Not tried: the real app reading a magpie-written
mcp_config.json (no app on this machine; the docs say it does).
2026-11-11 03:50:20 +08:00
yetone 6af54dc9a9 library: Claude Code plugins kept as one item, with a Claude plugins tab (FakeshadowzZ on X)
A Claude Code plugin (.claude-plugin/plugin.json, skills/, agents/,
hooks/hooks.json, .mcp.json) can be installed into the Library from a
folder, a git address or a marketplace.json, and is one row: turned on, off
or removed as a whole, and given to the agents picked with the chips every
tab has. Its skills, MCP servers, hooks and subagents are ordinary library
items tagged Bundle: <plugin>, so each agent gets them through the code of
its kind and the Skills, MCP servers, Hooks and Subagents tabs go on
working. Off clears every part's agents and keeps them for on; Remove
removes the parts. A part whose name the library has gets the plugin's name
as a prefix, never over the user's own. Claude hook events and matchers map
to the portable ones; others become claude:<Event>, for Claude Code only.
Slash commands, LSP servers and non-command hooks are listed as not
carried, not dropped. internal/library/plugin.go, POST /api/library/plugins/*,
the Claude plugins tab in plugins/library/client.js (en, zh, zh-TW, ja, de),
docs/subsystems/library.md.

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

Not tried: a real Claude Code plugin from a marketplace, a git source
(tests use folders), WSL, Windows. Not carried yet: commands/*.md, LSP
servers, a plugin's folder across computers (a backup carries the parts, not
the plugin record).
2026-11-11 02:55:15 +08:00
yetone 025123431c library: add and remove a project's skills from the CLI (Sephiro_Lan on X, #5193)
magpie library project … does what the window's Library › Projects page
does, through the same library calls its page makes (AddProject,
RemoveProject, ProjectSkills, ProjectSkill, ProjectCopy):

  magpie library project [--json]                 the projects and their skills
  magpie library project add <dir>
  magpie library project rm <dir> [--keep-files]
  magpie library project skills <dir> [--json]
  magpie library project skill add <dir> <skill…> [agents=a,b…]
  magpie library project skill rm <dir> <skill…>
  magpie library project skill agents <dir> <skill> <a,b…|none>
  magpie library project copy <dir> on|off

<dir> may be relative or "." (library.ProjectPath / ProjectAt find the
listed project, through a link too). A skill added with no agents= goes
to the agents the page's Skills menu picks: those the project's skills
are for already, else every agent here with a project skills folder.
Each skill added says where it was placed; one that wasn't (a folder
there that isn't magpie's, left as it is) is named with why, and the
command exits 1, so a script tells "installed" from "left as it is" by
the status. --help prints the project usage; an unknown flag, command,
skill, agent or on/off value is refused, and so is rm of a skill the
project doesn't have.

Docs: the Projects row of docs/subsystems/library.md, and the site's
library page in en/zh/ja. site/public/llms-full.txt rebuilt with
`node llms-full.mjs`; it also picks up a line (Alma, Shelley) another
docs change left out of it.

Run (mote, at this tree):
- go test -count=1 -run TestLibraryProject ./internal/cli: ok; the same
  on Windows (win-run, xiaomi-gpu): ok.
- go vet ./internal/cli ./internal/library for darwin, linux (-tags nogui)
  and windows: ok. go test -count=1 ./internal/cli ./internal/library:
  ok (45s, 99s), at this head after the rebase. site: node --test worker.test.mjs: 38 pass. gofmt -l:
  clean.
- A sandbox HOME end to end with the built binary: claude and codex
  installed, three library skills, a git project. add ., skill add with
  no agents= (links in .claude/skills and .agents/skills, listed
  in .git/info/exclude, the .gitignore left as it is), a folder of the user's in .claude/skills/pdf (named,
  exit 1, untouched), agents=codex, skill agents, unknown
  skill/agent/flag/command refused, skills --json, skill rm, rm .: the
  links, magpie's folders and the exclude block gone, the user's
  folder kept.

Broken by hand: with the not-placed exit taken out, TestLibraryProjectCmd
goes red ("a folder of the user's in the way: <nil>").

Not tried: a project's MCP servers from the CLI (the issue asks for
skills; servers stay on the page), WSL agents, and a real Linux box.
2026-11-11 00:44:41 +08:00
yetone 3a3d161fa0 agent: Claude Desktop uninstalled on Windows is no longer listed (alien_jambob on X)
alien_jambob (Windows 11, 0.1.3603) uninstalled Claude Desktop and magpie
still listed it under 未设置. The uninstall leaves %APPDATA%\Claude behind
with its claude_desktop_config.json (their Everything search shows it),
and Desktop counted as here whenever any of its folders was.

- On Windows Desktop is listed only while its program is installed
  (desktopInstalled): Squirrel's %LOCALAPPDATA%\AnthropicClaude\claude.exe,
  the MSIX's package folder (desktopdir.Installed, as before), or its
  package in the AppX registry (Claude_… or the Store's
  AnthropicPBC.Claude_…, main package only). A Desktop still on magpie
  stays listed, so it can be turned off, as Alma's fix (1b2ad557f) keeps.
- The library's own Claude Desktop entry (apps(), the one that gets MCP
  servers and skills) had the same folder-only check: it is now
  agent.DesktopApp, with the same rule on Windows. Something magpie gave
  it is still listed by held() to be taken back.
- macOS and Linux keep folder detection (unchanged).

The path the row shows, ~\AppData\Local\Claude\claude_desktop_config.json,
is right: it is the file magpie writes deploymentMode into on Windows
(desktopdir's Mode, as CC Switch does) when Desktop is turned on, so it
doesn't exist on a Desktop never connected. Left as is.

Run: go test -run 'Desktop|MSIX' ./internal/agent ./internal/library on
Windows (win-run, xiaomi-gpu): library ok; agent's only reds are six
that fail the same on origin/main 065ca02c2 on that box, all filed
(#4115 CarriesTheLanguage/OpenLody/DesktopExec, #5068 and #5476 sealed
key, #5069 DesktopHandler). Whole internal/agent and internal/library on
mote (darwin): ok. go vet for windows, linux (nogui) and darwin; gofmt.
Whole internal/agent and internal/library on Linux (wsl-run): library
ok, agent red only on TestGrokInstalled (WSL binfmt interop, #3548).
After rebasing on 40cd70d54: vet for three OSes and -run Desktop|MSIX on
Linux, ok.
e2e on Windows: magpie ls in a sandbox USERPROFILE/APPDATA/LOCALAPPDATA
with only Roaming\Claude\claude_desktop_config.json: origin/main lists
Claude Desktop, this change doesn't; with AnthropicClaude\claude.exe
added both list it.

Broken by hand: with the Windows branch taken out (folders count again),
TestClaudeDesktopUninstalledLeftover goes red on "only the leftover",
"a resource package alone" and "another app's package".

Not tried: a real MSIX Desktop uninstalled (the box has the Squirrel
install, which is the user's own); macOS's leftover ~/Library/Application
Support/Claude after Claude.app is trashed is not changed here
(#5979).
2026-11-10 22:56:39 +08:00
yetone 87b3af7653 library: a project turns a global MCP server or skill off, out of git, and its worktrees follow (WhyULose0 on X)
WhyULose0 asked for MCP servers and skills per project: a global set every
project inherits, each project that set ± items (a global one turned off
for one project too), one place to tick for every agent, nothing written
into the project's git, the router running a shared server once, and a
new git worktree following its main project.

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

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

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

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

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

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

Not tried: a real Claude Code or Codex run in a project with an off (the
record and table shapes are read from Claude Code 2.1.316's and Codex's
config code, not watched working); darwin (mote down), Windows runs;
a real `git worktree add` (the test writes git's worktree files by hand).
2026-11-10 22:39:29 +08:00
yetone 0baa223ec9 agent: Kun, magpie as a provider connection through its runtime API (zhongxingyuyes on X)
Kun (KunAgent 0.4.5, Electron, com.xingyuzhong.deepseekgui) keeps its
model providers in ~/.kun/data/model-connections.v2.json (or
$KUN_DATA_DIR) and changes them only through its runtime's admin API,
whose address and token are in runtime.json. magpie wires Kun by
calling that API while Kun runs:

  POST   /v1/model-connections/connect    the magpie connection
  PATCH  /v1/model-connections/:id        models, gateway address
  POST   /v1/model-connections/select     the default model
  DELETE /v1/model-connections/:id        off
  POST   /v1/provider-config/transactions/preview, then commit
         off when magpie's connection is the default: Kun refuses a
         plain DELETE of the connection its default names, so the
         transaction clears the default and removes it in one step,
         and the default the user had before is put back.

When Kun isn't running, wiring says "open Kun, then try again"; the
file is never written behind Kun's back. Kun joins the agent list,
desktop-app detection, the env guard, the icon set (kun.png), the
READMEs and docs/reference.md and docs/subsystems/agent-wiring.md.

Run:
- WSL (Ubuntu 24.04), at the rebased head: go test -tags nogui
  -run 'Kun|ListsModels|Picker|Spelled|HandWired|Sync|Drift|ListOnly|
  Moved|LAN|Proxy' ./internal/agent ./internal/agentenv ok;
  ./internal/library ok; ./internal/gui -run 'Icon|Budget|CSS|I18n|
  Picker' ok (agentenv: no tests match the filter).
- Windows (win-run): go test -run 'Kun|ListsModels|Picker|Spelled|
  HandWired|Drift|ListOnly' ./internal/agent ok. CGO_ENABLED=0 go vet
  for windows (agent, gui, agentenv), darwin nogui (agent, agentenv)
  and linux nogui (agent, agentenv, gui): clean. gofmt -l clean.
- GUI (WSL, chromium + webkit): i18n-keys, i18n-en-no-cjk,
  icon-one-tone, routing-client-icons, icon-tile together 63/63 at
  this head. An earlier run at the pre-rebase head was 60/63, the 3
  reds icon-one-tone's "Open Design one-tone ... Plugins page"
  (chromium), which passed 48/48 alone there and at origin/main: a
  load red (#5425).
- Real Kun 0.4.5 (Linux build, sandbox HOME, `kun serve`): connect,
  a second model, Sync, restart, off. `kun run`
  finished a turn through the gateway (POST /v1/chat/completions,
  Bearer magpie-kun, reply "hello from magpie"). Off restored the
  previous default, and with no previous default Kun was left with
  none and no magpie connection.

Broken by hand: off through the plain DELETE again. The fake Kun now
refuses it as the real one does, and TestKunFromNothing and
TestKunFollowsTheGateway went red with "Deleted connection still has
references: default.providerId"; green with the transaction.

Not tried: Kun's desktop window itself (the runtime was driven
headless); macOS (mote refused SSH all session); `kun run --model`
(run uses its own default model, not the registry's default, so a
CLI run picks magpie's model only with --model).
2026-11-10 22:07:34 +08:00
yetone 6a450c4982 agent: Shelley, magpie's models as its custom models (on X, tweet 2120109384315658393)
"Can support Shelley?" Shelley is boldsoftware/shelley (Apache-2.0, Go,
`shelley serve`). It keeps models and profiles in its SQLite database,
not in a config file, so magpie talks to a running Shelley through the
same API its own Models and Profiles pages use, on the Unix socket it
opens for its CLI ($SHELLEY_SOCKET, else shelley.sock / shelley-N.sock in
$XDG_CONFIG_HOME/shelley or ~/.config/shelley; read from its source).

- Connect: each magpie model is a custom model (POST /api/custom-models,
  provider_type openai, endpoint = the gateway's /v1, Shelley's own
  gateway key, model_name = the catalog id, reasoning/images/max_tokens
  from the catalog). Picking one makes it the default profile's model
  (PUT /api/profiles/{name} with the whole profile, as the API requires)
  and clears a thinking level the model can't take.
- The user's own values: the profile's model and thinking level are
  stashed once and put back on Disconnect (to the server's default if
  that model is gone); only the custom models magpie made (ids stashed)
  are deleted, so a model the user pointed at the gateway by hand stays.
- Sync re-points magpie's models when the gateway port moves; Check names
  a model left on an old address. Shelley not running is an error on a
  pick and nothing on Sync/Check; turned off while Shelley is uninstalled,
  the takeout is stashed and done when Shelley answers again (Alma's way).
- A notice: new conversations start on the pick, an open one keeps its
  model. i18n for zh, zh-TW, ja, de.
- Icon: Shelley's own S mark from its assets, one tone. README (en, zh),
  site index, docs/reference.md, docs/integrating.md, site integrate
  pages (en, zh), docs/subsystems/agent-wiring.md.
- Library: listed as "not looked at (#5897)" like the other new agents.
- Shelley has no Windows build, so there is no Windows or WSL wiring.

Run (mote refused SSH for the whole session, kex reset, so runs went to
the Linux VM and the Windows box):
- Real binary: shelley v0.1718.926152762 linux_amd64 (sha256 66cb5acb…
  checked) in a sandbox HOME/XDG_CONFIG_HOME/-db on the Linux VM, with a
  throwaway test driving it against a fake OpenAI upstream at
  MAGPIE_ADDR: connect made custom model glm-4-6-… and the default
  profile's model; POST /api/conversations/new sent two
  /v1/chat/completions with model=relay/glm-4.6, auth magpie-shelley,
  UA Shelley/58d5f200; disconnect left the profile as before and no
  custom models. Check "" and Drift nil while connected.
- Linux (wsl-run, nogui): go vet ./internal/agent ./internal/agentenv
  ./internal/library; go test ./internal/agent ./internal/agentenv
  ./internal/library ./internal/profile ./internal/sessions: ok except
  TestGrokInstalled (#3548, red on base too) and, before its fix here,
  TestEveryAgentInLibrary. internal/cli times out there in
  TestEveryAgentFieldNameWritesNothing (43m, the #5234 class).
- Windows (win-run): go vet ./internal/agent ./internal/agentenv;
  GOOS=darwin and GOOS=linux -tags nogui vet; the Shelley, applied,
  rewire, disconnect, mark and kept tests: red only in
  TestAppliedOfParsesAnUnchangedFileOnce (#5950),
  TestAsideOfflineDisconnectRestoresWithoutDaemon (#5951) and the #4786
  allocation tests, all red on base d4b4a188e too. internal/cli
  TestHelpOnEveryCommandDoesNothing, TestEveryAgentFieldNameWritesNothing
  and internal/library TestEvery*: ok.
- GUI (node --test, chromium + webkit) i18n-keys, i18n-en-no-cjk,
  agent-notice-lang, gui-de, gui-ja, gui-zh-tw, icon-one-tone, icon-tile,
  routing-client-icons, usage-agent-filter-icons, agent-connect,
  agent-models, agent-layout, on the Windows box at the rebased head:
  110 tests, 107 pass. Red: gui-ja "ja has every zh string" ({model}
  twice, #5943) and icon-one-tone webkit voyage-color (#5962), both red
  at origin/main a1ba92ad8 too.
- At the rebased head 2a9c7b715 (on origin/main a1ba92ad8), Linux:
  vet of agent, agentenv, library ok; go test agent, agentenv, library,
  profile ok except TestGrokInstalled (#3548). Pushed on ca7a39291,
  which changes only internal/gateway (MiniMax drawing); not rerun.
- gofmt -l clean.

Broken by hand: not restoring the profile's model on Disconnect turns
TestShelley and TestShelleyThinkingLevel red; not deleting magpie's
custom models turns TestShelley and TestShelleyKeepsHandWired red.

Not tried: a real model upstream (the upstream was a fake), macOS (mote
unreachable; the darwin build was vetted only), the GUI against a real
Shelley, Shelley's web UI after the switch.
2026-11-10 21:52:19 +08:00
yetone a1ba92ad8c library: a market of Pi's packages, installed and removed by pi itself (nineruiing on X)
Library -> Pi now has a Discover list of Pi packages: npm packages with
the pi-package keyword (pi's own docs: the keyword makes a package
eligible for the pi.dev/packages gallery), sorted by monthly downloads,
with search. Like the other markets it ships a 500-entry snapshot
(market_pi.json), keeps a 6h memory and disk cache, and refreshes from
npm. Install and remove run that Pi's own `pi install npm:<name>` /
`pi remove npm:<name>` with PI_CODING_AGENT_DIR set to its folder, so
settings.json's packages list and <agentDir>/npm are written by pi, not
by magpie. Each card says which Pis have it; Install goes straight to
the only Pi without it or asks which one; the Pi's list gets a remove
button behind a confirm. New routes: GET /api/library/market/pi, POST
/api/library/pi/install and /api/library/pi/remove.

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

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

Not tried: a real magpie binary driving pi install end to end; pi on
native Windows; git: and local package sources (the market lists npm
only, and the Pi's list still shows and removes them as before).
2026-11-10 21:15:14 +08:00
yetone c2c2c82ca8 agent: Tuanjie Cowork, a magpie provider and model in its Custom Models (Charles24209792 on X)
Tuanjie Cowork (Unity China's coworker app, dev.codelycowork.desktop,
2.1.6-stable) keeps the user's own models in ~/.codely/settings.json:
customModelProviders {id, name, baseUrl, apiKey, authType} and
customModels {id, model, providerId, displayName, roles, wireApi,
supportsMultimodal}, read afresh on every lookup. Read from the app's own
core (tZ/oE for the file, Mwi for a session's OPENAI_BASE_URL/KEY, BOe
for the model list, rha/sha for its startup migrations).

magpie adds a provider and a model of its own, both id "magpie": the
gateway's /v1 with Cowork's own magpie key, the model picked, wireApi
chat. The user's providers and models and every other key stay as
written; a name or roles given magpie's entries in Cowork are kept when
the model changes. Off takes both out, and the file too when magpie made
it and nothing else is in it. A provider or model with id magpie that is
the user's own is left alone, with an error. Which model a chat is on is
Cowork's own per-workspace pick, which magpie doesn't write; a notice
says to pick "<model> (magpie)" in its model menu while it runs. Skills
go to the shared ~/.agents/skills, which its core scans. Icon from the
app's icon.icns. Lists, READMEs, reference, agent-wiring doc, i18n.

Run:
- go test ./internal/agent ./internal/library ./internal/gui on mote;
  TestTuanjieCowork* and TestHandWiredMagpieProviderSiblings on Windows
  (win-run).
- gofmt; go vet darwin, linux -tags nogui, windows.
- GUI, chromium and webkit: i18n-keys, i18n-en-no-cjk,
  agent-notice-lang, gui-de, gui-ja, gui-zh-tw, icon-one-tone,
  icon-tile, routing-client-icons, usage-agent-filter-icons,
  agent-connect, agent-models, agent-layout.
- Cowork's own code on magpie's output: its tZ, oE, rha, sha, cE, KGa,
  Mwi, kOe and BOe, extracted from the 2.1.6 core, run in node on the
  settings.json magpie wrote (with the user's own provider, and fresh).
  Its migrations leave magpie's entries; cE("magpie") finds the model,
  the picker label is "deepseek/pro (magpie)", a session gets
  OPENAI_BASE_URL http://127.0.0.1:3425/v1 and magpie's key, the list
  URL is /v1/models, and the user's glm-4.5 is still there.

Where: the packages, vets and GUI files above ran on mote at b834dc2a7
(this change on 4a9142ccd); at the pushed head (on 016763f23) internal/agent's
Cowork, HandWired, EveryAgent, Aliases and Icon tests, internal/library, and
the de, zh-TW and en-no-cjk i18n files ran on Windows. Reds not from this
change, both red on main already: gui-ja's {model} twice (#5943), and
TestEveryAgentInLibrary for obsidian and avibe (#5945).

Broken by hand, each red:
- rest() keeping magpie's entries: TestTuanjieCowork (two models) and
  TestTuanjieCoworkMadeFile (file left behind).
- no check for a provider id magpie of the user's own:
  TestTuanjieCoworkLeavesTheUsersMagpie/provider.
- unwire never removing a file magpie made: TestTuanjieCoworkMadeFile.

Not tried: the real app's GUI (picking magpie's model in its menu and a
chat through it), Windows detection (its NSIS per-user path isn't
known, so on Windows it shows once ~/.codely exists), Linux.
2026-11-10 20:50:10 +08:00
yetone 399010bef4 library: Avibe and Obsidian have no Library place yet (#5897)
9c39edb92 and 4a9142ccd added the two agents with no targetOf entry and
no noLibrary line, so TestEveryAgentInLibrary was red on main (run
42811517253, ubuntu and macOS).

Ran: go test -tags nogui ./internal/library on WSL magpie-desktop: red
on avibe, then on obsidian, before each line; ok after both.
2026-11-10 20:44:57 +08:00
yetone 5e3f14f21f agent: Paimon, magpie's models through its litellm provider (ditangongyuan on X)
Paimon (aisk/paimon, `uv tool install paimon`) is a terminal coding agent
on pydantic-ai. Read at 7f7fa51 (config.py, llm.py): its settings are one
JSON file, $PAIMON_CONFIG_HOME/config.json, else ~/.config/paimon/config.json
on every OS. "model" is provider:name, and "providers" keeps each
provider's api_base and api_key.

magpie connects it through pydantic-ai's litellm provider, an
OpenAI-compatible proxy that profiles a vendor/model name by its vendor,
as magpie's ids are spelled, and which Paimon's login never offers:
model = litellm:<catalog id>, providers.litellm = the gateway's /v1 and
magpie's key for Paimon (0600, as Paimon writes it), and
compaction.context_window = the model's window. Paimon compacts against
that only for names genai-prices doesn't know, which magpie's ids aren't;
for a model whose window magpie doesn't know it gets the user's own back,
never the last model's. What the user had in the three keys is stashed and
put back on Disconnect (or `magpie paimon default`); the rest of the file
is untouched, and a file magpie made goes again. A model picked in Paimon
itself while magpie's provider stays is the user's from then on. Requests
are told apart by Paimon's paimon/<version> User-Agent. WSL distros, the
PAIMON_CONFIG_HOME isolation, notices in every language, icon, READMEs,
docs/reference.md, agent-wiring.md and the site's list come with it.

Run:
mote refused SSH all session (kex reset), so the Linux runs went
through wsl-run (magpie-desktop) and Windows through win-run:
- go vet: linux -tags nogui, GOOS=windows, GOOS=darwin -tags nogui on
  internal/agent, agentenv, library: ok. gofmt -l: clean.
- go test -tags nogui ./internal/agent/... agentenv library gui cli (WSL,
  base f03ec97b8): all ok except TestGrokInstalled, the known WSL binfmt
  red #3548.
- Windows: TestPaimon, TestHandWired*, TestEveryNoticeIsTranslated,
  TestPortMovesEveryAgent ok (file-mode checks skipped there).
- GUI, chromium + webkit (WSL): i18n-keys, i18n-en-no-cjk,
  agent-notice-lang, gui-de, gui-ja, gui-zh-tw, icon-one-tone, icon-tile,
  mono-icon-redraw, routing-client-icons, usage-agent-filter-icons,
  agent-connect(-no-models), agent-models(-own, -picker), agent-layout:
  150/151; the red is gui-ja's usage price string, untouched here, filed
  as #5943.
- Real Paimon 0.2.8 (uv pip install paimon) in a sandbox HOME on WSL,
  against a sandbox magpie gateway over a fake OpenAI upstream:
  `magpie paimon magpie/fakeup/m1` wrote litellm:fakeup/m1 and
  providers.litellm at 0600; `paimon -p ping` answered "pong from fake
  upstream", the upstream saw POST /v1/chat/completions with
  "paimon/0.2.8 (Python 3.10.19; Linux x86_64)", and magpie usage counted
  the call under Paimon; `magpie paimon default` put the file back equal
  to the user's.
- After the rebase on origin/main 9c39edb92: the three vets, the targeted
  agent tests and internal/gui ok; internal/library's
  TestEveryAgentInLibrary red for avibe from 9c39edb92 (#5945, not this
  change); i18n-keys, i18n-en-no-cjk, agent-notice-lang, gui-de, gui-zh-tw
  ok; icon-one-tone's every-logo case ok in both engines, its webkit
  Plugins-page case timed out on page.goto's 5s at WSL load 92 (#5425).

Broken by hand, each red in TestPaimon:
- the user's window not put back for a model magpie doesn't know (switch
  window: <nil>);
- stashing again while providers.litellm is magpie's (switch window: 200000);
- a file magpie made not removed (made file left: {});
- a model picked in Paimon not kept as the user's (restore after a pick).

Not tried: macOS (mote unreachable) and the GUI's own Connect click with
the real binary; Paimon's auto-compaction at a window magpie wrote (the
fake model had none, so Paimon said compaction was off, as it does for any
name it doesn't know); a model picked in Paimon's own /model while
connected beyond the unit test.
2026-11-10 19:54:37 +08:00
yetone 8cc4bd7e3c agent: Craft Agents, through a keyless connection at the gateway (springg1998 on X)
Craft Agents (lukilabs/craft-agents-oss, thecraftagents.com) keeps its LLM
connections in config.json under $CRAFT_CONFIG_DIR or ~/.craft-agent
(paths.ts, storage.ts, llm-connections.ts, v0.15.8). magpie adds one
connection: slug magpie, providerType pi_compat, authType none, baseUrl at
the gateway's /agent/craft-agents/v1, customEndpoint.api
openai-completions. Its models are the ones picked for it, and defaultModel
is always one of them, because Craft resets a default that isn't in the list
to the first. magpie makes it defaultLlmConnection. The user's default is
stashed (as JSON, "" for none) and put back on off when that connection still
exists. A name the user gives magpie's entry stays, and a sync with nothing
to change writes nothing. A config.json with no workspaces list is one Craft
doesn't load, so magpie never creates one: open Craft once first. Picking one
of the user's own models removes magpie's entry and sets that model on their
default connection. Sessions keep the connection they started on, so the
notice says new sessions use it (zh, zh-TW, ja, de).

Detected by ~/.craft-agent, Craft Agents.app (com.lukilabs.craft-agent), or
%LOCALAPPDATA%\Programs\@craft-agentelectron\Craft Agents.exe (per-user
NSIS; the GUID is the UUID v5 of the appId, derived the same way as dsh's
known one). Skills go to ~/.agents/skills. CRAFT_CONFIG_DIR is in
agentenv.Vars. Icon from Craft's own icon.svg (#9570BE). README, reference,
agent-wiring and site list it.

Run on mote, first on origin/main 720200092:
- go test -tags nogui ./internal/agent ./internal/library ./internal/agentenv: ok.
- go test ./internal/gui: ok.
- go test ./internal/proc: ok (at the pre-rebase head).
- GUI tests in chromium and webkit, 69/69: i18n-keys, i18n-en-no-cjk,
  icon-one-tone, icon-tile, tray-logos and usage-agent-filter-icons.
- gofmt -l is clean. go vet passes for darwin, GOOS=linux -tags nogui, and
  GOOS=windows.
Then rebased on 6b92824ff and run again there: go test ./internal/gui,
the Craft, hand-wired, spelled, drift and every-agent tests in
./internal/agent and ./internal/library, and i18n-keys: all ok.
Pushed rebased on 2fbead798 (provider relay URL, Windows restart, gateway cap: no
files in common), not run again there; the full suite runs after the tag.
Broken by hand: with unwire's restore of the user's default taken out,
TestCraftAgents goes red at "restore". On the old code the tests don't
compile (no craftAgents). The first run also showed every-agent tests
(drift, LAN, proxy, port move) needing a Craft fixture, which is now added.
Not tried: a real Craft Agents app or its Pi server against the gateway, or
the Windows install path on a real install.
2026-11-10 18:09:54 +08:00
yetone 68cb92e8e6 library: name miniQ among the agents not looked at for the Library
d109ec8da added the miniq agent with no Library target and no line in
noLibrary, so TestEveryAgentInLibrary was red: "miniq (miniQ): no place
in the Library". It joins the agents #5897 has not looked at yet.

Run on magpie-desktop: go test -tags nogui ./internal/library red at
origin/main 987eac0aa with that line, ok with this.
2026-11-10 17:40:35 +08:00
yetone 7869a454cc library: the market's docker volume name is compiled on first use
d3f862340 put volumeName at package level with regexp.MustCompile, so
TestNoEagerPackageRegexps was red on main on ubuntu and macOS CI from
then on (run 42784088261 at 286e3b6d5). It is lazyre.New now, like
every other package-level regexp.

Run on magpie-desktop (mote's ssh was refusing): go test -tags nogui
-run TestNoEagerPackageRegexps . ok (red at origin/main on CI), and
./internal/library ok.
2026-11-10 17:40:35 +08:00
yetone 5a02bf8c14 agent: mu, Pi with a judgment kernel, wired in ~/.mu/agent (xteam3301 on X)
mu (github.com/qybaihe/mu, npm mu-agent, the mu command and the mu
desktop app) is Pi 1.4.0 with a judgment-kernel extension. Its
kyrn/bin/mu.mjs starts Pi on its own agent folder, so Pi's settings.json
and models.json live in ~/.mu/agent, and the desktop app runs the same
Pi on the same folder. magpie now wires it as it wires Pi.

- agent: mu (piLikeKeyed). Its folder is found as mu.mjs finds it:
  $MU_AGENT_DIR, $KYRN_AGENT_DIR, $MU_CODING_AGENT_DIR,
  $KYRN_CODING_AGENT_DIR ("~" expanded), else ~/.mu/agent, or
  ~/.kyrn/agent while ~/.kyrn is a folder and ~/.mu isn't. Its requests
  say pi/<version>, so the provider's key magpie-mu names it. The alias
  is mu-agent. Its judge (~/.mu/mu.json) is left alone.
- `mu` is also maildir-utils' command (brew, distros). A mu on PATH
  that neither is nor names mu.mjs / mu-agent is not taken for it
  (notMuAgent).
- Gemini models stay on Chat for mu, as for Pi and StepCode (piAsked).
- WSL kind at ~/.mu/agent (found by its folder, not the command); CLI
  update through npm mu-agent; the desktop app (io.github.qybaihe.mu,
  mu.app, %LOCALAPPDATA%\Programs\mu\mu.exe, /opt/mu).
- agentenv and appdir know the four variables.
- library: mu's AGENTS.md / AGENTS.override.md, its mcp.json (Pi's
  native format) and skills in its folder; it reads ~/.agents/skills.
- GUI: a one-tone icon. Default in its model picker says it clears the
  default and mu picks one itself (PICKS_ITSELF).
- docs: READMEs, reference.md, agent-wiring.md.

Run (mote, at this tree before the rebase):
- gofmt -l internal/ clean; go vet darwin, GOOS=linux -tags nogui and
  GOOS=windows of agent, library, appdir (and agentenv on darwin): clean.
- go test -count=1 ./internal/agent ./internal/library ./internal/appdir
  ./internal/agentenv ./internal/usage: ok (agent after its maildir
  fixture stopped using testenv.Program, which refuses a non-script).
  New: TestMu, TestMuDir, TestMuNotMaildirUtils, TestMuTarget; mu added
  to the handwired, spelled, Pi scope, scope-gone and Gemini-on-Chat
  lists.
- Windows (win-run on xiaomi-gpu): go test -run 'TestMu|TestPiScope|
  TestScopeGone|TestHandwired|TestSpelled|TestPiFolderKeepsGemini'
  ./internal/agent ./internal/library ./internal/appdir: ok.
- Real mu-agent 0.3.9 (Node 22.22.0) on mote in a sandbox HOME, a
  sandbox gateway on 47822 over a fake OpenAI upstream: `magpie agents`
  found mu with the user's deepseek model; `magpie mu magpie/fakeup/m1`
  wrote defaultProvider magpie and providers.magpie with key magpie-mu,
  keeping the user's deepseek provider; `mu -p ping` answered "pong from
  fake upstream" (upstream saw POST /v1/chat/completions, model m1,
  UA pi/0.3.9); `magpie usage today` counted the call under agent mu;
  `magpie mu default` put settings.json and models.json back byte for
  byte (cmp).
- GUI, chromium and webkit: pi-default-note (with mu added),
  icon-one-tone, icon-tile, mono-icon-redraw, routing-client-icons,
  usage-agent-filter-icons, i18n-keys, i18n-en-no-cjk, agent-connect,
  agent-models, agent-layout: 88 of 88.
- Rebased onto 1b2ad557f: gofmt clean; vet darwin (agent, library,
  gui), linux nogui and windows (agent, library) clean; go test
  ./internal/library ./internal/appdir ok; ./internal/agent -run
  'TestMu|TestPi|TestHandwired|TestSpelled|TestScopeGone|TestDesktop|
  TestCLIUpdate|TestWSL' ok; ./internal/gui ok but two reds that are red
  on an origin/main 1b2ad557f copy as well: TestCoreScriptBudget
  (1,534,470 > 1,533,802 on main, #5918; this change adds 6 bytes) and
  TestGatewayModeStatsNameTheGatewaySessions (run at 00:xx local, #5690).
  The rebase onto 4c5b89489 only adds LESSONS.md.

Broken by hand, each red:
- no binNot: TestMuNotMaildirUtils (maildir-utils' mu detected as mu).
- no ~/.kyrn fallback: TestMuDir.
- mu out of piAsked: TestPiFolderKeepsGeminiOnChatForRaft.
- mu out of PICKS_ITSELF: pi-default-note, 2 of 2 red (chromium).

Not tried: the mu desktop app (its install paths are read from its
electron-builder config, not an installed copy); a real vendor behind
the gateway (fake upstream only); a Gemini model through mu; WSL with a
real distro; mu's own session files are not read for usage outside
magpie.
2026-11-10 16:27:14 +08:00
yetone 00e8242e85 library: Hermes folds its context with billion-context through its /bili/ prefix (Duckb7si on X)
Library › billion-context said no agent could use it on a machine where
Hermes was connected to magpie. Hermes was left out of the lanes on
purpose: bili's native Hermes plugin (hermes-plugin/__init__.py,
apply_env, billion-context 0.1.213) only sets HTTPS_PROXY, HERMES_CA_BUNDLE
and SSL_CERT_FILE. magpie's Hermes provider is http://127.0.0.1:3425/v1,
plain http on loopback, so that proxy never sees it: the plugin would add
its tools and fold nothing.

Hermes now takes the route Zed takes, bili's documented /bili/ prefix.
Turned on, magpie runs `bili start --port 8787` and sets base_url of the
magpie and magpie-anthropic providers to http://127.0.0.1:8787/bili/<gw>,
in config.yaml and in every profile that has magpie's provider
(agent.HermesThrough). Each later Sync or pick keeps a loopback prefix
with a path (hermesPrefix), and drops anything else back to the gateway.
Turning it off puts the gateway back. The empty-list string, docs (en, zh,
ja), llms-full.txt and docs/subsystems/library.md name Hermes.

The other agents bili supports that magpie wires (dsh, Kimi, ZCode, Codex,
Gemini, Qwen, ...) are #5915.

Run (mote, at the rebased head unless said):
- go test -tags nogui ./internal/library: ok (252s) at the rebased head
- go test -run 'TestHermes|TestZed|TestProxy|TestBili|Kept'
  ./internal/agent ./internal/library: ok before the rebase (base
  2219fdd49); the whole internal/agent at the rebased head was still
  running at push (mote load ~60), result goes on #5915
- GUI library-bili, library-all, i18n-keys, i18n-en-no-cjk (chromium and
  webkit, every language): 84, 26, 4, 4 pass, 0 fail (before the rebase)
- site node --test: 107 pass (llms-full.txt regenerated with llms-full.mjs)
- go vet darwin, GOOS=linux -tags nogui, GOOS=windows on agent and
  library: clean; gofmt -l clean
Broken by hand:
- hermesEntries without the prefix: TestHermesThroughBili red (a pick
  drops the prefix)
- no "hermes" URL lane: TestBiliHermesThroughPrefix red (Hermes not
  offered)
Not tried:
- a real Hermes and a real `bili start`; tests fake bili and the probe
- a profile created after turning it on goes to the gateway until Hermes
  is turned on again
- bili's native Hermes plugin installed at the same time
- Windows run (vet only)
2026-11-10 16:16:11 +08:00
yetone d3f8623408 library: a market docker server's options stay inside the container
eff7f9f62 started taking an MCP registry entry's runtimeArguments for an
OCI package as docker run's own options, whole. Anyone can publish to the
registry the market searches, and the market shows such a server as
"docker" alone, so the publisher's line ran unseen: `--network host` put
the container on this computer's loopback, where magpie's gateway and
GUI API take a request as the owner's, and `--privileged`, `--pid host`,
`--cap-add`, a bind of / or of docker.sock, or `--env-file ~/.aws/...`
reached past the container to the computer. Before eff7f9f62 none of
them was taken.

dockerOptSafe now takes only options that keep the container one: -i,
--rm, --init, --read-only; the container's own env, entrypoint, workdir,
user, platform, name and pull; a -v or --mount of a named or anonymous
volume or a tmpfs (never a path, ~, a Windows drive, or a volume driver's
options); --network none or bridge. Any other is left out, and a server
that needs one (isRequired) isn't offered. Every curated docker server
the market offered still starts the same line (MARM's volume, env and
entrypoint included).

Run on mote at origin/main 6a253f8af plus this change (then rebased onto
cec267f90, which changed GUI assets only):
go test ./internal/library ok (./internal/gui ok before the rebase
onto it, which brought no Go change there); GOOS=linux and
GOOS=windows go vet ./internal/library ok; gofmt clean.
Broken by hand: with the gate taken out,
TestRegistryDockerOptionsStayInTheContainer fails 23 of its 32 cases
(host network, privileged, root/home/socket/drive binds, bind mounts,
volume-opt, env-file...).
Not tried: a real `docker run` of an entry with these options; the full
suite.
2026-11-10 16:14:54 +08:00
yetone 93a33d8174 agent: OpenBot's icon, its requests named its own, its skills in the Library (SSNQT on X)
SSNQT on X, magpie 0.1.3503 on macOS, OpenBot (611ce90d1): no icon in
the Agents list, its requests listed as OpenCode's, and no way to pick
it for skills or MCP servers in the Library.

- Icon: OpenBot's production icon (build/icon-production.png in
  nightly-labs/openbot, 128px) as icons/openbot.png, in pngIcons and in
  app.css's tile rule (a solid tile, icon-tile.test.cjs); openbot is off
  client_icons_test's generic list.
- Requests: OpenBot seals an endpoint's key and headers in safeStorage,
  which magpie can't write, and hands the endpoint to the OpenCode it
  runs, so every request came with OpenCode's User-Agent and nothing of
  OpenBot's. magpie's entry is now at <gateway>/agent/openbot/v1
  (gateway.AgentURL). lanGuard takes /agent/<id> off the path when <id>
  is an agent magpie knows (takeAgentPath), agentOf names that agent
  first, and startedByAgent never takes such a request for a script. An
  unknown id is left in the path (404 as before). An entry written at
  /v1 is rewritten at the next sync; OpenBot reads it after a restart,
  which its notice already says. Requests recorded before stay
  OpenCode's.
- Library: an openbot target with skills in ~/.agents/skills, the only
  folder OpenBot reads (home-skills.ts, HOME_SKILL_FOLDER). Its MCP
  servers are rows in its SQLite database (openbot.db,
  projection_mcp_servers), which magpie doesn't write, so it stays out
  of the MCP picker: #5896.
- Guard: TestEveryAgentInLibrary fails for a built-in agent that has no
  Library target and isn't in noLibrary with a reason. 34 agents had
  none when it landed; they are listed as "not looked at (#5897)". The
  icon guard (TestEveryClientHasNameAndIcon) and the agent-name guard
  (TestIsAgentByUserAgent) were there already.

Run (mote unless said): gofmt -l internal (clean); go vet darwin, GOOS=linux
-tags nogui, GOOS=windows on agent, gateway, library, gui: ok;
go test -count=1 ./internal/agent ./internal/gateway ./internal/library
./internal/gui ./internal/usage: all ok but internal/gui's
TestUpdateSlowDownloadOutlastsTheCheckBound (its check request hit its
deadline with four other suites on the box; passes 3 of 3 alone; the
updater isn't touched here; #5905); TestAgentInPath and
TestEveryAgentInLibrary on Windows (win-run): ok; GUI i18n-keys,
icon-tile, icon-one-tone, icon-builtin-over-address,
routing-client-icons, library-pick-remove: chromium 101/101, webkit
54/54. Real gateway (nogui build, sandbox HOME, port 3591): a POST to
/agent/openbot/v1/chat/completions with OpenCode's User-Agent was
recorded as agent openbot, the same at /v1 as opencode, and
/agent/openbot/v1/models answered the list.

Broken by hand, each red: the takeAgentPath call in lanGuard taken out
(TestAgentInPath: path kept, agent opencode); the pathAgent check in
agentOf taken out (agent opencode); the openbot case in targetOf renamed
(TestEveryAgentInLibrary: openbot has no place); Icon back to generic
(TestEveryClientHasNameAndIcon).

Not tried: real OpenBot or a real OpenCode sending to the new address
(the URL is built as `${baseURL}/chat/completions` by
@ai-sdk/openai-compatible, read in its source); the full suite (runs
after the tag).
2026-11-10 15:56:21 +08:00
yetone 6fa9ff8358 library: billion-context's version is read past the warnings bili prints first
readBili ran `bili --version` with stderr and took the output's first
word. bili writes its warnings to stderr before the version; with a
config key it doesn't know (models, in a sandbox HOME on mote, bili
0.1.213) the output began "2026-11-09T23:44:06.211 [warn] [v=0.1.213]
...", and that timestamp was the card's version. biliVersion takes the
first word of the first line that is a version.

Run:
- go test -tags nogui -run 'TestBili' ./internal/library on mote: ok.
- go vet ./internal/library for darwin, GOOS=linux -tags nogui and
  GOOS=windows: ok. gofmt -l clean.

Broken by hand: readBili and the test back on the first word of the
output: TestBiliVersionPastItsWarnings red (the timestamp, "[warn]",
"command").

Not tried: the card showing it in the GUI (the field is the same
string the card already prints).
2026-11-10 15:47:32 +08:00
yetone 97fcbe3540 library: billion-context's card shows the tokens it saved (Scott__D on X)
The RTK tab says what RTK saved (rtk gain); the billion-context tab said
nothing of its effect. bili 0.1.213 has no command that prints its
savings. Its running proxy serves its dashboard's numbers at
GET /__bili/overview, summed over every session in its one store, and
each bili that runs registers in <state>/instances/<id>.json
($XDG_STATE_HOME or ~/.local/state, then billion-context, on every
system; read from bili's dist and its Hermes plugin's twin reader).

readBiliSaved (internal/library/bili_saved.go) asks the registered
bilis newest first, loopback http origins only, 3s in all, and puts the
first answer on BiliView.Saved: netSavedTotal (bili's headline "net
savings", after post-fold rebuilds and the summaries' cost, only with
hasFoldData), grossSavedTotal (which bili calls an upper bound),
foldsTotal, sessions, requests. The answer is kept in bili-saved.json
in magpie's config folder and shown "as of" its time when no bili runs;
a kept file that doesn't parse is no answer. magpie never starts a bili
to ask (it would auto-update and start watchers). The card says
"166.3k tokens saved over 7 folds in 1 session", bili's own count over
every session on this computer, the gross before costs; "Nothing folded
yet over N requests" before a fold; and that it shows once bili has run
when no bili ever answered. zh, zh-TW, ja and de; site docs (en, zh,
ja) and docs/subsystems/library.md.

Run:
- Real bili 0.1.213 on mote in a sandbox HOME (ACP_AUTO_UPDATE=0, 20000
  token window, bili start on 18799, a fake OpenAI upstream answering
  usage = bytes/4): ten turns of a growing conversation through
  /bili/<upstream>/ gave overview net 166285, gross 166390, 7 folds,
  1 session, 10 requests. That literal answer is the Go fixture
  (testdata/bili/overview-0.1.213.json) and the GUI test's numbers.
  readBiliSaved/ReadBili run on mote against that live bili with that
  HOME read the same numbers (Live true, Version 0.1.213).
- go test -tags nogui ./internal/library ./internal/gui on mote: ok.
- win-run go test -run 'TestBiliSaved|TestBiliLoopback'
  ./internal/library on xiaomi-gpu: ok.
- library-bili, i18n-keys and i18n-en-no-cjk in chromium and webkit
  (every language, 1100 and 420 wide): 92 pass, 0 fail.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui and
  GOOS=windows for internal/library and internal/gui: ok.
- site/public/llms-full.txt regenerated (node llms-full.mjs); site
  worker.test.mjs: 38 of 38 ok.

Broken by hand:
- the loopback filter taken out: TestBiliSavedFromRunningBili red
  (192.0.2.7 asked first, the 3s budget gone, nothing read).
- net read from tokensSaved, and a kept answer marked live:
  TestBiliSavedFromRunningBili and TestBiliSavedOnThePage red.
- the card's line taken out: library-bili 40 of 42 red (chromium).

Not tried: a real agent session with a real model through bili (the
upstream was a fake with made-up usage, so only the plumbing of bili's
numbers is checked, not how much a real session saves); a bili with
money data (hasMoneyData; its dollars are passed as usd but not shown);
the card on Linux WebKitGTK.
2026-11-10 15:47:32 +08:00
yetone eff7f9f62a library: a market server starts the way its registry entry says (fwxkogaia on X)
Serena from Library → MCP's market showed "已退出 (2)": magpie ran
`uvx serena-agent`, which prints its help and exits 2. The registry has
uvx run it as `uvx -p 3.13 serena-agent start-mcp-server
--project-from-cwd --context desktop-app`: its runtimeArguments, which
the shipped crawl (market_servers.json) had dropped and magpie never
read.

The class, fixed in launchLine (market_launch.go):
- runtimeArguments are read: the runner's own options (uvx -p/--from/
  --with/--prerelease, npx --package, docker's mounts, -e and
  --entrypoint) go before the package, the program's words after it,
  then packageArguments. A required option with no value magpie can
  fill keeps the package from being offered.
- An executable not named after its package is reached with
  `uvx --from <pkg> <bin>` / `npx -y --package <pkg> <bin>`. The crawl
  now keeps each package's executables (`bins`: npm's `bin`, the
  wheel's console scripts); a package with none, or several with none
  standing out (pickBin), isn't offered. `python -m mod` among
  runtimeArguments runs that module from the package.
- One package that can't be started no longer hides another of the
  same server (npm, then pypi, then oci).
- serverKey/packageOf skip uvx's option values, so Serena's key stays
  "uvx serena-agent" and an installed one is still found.

Audit of the 500 shipped entries (old line → new): 101 change. Among
them firebase (`npx -y firebase-tools mcp`), basic-memory, docling,
ouroboros, pm-claude-skills, llm-sandbox, polymarket-paper-trader,
visualtorch, canvas-mcp, alfanous (python -m), uniswap, pyscrappy,
llmtrim, reddit-research-mcp, word-mcp-live, omega, tinysearch,
haiku-rag, orcareplay, terravision, watch-skill, PyMemoryEditor,
edgartools/mirobody/new-term-radar/backlot (--with/--python), docker
robin/funasr/MARM (mounts). No longer offered (no line that starts):
aihawk and mcp-sap-docs (not on PyPI/npm), mcp-video, unifi-mcp-server,
antigravity-link-extension (no executable), token-savior, flyto-core
(several, none for MCP), maintenant and apollo (a docker mount to fill
in).

Users who installed one already: heal() gives a uvx/npx server whose
command and arguments are exactly the line magpie offered before the
line the registry says (healMarketLines), so the next start of magpie
rewrites library.json and every agent given it. A line the user edited
is left as it is.

Run (mote, via mote-run): go test ./internal/library ./internal/gui;
go vet darwin, GOOS=linux -tags nogui, GOOS=windows; gofmt.
TestRegistryLaunchLines uses the registry's own entries (Serena,
docling, olcli, alfanous, visualtorch, basic-memory, firebase, MARM,
...); TestPopularSerenaStarts reads the shipped crawl;
TestInstalledMarketLineHealed seeds `uvx serena-agent` given to Codex,
syncs, and checks config.toml and library.json. No network in tests.
Real starts on mote in a sandbox HOME (MCP initialize): `uvx
serena-agent` exits 2 with usage; the new Serena line answers
initialize (serverInfo Serena). Also answer: polymarket pm-trader-mcp,
basic-memory, llmtrim, pm-claude-skills, visualtorch-mcp. canvas and
reddit start but need their keys.

Broken by hand: ignoring runtimeArguments and the bins check turns 14
of TestRegistryLaunchLines' cases and TestPopularSerenaStarts red;
dropping healMarketLines from heal turns
TestInstalledMarketLineHealed red.

Not tried / still wrong upstream: omega and tinysearch now run their
real executable but their registry entries omit the `[server]` extra
(omega also needs `serve`), so they still don't serve MCP; that is
their registry entries. Docker lines weren't started. No GUI asset
changed, so no GUI files were run. The full suite runs after the tag.
2026-11-10 15:47:14 +08:00
yetone e7fe52fdc3 minimax: follow the data folder MiniMax Code Desktop moved, not ~/.minimax (YujunT46308 on X)
YujunT46308 on X (magpie 0.1.3519, MiniMax Code 3.1.13 CN): with the
app's data folder moved to another parent (localRuntimeDataParentDir),
magpie went on writing ~/.minimax/config.yaml, which the app no longer
reads.

How MiniMax Code 3.1.13 finds it, read from its own app.asar
(dist/main/modules/local-runtime/data-dir.js,
resolveLocalRuntimeDataDirSelection; @mavis/config's config.js for the
runtime): MINIMAX_DATA_DIR, then MAVIS_DATA_DIR, then the desktop
setting, then ~/.minimax. Settings' data-folder move keeps the parent as
config.localRuntimeDataParentDir in its electron-store file
(storage.ipc.js: minimax-agent-cn-config.json for the China build,
minimax-agent-config.json for the global one) in Electron userData,
named by app-identity.js: "MiniMax" (CN) / "MiniMax Agent". The data
folder is <parent>/.minimax.

What changed:
- appdir.MiniMaxDirIn resolves the folder in that order, reading the
  store under ~/Library/Application Support on a Mac and %APPDATA% on
  Windows. A missing, unreadable or unparseable store, or a parent that
  isn't an absolute string, is ~/.minimax, as electron-store itself
  reads a file it can't parse as its defaults.
- internal/agent's MiniMaxDir (detection, connect, restore, Sync, Check)
  and internal/sessions' MiniMaxDir (Usage's calls) both use it; the
  Library's skills follow a.Dir. WSL's mcode still uses the distro's
  ~/.minimax (no desktop app there).
- MAVIS_DATA_DIR joins agentenv's variables, so tests sandbox it.
- agent-wiring.md and reference.md say where the folder comes from.

Run:
- On mote, the real MiniMax Code 3.1.13 CN arm64 dmg: launched with no
  setting, userData was ~/Library/Application Support/MiniMax holding
  minimax-agent-cn-config.json; with config.localRuntimeDataParentDir
  set to a folder, the next launch created <parent>/.minimax/config.yaml.
  appdir.MiniMaxDir() against that real store printed <parent>/.minimax.
  (The test data I made on mote was removed after.)
- mote-run go test -count=1 ./internal/appdir ./internal/agentenv
  ./internal/sessions ./internal/library: ok. ./internal/agent -run
  'MiniMax|Minimax|WSL|Env|Spelled|Handwired': ok.
- win-run go test -run MiniMax ./internal/appdir ./internal/agent
  ./internal/sessions: ok, TestMiniMaxDirIn and
  TestMiniMaxCodeMovedByDesktop ran (not skipped) with %APPDATA% paths.
- gofmt -l clean; go vet of the touched packages for darwin, windows
  and linux (nogui, CGO off) ok.

Broken by hand: with the desktop store read turned off,
TestMiniMaxDirIn and TestMiniMaxCodeMovedByDesktop go red (the folder
reads as ~/.minimax).

Not tried: the Windows desktop app itself (userData %APPDATA%\MiniMax
is Electron's appData plus the app name, the same rule seen on the
Mac); the global build's store with a real install; a store mid-rollback
(the app's guard writes the restored parent back to the same key on its
next launch). A user who also runs the mcode CLI without
MINIMAX_DATA_DIR has it on ~/.minimax, which magpie now leaves alone
while the desktop folder is moved.
2026-11-10 14:43:44 +08:00
yetone bb4dd86790 appdir: magpie's files and cache move to another disk, a link left where they were (CHENGJIAHEGOXIS and buhaodeshiyehao on X)
CHENGJIAHEGOXIS asked to keep magpie's data and cache on an external SSD
instead of the Mac's own disk. buhaodeshiyehao asked to keep magpie's
personal data on another disk. Settings › Sync now has a Data folder row.
It shows where magpie's files are, with Show, Move… and Move back.
`magpie data` does the same from a terminal.

- What moves: appdir.Config() and Cache() only, into <picked>/magpie/config
  and /cache. The agents' own folders and session histories stay where
  each agent reads them. A link is left at each old path, so every path
  the agents were given still works. On Windows, when symlinks need a
  privilege (#973), the link is a junction; library's junction code moved
  into appdir for this.
- Never under a running magpie. Move… explains first in the app's own
  dialog, then asks for the move (move-to.json). The app restarts itself
  through the update path's relaunch and quits, and the new process makes
  the move in cli.Main before it reads anything, once. A failed move is
  kept in move-result.json and shown under the row. When another magpie
  serves the gateway, or for magpie web, the app doesn't restart, and the
  row says the move waits, with Cancel.
- Refused before anything quits: a relative or missing folder, a
  magpie folder there with files in it, or a folder inside magpie's own.
- One disk: a rename. Across disks: a copy. The old folder is put aside
  until the link is made, and a failed copy leaves everything as it was.
- Disk unplugged: magpie stops with an error (and a native alert from the
  app, as #989) instead of starting empty and writing over the link.
- Usage history in auto backups is left for a follow-up: auto backups are
  plain JSON kept 7 times, and usage is large and synced separately.

Docs: sync-backup.md has a "Data folder on another disk" section, and
docs/start's #data-folder (en, zh, ja) describes Move….

Run (mote, at this tree on 0791c91c5):
- gofmt -l: clean
- go vet: darwin, linux -tags nogui and windows, for appdir, cli, gui and
  library: ok
- go test -count=1 ./internal/appdir ./internal/cli ./internal/library
  ./internal/gui: ok. cli was red first, on TestEveryRouteHasACommandOrIsNamed;
  the routes are now mapped to magpie data.
- Windows (xiaomi-gpu): appdir's Move tests, including TestMoveByJunction
  with symlink forced to fail with ERROR_PRIVILEGE_NOT_HELD, and
  TestDataFolderMoveRestarts: ok. TestFoldersJoinedOnce is red there,
  which is #4846 (appdir.go is untouched).
- GUI, chromium + webkit: data-folder (5 languages x 1100/420px),
  auto-backup, sync-*, settings-sections, segs-press-redraw, old-webkit,
  github-sync, s3-sync, skill-how, usage-computers,
  webdav-settings-refresh, i18n-keys and i18n-en-no-cjk: ok except
  phone-no-sideways de 375 (#5869) and s3-sync webkit en (#3413/#5872,
  red 3 of 3 on this tree too), both already red on main.
- Linux (WSL magpie-desktop): appdir -run Move and
  TestDataFolderMoveRestarts (nogui): ok.

Again after rebasing on 0a44c1c84 (mote): gofmt, the three vets, go test
./internal/appdir ./internal/cli ./internal/gui, and the GUI files
data-folder, i18n-keys, i18n-en-no-cjk, auto-backup and settings-sections
in both engines (60 of 60): ok. Pushed on 5426c43cc, which touches only
the gateway's dsh_compact and the routing plugin, none of these files.

Broken by hand (each went red):
- no removal of a half copy: TestMoveCopyFailsLeavesAll "a half copy
  is left on the disk"
- no Unreachable check for a gone disk: TestMovedDiskGoneIsUnreachable
- restarting with another magpie serving: TestDataFolderMoveRestarts
  "2 restarts"

Not tried: a real app restart making a real move on a real external disk
(the restart is the update path's relaunch, faked in the test); a real
unplug.
2026-11-10 13:46:13 +08:00
yetone e4197144a8 perf: every package's package-level regexps compile on first use
v0.1.3516 made gateway's and redact's patterns lazy. The other 299
package-level regexp.MustCompile calls, in 148 files across agent,
provider, gui, library, codexcat, sessions, usage, plugin and the rest,
now go through lazyre.New too, so a launch that never reaches them
(`magpie statusline`, run by Claude Code on every message) doesn't
compile them. Fields, maps and params that held them are *lazyre.RE.

Measured on mote (M5 Pro), sandbox HOME, v0.1.3516-equivalent build
(t42) against this one (t43):
- GODEBUG=inittrace=1 sum: 7.39 MB / 69,837 allocs -> 4.62 MB / 46,765
- `magpie statusline`, 3 runs each: instructions retired ~212M -> ~176M,
  peak memory footprint 19.2-19.4 MB -> 16.8-17.0 MB

Run: go vet ./... (darwin) ok; GOOS=windows go vet on each of the 30
changed packages ok; GOOS=linux go vet ok except ., internal/cli and
internal/gui, which stop in wails v3's cgo files when cross-compiled
(the same at main). New TestAllLazyPatternsCompile at the root compiles
all 574 registered patterns (ok), so a bad pattern fails a test rather
than a first use.
Not run before push: the changed packages' own test suites; they run
on mote after it.
2026-11-10 12:54:39 +08:00
yetone ef0d589ed7 library: a project's skills are picked from its menu, its card lists only those it has (POM_JUMPING on X)
POM_JUMPING on X: "skill加入本地项目是能否可选?之前添加到本地项目会把所有skill添加进去".
Nothing wrote every skill into a project: AddProject starts it with none.
But an opened project card listed every library skill as a row, each with
its agent chips, so the project looked like it had them all, and choosing
meant scanning every row for the chip to press.

Now the open card lists only the skills the project has (a skill unticked
in this view stays listed until the card closes, so a chip slip can be
put back), with "No skills yet" when it has none. A "Skills" app menu
(openProtoMenu, multi-select, with search past 8 skills) beside the copy
switch picks which go in. On close it writes only what changed:
- a ticked skill goes to the agents the project's skills are already
  for, or, in a project with none, to every agent that reads a project's
  skills and is installed;
- an unticked one comes out (agents []);
- skills not touched keep their agents as they were.
Several picks are one write: library.ProjectSkills (API
projects/skills, {dir, names, agents}); ProjectSkill now calls it.
New status strings "{skills} are in/out of {name}" in zh, zh-TW, ja, de.

Run (mote; first at e697e7ddf, then again after the rebase on 0e6845586,
which changed library client.js/i18n.js):
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
  ./internal/library ./internal/gui: ok.
- go test -count=1 ./internal/library ./internal/gui: ok.
- New TestProjectSkillsPickSome: picks one of three, keeps pdf's agents,
  a name not in the library places nothing, agents nil takes it out.
- New internal/gui/tests/project-skills-pick.test.cjs, chromium + webkit,
  en + zh: 6/6. Red on the old client.js (card listed all three); red
  with the list put back to every skill (6/6 fail); red with new skills
  sent to every agent always (6/6 fail).
- Broken by hand in Go: ProjectSkills resetting p.Skills -> the new test
  red (pdf lost).
- 113 GUI files, library-*, skill-*, project-*, i18n-keys, i18n-en-no-cjk,
  gui-ja/de/zh-tw, pick-skills, every-skill, click-scroll, both engines:
  1956/1959. The 3 reds are skill-where.test.cjs chromium "the switch
  scrolls nothing" (zh-TW/ja at 900px); its fixture has no projects, and
  alone on origin/main e697e7ddf it fails 3 of 11 too, a different set
  each run: #5859.
- After the rebase: project-skills-pick, project-servers,
  project-remove-keep, i18n-keys, i18n-en-no-cjk, library-memory,
  gui-zh-tw/ja/de 57/57; go vet + go test ./internal/library
  ./internal/gui ok.

Not tried: the real app with a real project folder (fake API only);
Windows (no Windows-specific path changed; vet only).
2026-11-10 12:25:32 +08:00
yetone 4869d0c966 library: an MCP server switches off for every agent and app, and on again as it was (swang20201 on X)
An installed server in Library could only be removed. Each server row
now has a switch after its agent chips. Per-agent chips already
existed, but in Docker gateway mode there are none, and the MCP router
gives every server to any app at its address, so nothing could turn a
server off there.

ServerOn (POST /api/library/servers/on, `magpie library mcp off|on
<name>`) reuses the Hidden/Paused pair a plugin's hidden server
already has. Off: Hidden, with its agents kept in Paused. On: those
agents get it back, or none when it had none, so the router gives it
to other apps again. Its command, env, headers, sign-in, DisabledTools
and note stay in library.json. Off, it is also left out of every
project's files (syncProjectMCP) and of subagents' mcpServers
(renderSubagent), which before had only skipped a server gone from
the library. The router's held process ends on the next prune,
because Hidden/Paused are in its hubKey. An off row is dimmed, its
chips take no click, and it is health-checked only on a click.
Strings are in zh, zh-TW, ja and de. docs/subsystems/library.md has
a row for it, and mcp-router.md names it.

Run (mote):
- go test ./internal/library ./internal/cli ./internal/gui: ok.
- go vet ./..., GOOS=linux -tags nogui, GOOS=windows: ok.
- gofmt -l: empty.
- GUI: the 145 files that touch the Library, i18n-keys and gui-*, in
  chromium and webkit. 2798 of 2881 passed.
  - i18n-keys was red because the key "{name} on" also matched core's
    "{name} on magpie". The key is now "Turn {name} on or off", and
    i18n-keys and library-mcp-on are green (26/26).
  - Nine files are red the same way on a clean origin/main 217d77848,
    with the same set failing on this branch: library-hooks,
    library-subagents, library-loading, library-items, list-sort,
    market-have, mobile-web, sidebar-tab-top and skill-where. The Library's
    tab strip shows MCP and has no RTK. Filed as #5850.
- library-mcp-on.test.cjs: en, zh, zh-TW, ja and de, in the app at
  1100px and in gateway mode at 420px, both engines, 22/22.

Broken by hand, each went red:
- project_mcp without the Hidden skip: the project's .mcp.json kept it.
- subagents without it: the subagent still named it.
- ServerOn not giving Paused back: on again, claude's file lacked it.
- the row without its switch, and the CSS without pointer-events:none
  on an off row's chips: library-mcp-on red.
- A Hidden check added to hubPrune stayed green, because hubKey
  already ends the process, so it was left out. The test still checks
  that the process ends.

Not tried: the real Docker image, and a real MCP server with a
sign-in (the test's server is a fake stdio one). The TUI has no
switch (the CLI has one).
2026-11-10 10:23:53 +08:00
yetone b75aff1073 library: billion-context for Zed through its /bili/ prefix (CoMi6818 on X)
billion-context's README lists Zed, but Library's billion-context tab
offered only Pi, omp, OpenCode and Claude Code. Zed has no plugin of
bili's. Upstream gives it two routes: `bili zed`, a Linux-only launcher
that leaves a provider on loopback direct (so it never passes magpie's
gateway), and, on every system, the /bili/ prefix its docs give any
client whose model address can be edited, with `bili start` answering
on 8787.

Zed is now a URL lane (biliURLLanes, internal/library/bili_url.go).
Switched on, magpie has bili start answer (one the user runs is used;
else magpie runs its own under KeepLinked's context, logged to
bili-start.log, and starts it again at magpie's start while Zed is on),
then agent.ZedThrough sets the magpie provider's api_url to
http://127.0.0.1:8787/bili/<gateway>/v1 and saves the key for that
address in the credential store, where Zed looks it up by address. A
pick and a sync keep the prefix while magpie answers through it
(zedReach, #1985's proxy recognition). Off puts api_url back on the
gateway and ends magpie's bili start when nothing goes through it.
Zed must be on magpie first; the error says to pick a magpie model.

Run:
- bili 0.1.213 on mote: bili start --port N, then
  /bili/http://127.0.0.1:<fake magpie>/v1 forwarded GET /, GET
  /v1/models and POST /v1/chat/completions with Authorization kept and
  bili's tools injected (repro/zedroute.sh).
- mote: go test -tags nogui ./internal/library ./internal/agent (full
  packages), go vet darwin, GOOS=linux -tags nogui, GOOS=windows.
- mote: library-bili, i18n-keys, i18n-en-no-cjk GUI tests (chromium
  and webkit).
- win-run: go test ./internal/agent ./internal/library -run
  'TestZed|TestBili'.
- gofmt -l clean.

Broken by hand: SetBili without the URL-lane dispatch, and zedReach
without the proxy keep: TestBiliZedThroughPrefix and TestZedThroughBili
go red; restored, green.

Not tried: a real Zed app through bili (no Zed on mote), and the real
keychain write (zedCredential stubbed in tests, as before). Other
clients upstream lists (Cline/Roo/Kilo, Continue, OpenHands, Void,
Cursor, Warp, launcher-only lanes) are not added here.
2026-11-10 09:59:22 +08:00
yetone 3aa55065a3 library: Claude Code keeps its auto-compaction beside billion-context (Kling__Lab on X)
Kling__Lab's Claude Code stopped after a little use with "Prompt is too
long", every message answered at once (作業時間 0s) with nothing sent.
bili's Claude Code install writes DISABLE_AUTO_COMPACT=1 into the shared
~/.claude/settings.json. A session bili doesn't fold then has nothing to
keep it under the window: the Claude desktop app's Code tab runs Claude
Code on that settings.json with its own ANTHROPIC_BASE_URL, past bili's
proxy (bili's own #2290), and a window bili takes larger than the one
magpie serves lets the session reach it first. With auto-compaction off,
Claude Code blocks locally at about window-3000 and returns "Prompt is
too long" without a request.

magpie now writes "0" in place of bili's added "1" right after the
install. bili leaves a value that isn't "1" as the user's, through its
SessionStart hook and a reinstall, and its remove takes only a "1". So
auto-compaction stays on as a backstop at the window magpie wrote
(CLAUDE_CODE_AUTO_COMPACT_WINDOW), which bili, when it does fold, keeps
the session under. A DISABLE_AUTO_COMPACT the user had before the install
is left as theirs. A plugin magpie installed before this is mended from
KeepLinked at start, and its bili-plugins.json record says "0" too, so
switching it off still puts the file back as it was.

Reproduced on mote with Claude Code 2.1.321 and billion-context 0.1.213
against a fake gateway reporting 195000 input tokens on a 200000 window:
with DISABLE_AUTO_COMPACT=1 the second turn is "Prompt is too long" with
no request sent; with 0 it compacts and goes on.

Run (mote-run): go test -tags nogui ./internal/library -run
'TestBili|TestParseBiliList' -v, all ok, including the new
TestBiliClaudeKeepsAutoCompact (on and off, the user's own value, a
plugin installed before), then the whole package (go test -tags nogui
./internal/library ok, 154s). gofmt -l clean; go vet ./internal/library
./internal/gui/..., GOOS=linux -tags nogui and GOOS=windows go vet
./internal/library ok.

Broken by hand: biliKeepCompact returning at once. The new test's "on
and off" and "installed before" went red (DISABLE_AUTO_COMPACT = 1 after
the install / after magpie started), "the user's own" stayed green.

Not tried: the real Claude desktop app's Code tab, and a real bili
install on a real account; the fake bili in the test copies bili 0.1.213's
"1 only when absent or 1" rule, read from its source.
2026-11-10 09:48:31 +08:00
yetone fdc96dfe4d library: a billion-context tab switches its plugin on per agent and restores each file exactly
@Kling__Lab on X asked for billion-context (npm billion-context, CLI bili,
github.com/ranxianglei/billion-context) beside RTK. The Library gets a
billion-context tab after RTK, a card like RTK's:

- No bili: its README's `npm install -g billion-context --prefix=~/.local`
  and Install billion-context (InstallBili; biliPath finds bili in
  ~/.local/bin when it isn't on PATH).
- Installed: its version, a note that an agent switched on here can't also
  run billion-context-pi or opencode-acp, and a switch per agent that runs
  `bili plugin install|remove <agent>` (SetBili), read back from
  `bili plugin list`.
- Offered for Pi, omp, OpenCode and Claude Code, the lanes that keep
  magpie in front: Pi/omp/OpenCode load it in process and still send to
  magpie; Claude Code goes through bili's proxy, which forwards to
  magpie's gateway. Not offered: Codex (MCP only), ZCode (routes only its
  own provider), Kimi Code (renames default_model to bili-kimi), dsh (its
  install failed through dsh's pnpm), Hermes (can't be tried in a sandbox
  HOME), and agents in WSL.

bili's remove doesn't restore a file: it leaves `"packages": []` in Pi's
settings and `extensions:` in omp's config, and after magpie rewrote
Claude Code's settings.json it deleted ANTHROPIC_BASE_URL (Claude Code
then went to Anthropic, not magpie) and put back DISABLE_AUTO_COMPACT.
So switching on records each file before and after (bili-plugins.json in
magpie's config folder), and off writes the before bytes back when the
file is unchanged since, else merges JSON three ways; with no record
(bili set up outside magpie) only a Claude Code ANTHROPIC_BASE_URL the
remove took out is put back. bili's .bili-bak/.bili-last files go too.
`GET/POST /api/library/bili`, `POST /api/library/bili/install` are
named in the CLI parity list beside RTK's. Docs: site library pages
(en, zh, ja) and docs/subsystems/library.md.

Run:
- go test ./internal/library -run 'TestBili|TestParseBiliList' on mote:
  ok (a fake bili mimicking pi/claude lanes, .bili-bak re-backup and
  claude's buggy remove; a fake npm for the install).
- Full `go test -timeout 45m ./...` on mote at 16c67965f (this commit
  before the body was written, same tree): every package ok but
  internal/gateway's TestBurstTellsNoSpeed/responses_from_chat_burst
  (804ms burst read as a speed, load ~50 after a mote reboot); passes
  -count=3 alone at the same head; recorded on #2719, same test. An
  earlier full run at 8c8c63537 was all ok.
- GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...,
  go vet ./... at 16c67965f: ok. gofmt -l: nothing.
- GUI at 16c67965f: library-bili, i18n-keys, i18n-en-no-cjk,
  library-memory, library-rtk-gain, library-pi-extensions, Chromium and
  WebKit (library-bili: every language, 1100 and 420 wide).
  80 of 80 pass.
- The whole GUI suite is still running on mote at this head, started
  before the tag; two earlier whole-suite runs were cut short (mote ran
  out of disk mid-run, then rebooted), so their reds are not a record.
  Its result goes in a follow-up.
- Real, in a sandbox HOME (named dir, bili 0.1.213 installed there,
  magpie web built from this branch on 3486/3487): through magpie's API,
  Pi and Claude Code switched on; `claude -p` and `pi -p` each answered
  "pong" through magpie's gateway (Claude Code via bili's proxy on
  18788 -> 127.0.0.1:3486); switched off: Pi's settings.json, Claude
  Code's settings.json and .claude.json byte-identical to before, no
  .bili-* files left, commands/acp-cache.md gone; claude -p answered
  again straight to the gateway. Earlier, with bili run by hand, Pi,
  OpenCode, omp, Claude Code and Kimi each sent a request through a
  recording relay with bili's tools/headers on it.

Broken by hand: skipping biliRestore turned TestBiliOnOffExact,
TestBiliClaudeKeepsMagpiesRoute and TestBiliOffWithoutRecord red;
dropping the no-record URL fix turned TestBiliOffWithoutRecord red;
removing the tab turned all 22 library-bili cases red; removing the zh
note string turned the zh cases red in both engines. Each put back.

Not tried: Kimi, dsh, Hermes, Codex, ZCode lanes (not offered); WSL;
Windows (the %APPDATA%\npm lookup and npm without --prefix are untried
on the Windows box); OpenCode and omp switched through magpie's API
(switched by hand with bili before); a real npm install from the button
(sandbox had bili already; the test fakes npm).
2026-11-10 07:24:26 +08:00
yetone a28744c325 gateway: memory is an MCP server every agent can mount
memory_search, memory_save and memory_forget at /mcp/magpie/memory,
served and guarded as the search server is (serveMCP): another computer
reaches it only while magpie is shared, with a gateway key. A save
through it is active at once, origin agent, kept everywhere, for the
project (the git repository the agent works in, by its remote) or for
the agent alone; without a folder or a client name it says it can't
know rather than guess.

- The Library's market offers it as magpie-memory, run as
  `magpie mcp memory` (browsermcp.RunMemory): stdio relayed to the
  gateway with the folder it was started in (X-Magpie-Cwd) and the
  client name from initialize (X-Magpie-Mcp-Client).
- Behind the MCP router the hub keeps it on this computer (hereOnly)
  and passes the caller's roots and client in _meta (wantsCaller), as
  it does for magpie's own server.
- OwnMCPPath lists it among magpie's own servers.
- Judged as its sibling servers are: a gateway key's MaxConcurrency
  doesn't hold it (a tool call of a turn already held), and a read-only
  key is refused (memory_save writes). The first full gateway run was
  red on TestKeySlotEveryRoute and TestReadOnlyKeyEveryRoute until the
  route was listed.

Run (mote-run):
- go test -tags nogui ./internal/gateway: ok (881.5s)
- go test ./internal/browsermcp ./internal/cli ./internal/memory: ok
- go test ./internal/library: ok (130.9s)
- go vet, GOOS darwin, linux, windows: ok; gofmt -l clean
Broken by hand, each red, then green restored:
- the hub not sending memory its caller (wantsCaller without isMemory):
  TestHubTellsMagpieMemoryItsCaller "roots asked false"
- the relay not setting X-Magpie-Cwd: TestMemoryBridgeSendsFolderAndClient
- the gateway ignoring X-Magpie-Cwd: TestMemoryMCPSharedAcrossAgents
  (a project fact kept everywhere)
Not tried: a real Claude Code or Codex mounting magpie-memory.
2026-11-10 03:25:44 +08:00
yetone 79decfe71a library: the agents ticked for instructions are given memory's digest
The agents ticked under Library → Instructions get a "## Memory" part in
their instructions: the global memories, the agent's own, and each
project's under the folders it was seen in (memory.Digest), unless
Instructions.NoMemory. The digest changes only when published, so an
agent's instructions (and the prompt cache on them) change mid-session
only then: at once when the user changes memory (PublishMemory(false),
called by the GUI), and once a day from KeepLinked's loop for what
agents saved meanwhile (PublishMemory(true) -> memory.PublishDue).
PublishDue writes nothing while memory has never held anything, so a
user who never uses memory gets no memory.json.

Run (mote-run, whole worktree, with the rest of the memory layer):
- go test ./internal/memory ./internal/library: ok (library 130.9s)
- go vet ./internal/memory ./internal/library ./internal/gui, GOOS
  darwin, linux, windows: ok
- gofmt -l: clean
Broken by hand (mote-run -run TestMemoryDigestInInstructions):
- memoryDigest's NoMemory check removed: red. It first stayed green,
  since the test switched NoMemory on with memory.json deleted; the test
  now gives memory back and sees the part return before switching it off.
- PublishDue's "nothing kept" guard removed: red ("a due publish with
  nothing kept wrote memory.json").
Not tried: a real agent reading the digest in its instructions.
2026-11-10 03:25:44 +08:00
yetone 88b541a25c images: every pointer names Settings › Models › Images, where the page is
The image models moved under Settings › Models, but the Library's Magpie
Image sheet, the MCP server's instructions to agents, the gateway's
"no image model" errors, the video tool's text and the docs still sent
users to "Settings › Images", a tab that no longer exists (the scattered
settings audit after netube99 on X). Every user-facing string now names
Settings › Models › Images in en, zh, zh-TW, ja and de, as do the site's
Qwen docs (en, zh, ja), llms-full.txt, the subsystem pages and comments.

Run in the tree with this change and the rest of the audit's fixes
(mote, base cd0ba05c2):
- go vet ./internal/gui ./internal/gateway ./internal/agent
  ./internal/provider ./internal/settingsapi: ok
- go test -run 'Image|Draw|Video|Hidden|Group|Settings' ./internal/gui
  ./internal/gateway ./internal/settingsapi: ok; ./internal/imagemcp,
  ./internal/library, ./internal/catalog: ok
- GUI: i18n-keys, i18n-en-no-cjk, image-models-hide,
  library-browser-setup: pass in Chromium and WebKit
- gofmt -l: nothing
Not tried: a real agent reading the new MCP instructions (text only).
2026-11-09 21:51:53 +08:00
yetone dae104bfac capre: a length check, not an unrolled repeat, holds nine patterns
Go's regexp unrolls a bounded repeat into that many copies of its
class: [A-Za-z0-9.-]{0,254} (the session terminal's bundle id) was
89kB of program, kept from start to exit, and Codex's item-id refusal
`.{0,1000}?` 88kB. Measured one by one over magpie's 540 package-level
patterns (1.5MB in all), the nine largest bounded ones were ~440kB.

capre.MustCompile(expr, max) is the pattern with * or +, matching only
a string of max characters at most (rune count, so the (?i) Kelvin
sign and invalid bytes count as the regexp counted them). The nine:
settings' bundle id, library's name and agent id (now name@wsl:distro
cut in two), Anthropic tool names, the trace page's name and find,
access's MCP server, OpenClaw's profile and Codex's provider id. The
item-id refusal is a function: the tail within 1000 characters of a
head.

Run on mote (go1.26.8):
- go test ./internal/capre ./internal/access ./internal/settings
  ./internal/library ./internal/sessions ./internal/agent ./internal/gui
  . : ok; ./internal/gateway -run 'ItemID|Undeclared|ToolName|Refus': ok
- TestCappedMatchesBounded holds each old pattern against its new one
  over 14 units x 19 lengths (0..300, at each bound +-1); with the
  length check taken out it is red (1586 mismatches).
  TestItemIDRefusalAsTheRegexp holds the function against the old
  regexp at 998..1002 characters of x, é, 日, \xff, \n; with 1001 it is
  red. TestCappedIsSmall: 1304 bytes held, 49680 bounded.
- go vet native, GOOS=linux and GOOS=windows over the touched packages
  (gui natively: its Linux build needs cgo); gofmt -l clean.
- Real build, GODEBUG=inittrace=1: magpie's own inits allocate
  11.93MB -> 10.61MB.
- Idle on the real-account copy, 180s heap: regexp programs (sampled)
  4.54MB -> 3.01MB.

Not tried: the full ./... suite; the gateway package beyond the run
above.
2026-11-09 21:47:24 +08:00
yetone fc8e98ba47 edit: Codex's thousands of [projects] tables are left out of the reads that don't want them (#2278)
Codex writes a [projects."…"] table for every project it is trusted in;
the owner's config.toml has 10,933 of them in 1.5 MB. go-toml's decoder
checks each table against its siblings one at a time, so every decode
of the file cost ~0.3s of CPU, and six readers decoded it again each
time Codex wrote it, plus a whole-file check before each write magpie
made to it.

- edit.TOMLWithout drops [projects…] tables in a single unstable.Parser
  pass. The agent's codexTopOf, sessions' readCodexConfig, provider's
  readCodexStoreSetting, library's rtk sandbox, hooks rekey and MCP
  entries read through it. None of them reads projects. A file that
  doesn't parse is passed through unchanged, so it still fails.
- validateTOML checks definitions with the rest of the file and the
  projects decoded apart, 128 projects to a decode. A bare [projects]
  table, a dotted projects.… key outside the tables, or any error
  decodes the whole file, so the error is the one it gives.

Run on mote (M5 Pro):
- BenchmarkCodexConfigDecode (10,933 projects): 283ms -> 7.6ms a decode.
- BenchmarkValidateCodexConfig: 52ms (the whole decode was 283ms).
- Startup CPU profile, first 70s, the real-account copy (the real
  1,524,099-byte config.toml): 2.76s -> 2.26s of samples; go-toml
  0.32s -> none sampled.
- go test ./internal/edit ./internal/sessions ./internal/provider
  ./internal/library ./internal/agent: all ok.
- go vet of the same five on darwin, GOOS=linux and GOOS=windows; gofmt -l clean.

Broken by hand:
- Decoding the batches into struct{} instead of a map:
  TestValidateTOMLDefinitionsInGroups went red ("a key twice", "a
  subtable then its key"), so the check keeps maps.

Not tried:
- the whole suite. Only the five packages that read the file were run.
- Now that projects is left out, a project table defined twice no longer
  fails these readers' decode. Codex itself refuses such a file.
2026-11-09 19:07:06 +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
yetoneandggbdpq 3480f822c5 library: an apply over a library that lost its instructions leaves the agents' parts alone (#5709)
Starting v0.1.3327 applied the Library at launch while it was empty, and
the apply wrote that over nine agents' instruction files: zcode's lost
magpie's part, and codex's, kimi's, opencode's and dsh's AGENTS.md were
deleted whole, with nothing asked or logged. library.json then recorded
hash("") for every agent. syncInstructions fell through to
withBlock(file, "") and, for a file with nothing of the user's outside
the part, edit.Remove.

Now:
- An automatic write (Sync: at a start, and beside a change) that would
  write nothing over a part while the library has no instructions to
  give anyone (no agent ticked, or no shared text) leaves the part where
  it is and logs a line per agent, naming a record whose last write
  hashes empty. The reporter's library.json had both. Only the page's
  own write (changeInstructions) takes parts back; a text still held
  with one agent unticked takes back as before (TestWSLStoppedInstructions).
- An automatic write never removes a whole instructions file; it empties
  it in place. The page's write keeps the removal, with the backup first.
- A set's or an agent's extra text that is there but can't be read
  (readText swallowed the error) is a Problem, never an empty text: an
  unreadable set file no longer cuts parts down, on the page's writes too.

Siblings left: syncMCP, syncHooks, syncSkills and syncSubagents take back
by Applied record what magpie wrote (config entries and links that the
library and market can give again, not prose), and a library reset that
loses their lists loses those records too. The sync chain (an empty part
coming down from another computer) is #5642's commit.

Ported from ggbdpq's patch on the issue, with the guard widened from
"no shared text" to "no agent ticked or no shared text" and the
unreadable-text check added.

Run:
- New tests in internal/library/empty_library_test.go, all red on the
  old instructions.go/sync.go (part cut to the user's own lines, or
  "deleted whole by the apply"), green after:
  TestEmptyLibraryApplyLeavesAgentsFilesAlone,
  TestEmptyTextApplyLeavesTickedFilesAlone,
  TestApplySaysWhyItLeftAPartAlone,
  TestUntickedLibraryApplyLeavesFilesAlone (agents unticked, text kept:
  red under the original patch's guard too; the page's untick still
  takes back), TestUnreadableTextLeavesFilesAlone (set file mode 000).
- go test -tags nogui ./internal/davsync/ ./internal/library/ on mote.
- gofmt -l on the changed files: nothing.

Not tried: the reporter's v0.1.3327 upgrade that emptied the index.

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

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

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

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

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

Not run: the full go test ./... suite. mote's suite lock had a queue
waiting up to 16h, so this change ran the packages it touches.
No real GitHub install either: the tests use a fake tarball server. Not
tried on Windows or Linux. The market's had-check (haveSkill) is
unchanged: a market skill with a folder copy by that name still counts
as had.
2026-11-09 11:29:51 +08:00
yetone 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 56f0956044 codex: switching Codex off gives a relay's table its own base_url back
Switching Codex off on the Agents page left a provider table of the
user's own (a relay, not CC Switch's) pointed at magpie's gateway, and
forgot the relay's URL for good. takeTables points such a table at
magpie while a Codex thread names it, and keeps its base_url in the
stash (codex.tables). bringOver then moves that thread onto magpie, so
by the Disconnect no thread names the table any more: giveTables asked
ccSwitchTables for the tables on magpie, which skips a table no thread
names, put nothing back, and dropped the stash. Codex was left on the
user's provider again, with that provider sending to 127.0.0.1:3425.
giveTables now reads each stashed table as it is and puts the URL back
where it still says magpie's; one the user changed since stays.

The report ("all of Codex's configuration was reset to defaults" after
the switch and a Codex restart) is not reproduced as such: every other
line of a full config.toml survives the Disconnect, an edit made while
connected too, in each auth and provider case. The new test is the
guard for all of it. TestCodexOffKeepsAppsOwnConfig guards the other
writer the switch sets off (agent.Rewired starts the library's Sync,
which gives Codex its MCP servers one way on magpie and another off it):
what the Codex app writes for its browser, Chrome and computer use
(plugins, marketplaces, node_repl with its env table and env_vars, a
server kept off, shell_environment_policy.set, [desktop]) stays through
on and off, node_repl imported into the library or not. It passed on the
old code too.

Run (mote, then the Linux box once mote's disk filled up): go test -run TestCodexOffKeepsUsersConfig ./internal/agent
(10 subtests: ChatGPT, API key, no auth, relay, relay + ChatGPT, each
with and without an edit while connected), go test -run Codex
./internal/agent ok 37s, go vet for darwin, linux and windows; on Linux (wsl-run) go test -run
'TestCodexOffKeepsAppsOwnConfig|TestRunCodexEntry|TestRunDirectServerIsCodexsCommand'
./internal/library and TestCodexOffKeepsUsersConfig ok, go vet for all
three systems of internal/agent and internal/library. The
config.toml each subtest leaves was loaded by the real Codex CLI
0.164.0-alpha.11.1 (codex mcp list, sandbox CODEX_HOME): all ten load
and list the user's MCP servers.
Broken by hand: the old giveTables back, the four relay subtests go red
with "lost base_url = https://relay.example.com/v1".
Not tried: the Codex app (ChatGPT.app) itself switched off and
restarted; the reporter's own config, version and OS (not known).

Reported-by: darwish4021 (Discord)
2026-11-07 20:57:30 +08:00
yetone 922cc0ccf8 library: a plugin's tools hidden from every agent from its Plugins row
chengming0v0 (Discord) keeps a plugin for its providers but doesn't want
the MCP server it brings (minimax_query_video_generation and the rest)
shown to agents, and doesn't want to remove the plugin.

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

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

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

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

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

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

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

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

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

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

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

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

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

Reported-by: NEKO-CwC
2026-11-07 20:14:25 +08:00
yetone e932cd2589 library: a program whose path has spaces, typed as it is, is that program (zachzhao1984)
Library → MCP's command field splits a line at each unquoted space, as a
shell does, so "/Applications/Agent HUD.app/Contents/MacOS/Agent HUD --mcp"
reached the library as the program /Applications/Agent with the arguments
HUD.app/Contents/MacOS/Agent, HUD and --mcp. The save itself went through;
what was saved and written into every agent's config was a program that
isn't there, so the server never started. `magpie mcp add` with an
unquoted path and the TUI's line (strings.Fields) split it the same way.

Server.check, which every way in passes (the GUI's save, `magpie mcp add`,
the TUI, a market install, a backup or sync read in), now joins the words
back: when the command is a full path to no file, and it with the words
after it, joined by a space, is a program on this computer (a regular
file, executable outside Windows), that is the program and the rest are
its arguments; the fewest words that make one, as Windows reads an
unquoted path. A command that is there, a bare name (npx -y foo), or a
path no join makes stay as typed. Each agent is then given the program as
one argument with its spaces (JSON's and TOML's own quoting), and the GUI
shows it quoted ('/Applications/…/Agent HUD' --mcp), which reads back as
one word. A path typed in quotes, or with \ before its spaces, was already
one word. A server saved split before stays so until it is saved again:
opened and saved, its line is joined.

Tests:
- internal/library TestSpacedProgram: split, no arguments, given whole,
  a bare name, a path no join makes, a program that is there keeps its
  next word, a folder is no program.
- TestSpacedProgramSaved: ServerOf from the split words, SaveServer, the
  library and Claude Code's .claude.json and Codex's config.toml each
  hold the program whole and --mcp.
- internal/gui/tests/library-mcp-spaced-path.test.cjs: the reporter's
  line typed in a new server's dialog is sent as typed; the row and the
  editor show the path quoted; saving unchanged sends it whole; a quoted
  path is sent whole; a save the library refuses (a name with a space)
  shows its reason and the dialog stays. en and zh, 1100 and 390 wide,
  Chromium and WebKit, nothing scrolls sideways. The fake save stands in
  for the Go join.

Run (mote, via mote-run, at this tree on 30ae0e3f9):
- go test -count=1 ./internal/library ./internal/cli ./internal/tui: ok.
- go vet (library, cli, tui), GOOS=linux go vet -tags nogui and
  GOOS=windows go vet ./internal/library, go build ./..., GOOS=linux
  go build -tags nogui ./..., GOOS=windows go build ./...: ok. gofmt -l:
  nothing.
- win-run go test -run TestSpacedProgram ./internal/library (Windows 11):
  ok.
- node --test library-mcp-spaced-path: 10 of 10, four runs in a row.
  library-mcp-win-line, library-mcp-json, mcp-local-server: ok.
  i18n-keys "a plugin's words are its own" is red, the same three lines
  on a clean origin/main 30ae0e3f9 copy (filed: #5332, #5426, #5482);
  this change adds no strings.

Broken by hand:
- the spacedProgram call in check() commented out: TestSpacedProgramSaved
  FAIL, the library has Command .../Agent and Args [HUD.app/Contents/
  MacOS/Agent HUD --mcp].
- quote() taking a space as safe: library-mcp-spaced-path 0 of 10, the
  editor shows the line unquoted.
- The GUI test first flaked 2 of 10: a new dialog focuses its name a
  frame after it opens, and a command typed sooner landed in the name.
  The test waits for that focus now.

Not tried: the real Agent HUD app (not installed here), nor a real agent
starting the saved server; a program path with spaces given to an agent
in WSL (the join stats this computer's files, so a Linux path typed for a
distro is left as typed); the full go suite before this push (runs after,
under the lock).

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

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

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

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

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

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

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

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

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

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

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

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

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

Reported-by: sunset3279 (Discord)
2026-11-06 22:22:20 +08:00