A server listed under Library > MCP servers > "In your agents" could
only be brought into the library. As a found skill can (#1303), it can
now be taken out of every agent that has it, without bringing it in.
- library.RemoveFoundServer(name): every agent the server was found in
has it deleted from its MCP settings by the same per-format code the
library writes with (JSON/JSONC paths, Codex and Grok TOML, Goose and
Hermes YAML, dsh profiles, the Also files and the Extra files an agent
still reads, Pi's old mcp-adapter.json among them). The user's other
keys, comments and servers stay.
- Every file it touches is copied to magpie's backups (res.Backup)
before it is written; a file that doesn't hold the server isn't.
- Every file is read before any is written: one that doesn't parse stops
the removal with nothing changed (a failed read is unknown, not
empty). The file is read back after, and a server still there is an
error, not "removed".
- A server the agent's app puts there itself (Own, e.g. Codex's
node_repl) is refused: taking it out wouldn't last. The GUI doesn't
list those, and the TUI says so.
- An agent with a different server by that name (Others) is left alone.
- GUI: a trash beside Bring in asks first, naming the agents, that each
file goes to the backups and that the other server by that name stays;
posts servers/remove-found. Strings in zh, zh-TW, ja, de.
- TUI: d twice on a found-mcp row, as on a found skill.
What was run:
- go test ./internal/library ./internal/tui ./internal/gui (sandbox
HOME). New tests: TestRemoveFoundServer (Claude/Codex/OpenCode files
with user keys, comments and other servers that must survive; Gemini
with a different one and an unparseable Cursor file left
byte-identical), ...Unreadable, ...Own, ...EveryAgent (claude, codex,
gemini, opencode, mimocode, pi, goose, cursor, copilot, crush, dsh),
TestRemoveFoundEntryEveryFormat (every format, with backups),
TestRemoveFoundEntryPiExtra; tui's d-twice found-mcp case keeps the
rest of .claude.json.
- Broken by hand, each went red: no backup, Extra file skipped, Extra
unreadable read as empty (mcp.json must stay unwritten), no delete,
Own allowed; GUI trash posting without the confirm. The main file
unreadable read as empty stays green on purpose: nothing is written
and the read-back still refuses.
- GUI: remove-found-server.test.cjs (new), remove-found-skill,
i18n-keys, every library-*.test.cjs, view-no-sideways, mobile-web,
by-agent in Chromium and WebKit. library-mcp-tool-switch fails in
WebKit with or without this change, and also when run alone (#1609);
it has no found servers.
- gofmt -l; GOOS=linux and GOOS=windows go vet -tags nogui on the three
packages.
Not tried against a real agent's live config.
Until now the only action on such a row was Bring in: removing it meant
bringing it in and then removing it from the library. RemoveFoundSkill
(skills/remove-found) takes out of each agent that has it its folder, or
its copy of the very same files, and its links; its entry in the shared
~/.agents/skills, which agents read too, and a folder of it in the
library's own folder go as well. Nothing is deleted: folders go to the
backups (setAside), links are taken away, and a folder elsewhere that the
agents only linked to stays where it is. Another skill by that name
(Others) is a different skill and stays. The page asks first and says
which agents it leaves and what stays.
TestRemoveFoundSkill (library), TestLibraryPage's new part (TUI) and
remove-found-skill.test.cjs (GUI) fail without the change. The GUI test
fails 4 of 4 with library.js from before it, and passes in Chromium and
WebKit, in en, zh, ja and de, and at 440px wide.
Run: go test -tags nogui ./internal/library ./internal/tui ./internal/gui,
and go vet for linux, windows and darwin with -tags nogui, in Docker
(golang:1.26.8, a temporary HOME). The Mac's syspolicyd held test binaries
at launch. On the Mac, in Chromium and WebKit: remove-found-skill, gui-ja,
gui-de, i18n-keys, import-all-skills, own-skill, shared-skills,
library-own-folder, library-items, remove-all-skills,
library-desktop-skills, skill-name-many-agents and mobile-web, 133 of 133.
In one earlier run of that set at load ~40, mobile-web's WebKit "idle
scripts cannot scroll" failed once. It passed 3 of 3 alone with this
change, and passed in the full rerun. Not tried: the reporter's own agents,
and a WSL agent's folder.
Init set m.syncing on its value receiver, a copy Bubble Tea never sees
(staticcheck SA4005), so the sync ran with nothing on the status line and
S could start another on top of it. newModel now sets syncing when there
is no catalog, and Init starts the sync from it.
TestFirstRunShowsCatalogSync is new and fails without the change. go vet
(darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui
./internal/tui under a temp HOME pass.
* test: a sandbox keeps Qoder's own folder out, so no test reads the sessions of whoever's machine it runs on — QoderDir takes $QODER_CONFIG_DIR, else $QODERCN_CONFIG_DIR, before ~/.qoder and ~/.qoder-cn (internal/sessions/qoder.go:19), so a test that faked a home through HOME and USERPROFILE still listed the developer's real Qoder and Qoder CN sessions, and one that asked which agents an environment with nothing in it shows found two. Qoder's CLI sets both for every child it starts, and magpie manages Qoder, so writing magpie from inside Qoder is a likely way to run its tests: five failed here, with a real conversation's titles in the output. sessions' setupCalls, the tui's home and the agent package's TestMain unset Claude Code's, Codex's, DSH's, Pi's, omp's, Cline's and WorkBuddy's folders already, and the library's list has Qoder's two (library_test.go:41); these three did not. TestSessionsPage, TestSessionsList, TestSamePrefixRewriteWithGrowth, TestCallsConcurrentWithSessionReaders and TestUnsetAgentsReadEmpty fail without the change on a machine with the variables set, and pass with them and without. go vet, go test -count=1 ./internal/tui/ ./internal/sessions/ pass; in internal/agent, TestSuffixModesReachAgentFiles fails on this Windows box with and without the change (another matter, not touched here), and TestWSLProbeScriptSaysWhere fails only under a POSIX-style PATH such as git-bash gives its children, and passes under a native Windows one. Twelve more sandboxes unset the other agents' folders without Qoder's (backup, davsync, profile, gui/backup, eight in provider, gateway/claude_warmup, webdav_cli); no test of theirs reads a Qoder folder today, so none is changed here.
* test: the CLI's sessions sandbox keeps Qoder's folder out too (yetone, reviewing: 还漏了一处:根包 sessions_cli_test.go 的 sessionsHome 同样只清了别的 agent) — sessionsHome unset every other agent's folder without Qoder's two, so with QODER_CONFIG_DIR or QODERCN_CONFIG_DIR naming a Qoder folder that has sessions in it, `magpie sessions` listed the developer's own Qoder and Qoder CN sessions beside the fixture's, and TestSessionsCmd failed on what it saw. Both are unset now, as the tui's home, sessions' setupCalls and the agent package's TestMain unset them. The agent package's is the weightier of the two, since what TestDriftUnwiredEveryAgent (internal/agent/applied_test.go:123) does with a folder it is pointed at is not read it but write it: wiring every agent it can through the gateway, it put magpie/fake/m1, the key magpie-qoder-cn and http://127.0.0.1:3425/v1 into that folder's settings.json — a developer's own Qoder, not a fixture. Measured both ways, the variables naming a folder of their own: on main the folder holds a settings.json afterwards, with the unset it holds nothing. TestSessionsCmd fails without the change and passes with it; the root package's suite passes with the variables naming a folder that has sessions in it, and with them unset. go vet, go test -count=1 . pass.