f2eb56c6bbde1300dddc402861b59cd4e45e0215
240
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b78b1de003 |
library: magpie-image is behind the MCP hub, saving into the calling agent's project
magpie-image was the one MCP server the hub left out, because it saves what it makes on disk and needs to know whose project that is. The hub now serves its tools like any other server's and tells it where the caller works: 1. the hub answers a tools/call as SSE and asks the agent roots/list on that stream (3s), as Claude Code answers; 2. else Codex's _meta x-codex-turn-metadata.workspaces (git repos only); 3. else the Codex thread's cwd from its session file (sessions.CodexThreadCwd), only with session consent; 4. else none, and the image goes to ~/Pictures/Magpie as before. The hub passes `magpie/roots` and `magpie/client` in the call's _meta; imagemcp saves into the first root and names the agent on its usage row. Its result carries `magpie/model`, which the hub's own usage row takes, so the row says which image model drew it. A WSL agent keeps magpie-image as its own entry (the hub can't reach a path inside the distro). docs/subsystems/mcp-hub.md (mcp-router.md after the next commit), gateway-routing.md and gateway-sessions.md say so. It is rebased on #4382 ( |
||
|
|
50816ce024 |
library: turning RTK off matches the hook Claude's settings actually holds (#2879)
What changed: taking RTK out of Claude Code now drops its hook entries
from hooks.PostToolUse and hooks.SessionStart in ~/.claude/settings.json
beside hooks.PreToolUse, matching the same "rtk hook claude" mark.
Why: magpie says Claude Code has RTK by searching the settings file
whole for "rtk hook claude", but its remover only looked under
hooks.PreToolUse. rtk 1.0.1's installer writes that command under
hooks.PostToolUse too, when the user's rtk pipeline has after_tool rules
(rtk:posthook; src/hooks/init/claude.rs), and rtk's own uninstaller
sweeps PreToolUse, PostToolUse and SessionStart alike. With an entry
under another event, switching RTK off in the Library removed the
PreToolUse entry, found the command still in the file, and failed with
"rtk's hook is still in Claude" — the reported bug: the row stayed on
and the hook had to be taken out by hand. The user's own hooks under
those events are kept, as the PreToolUse ones already were.
Run: go test ./internal/library/ (ok, 75.6s); the new
TestRTKRemoveClaudeOtherEvents fails on the base with "rtk's hook is
still in Claude Code" and passes with the fix; gofmt -l clean; go vet
clean on darwin, linux and windows; the package builds on all three.
Review (magpie): checked against rtk v1.0.1's own claude.rs, which
writes and sweeps PreToolUse, PostToolUse and SessionStart; the other
agents' single key is unchanged. Run on the Mac mini: go test
./internal/library -count=1 ok; TestRTK* on the Windows box ok. Broken
by hand: rtk.go at the base - TestRTKRemoveClaudeOtherEvents red
("rtk's hook is still in Claude Code"). Not tried: the reporter's ask
to roll the switch back in the UI when a removal fails.
Generated-by: GLM-5.3-Flash (ZCode)
|
||
|
|
b889ffe813 |
library: a server can stay each agent's own entry with the MCP hub on (#4382)
cuipengcx90's #4382, Option A's first step (nifengfanpan asked on Discord): with the MCP hub on, every Library server went behind magpie's one entry, so a server that reads its project from the folder it starts in, or keeps a session's state, resolved the wrong repository or shared state across agents. A server now has a hub policy, Server.Hub ("hub" in library.json): "" (shared, the default, so nothing changes for existing users; "shared" is saved as "") or "direct". A direct server is left out of the hub through inHub, the test that already keeps magpie's own image server out, so each agent given it keeps its own entry written as with the hub off, beside the hub's entry for the rest. An agent whose every server is direct gets no hub entry. The hub neither lists nor runs a direct server, at /mcp/magpie/hub either, and hubPrune ends one it held. Switching goes through change(), so the agents are written again at once and the entry from the other policy is removed. An unknown policy is an error. - GUI: with the hub on, the server editor has a "Through the MCP hub" switch (role=switch, not a <select>; not shown with the hub off or for the image server), a direct server's row has a "Not through the hub" tag, and the hub's line and the Connect sheet name the direct servers with the image server as given directly. Strings are in zh, zh-TW, ja and de ("MCP 聚合" as the core uses it). - CLI: magpie library mcp hub <name> shared|direct (ServerHub), and magpie library marks a direct server. - TUI: an edit keeps the policy. - Not done: Option B (per-roots/project backends behind the hub, keying hubPool by roots). It is left for later; #4382 stays open for it. Run: - TestHubDirectServer (internal/library) and the extended TestLibraryMCPHub (internal/cli) on mote. Broken by hand: inHub back to !isSelf(s) makes TestHubDirectServer red ("codex with the hub on: [magpie], want [index magpie]"). - Real configs in a sandbox HOME on mote (fake claude on PATH, the real binary built from this tree): mcp add index + web for claude and codex, hub on, hub index direct, shared, then both direct. The direct index entry was in .claude.json and .codex/config.toml beside magpie's; with every server direct both files were byte-for-byte as with the hub off (json.tool diff and diff); shared again removed the index entry. - Full Go suite (-tags nogui -timeout 45m ./...) on mote at this tree rebased on origin/main |
||
|
|
2f65a33aaf |
library: a tools plugin is a Library server of its own, in the MCP hub (Search1API)
chenxiang0010 (Discord #general) asked for a tools plugin's tools, Search1API's (@magpie-community/tools-search1api), to be in magpie's aggregated MCP server. Until now plugin tools were served only at /mcp/magpie/tools, wired by hand; the hub listed Library servers only. Now each plugin that is on and gives tools becomes a Library server once the plugin host has noted its tools (plugin-tools.json, new plugin.ToolsNoted): - named by the plugin's short name (search1api, search1api-plugin beside a user's server of that name), `plugin` set, `local`, its URL the new /mcp/magpie/tools/<short> (gateway ToolsMCPOne), which serves that plugin's tools alone by their own names; - added with the hub on, it is on for the agents given the hub's entry, so their hub lists search1api__search etc. at once; with the hub off it is on for none until switched on. Per agent and per tool it is switched like any server; - the hub lists and runs its tools in process (gateway.PluginToolsOf, RunPluginToolOf, under the Plugin tools gate); with the hub off an agent is given the per-plugin URL at the address it reaches the gateway (through), with a key from another machine; - offered once (pluginsOffered): removed by the user, it comes back only when the plugin is removed and added again. The plugin removed takes the server out; turned off it stays and lists nothing; an unreadable plugins.json changes nothing (plugin.ReadList). Edited in the Library's editor, which doesn't send `plugin`, it stays the plugin's. Docs: docs/subsystems/plugin-tools.md, mcp-hub.md, site docs plugins (en, zh, ja). Run (mote; full suite at this change on origin/main |
||
|
|
48edbcb674 |
library: RTK covers Droid, and lists Qoder, Cline and Kimi Code with why
lml0664 on Discord: Library > RTK offered a fixed few agents, even on the
latest magpie. RTK 1.1.0 (rtk-ai/rtk, Latest, 2026-10-25) has `rtk init`
agents claude, cursor, trae, windsurf, cline, kilocode, antigravity, kimi,
pi, hermes, droid, vibe, omp, plus --codex/--gemini/--opencode/--copilot.
Every one with a global hook that magpie has an agent for was already on
the page except Factory's Droid, which is added now:
- droid: rtk's own `rtk init -g --agent droid`, given Droid's folder as
FACTORY_HOME_OVERRIDE (magpie's droid agent honours it). rtk writes its
Execute group (`rtk hook droid`) into the root hooks.json, or into
settings.json's hooks.PreToolUse when Droid's hooks already live there
(src/hooks/init/droid.rs), so ReadRTK and switching off look at all
three files rtk may use (hooks.json, hooks/hooks.json, settings.json)
and leave the user's own hooks and settings. rtk before 0.44 has no
Droid agent, so it is blocked with "needs RTK 0.44 or newer".
- dropHook no longer slices key[:-1] for a top-level key (hooks.json's
"PreToolUse"); before, it would have panicked.
Listed with the switch off and their own reason (rtkNoHook and the page's
rtkNoHookWhy, in zh, zh-TW, ja and de too):
- Qoder, Qoder CN: rtk 1.1.0 has no Qoder agent (`--agent qoder` is an
invalid value), rtk-ai/rtk#1327 (PR #1721 open).
- Cline: `rtk init --agent cline` only writes a .clinerules in the
current project asking the model to type rtk, no hook (#3841).
- Kimi Code: Kimi's hooks can't rewrite a command; rtk writes only one
project's AGENTS.md and refuses -g ("Kimi AI is project-scoped").
RTK's Trae, Windsurf, Kilo Code and Mistral Vibe have no magpie agent.
Run:
- go test -tags nogui ./internal/library -run TestRTK on mote: ok
(TestRTKDroid home/override, TestRTKDroidSettingsHooks,
TestRTKNoHookQoderClineKimi new, sandbox HOME, fake rtk).
- Red on old code: rtk.go at HEAD^ -> TestRTKDroid, ...SettingsHooks and
...NoHookQoderClineKimi red. Broken by hand: version gate at 0.43, the
settings.json entry dropped -> red; FACTORY_HOME_OVERRIDE not passed ->
TestRTKDroid/home red. client.js at HEAD^ -> library-rtk-nohook red
(Qoder's reason was the generic one).
- Real rtk 1.1.0 (release tarball, sha256 checked against checksums.txt)
on mote in a sandbox HOME through SetRTK/ReadRTK: plain ~/.factory,
settings.json with the user's own Execute hook (kept, rtk's taken out)
and FACTORY_HOME_OVERRIDE: on, seen on, off, seen off. Real rtk also
refuses --agent qoder and -g --agent kimi, and cline writes .clinerules.
- Full suite on mote, go test -count=1 -timeout 45m ./...: 80 packages
ok; internal/gui red only in its 10 real-window AppKit tests (#4125).
- GOOS=linux and GOOS=windows go vet ./internal/library: ok. gofmt clean.
- GUI on the WSL box (mote's browsers crash at launch, #4125):
library-rtk-nohook (chromium+webkit, en+zh) and i18n-keys 10/10; all 45
library-*.test.cjs files 810/824, the 14 reds (library-chip-fan webkit,
library-items webkit, library-mcp-tools chromium ja 420) are the same
at origin/main
|
||
|
|
497100488a |
provider, library: a .git is a repository only when git takes it for one (#3675)
TestPluginToldWhereTheAgentWorks was red on any machine with an empty .git above its temp folder. GitOnDisk took the first .git it met going up as a repository, and on this box /tmp/.git is an empty folder (owned by nobody), so every folder under /tmp read "yes". git passes such a folder over and goes on up: git rev-parse under it says "not a git repository". GitOnDisk now reads each .git on the way as git's own search does (repo_discovery_find_dir in git 2.56's setup.c), through GitAt: - A folder counts when git takes it for a repository (is_git_directory): a HEAD git takes (a link into refs/, "ref: refs/...", or a commit's id), and objects and refs folders, in the folder its commondir names for a linked worktree. Any other folder, an empty one say, is passed over and the walk goes on up. - A file counts when it is "gitdir: <folder>" naming such a folder, relative to the .git's own folder (a linked worktree's, a submodule's). Any other file, one over git's 1 MB, or one that is neither file nor folder is "no": git stops there with "not a git repository" (a worktree whose repository has gone) or "invalid gitfile format". (git 2.34 passed a .git that is neither file nor folder over; 2.55 and 2.56, CI's, stop at it.) - A .git it can't read is unknown, and the header is left off. git passes such a folder over and stops at such a file, but either way it can't tell an empty .git from a repository it isn't let into (another user's, through a shared magpie), and a failed read is unknown here. A bare repository kept as a folder's .git (git init --bare .git) is still "yes": git finds one there, though no work tree. Not mirrored: the filesystem boundary, GIT_CEILING_DIRECTORIES and safe.directory's ownership check. Cost: the same one stat per folder on the way up; at a .git, a read of HEAD (255 bytes at most) and stats of commondir, objects and refs. What a user sees: a request to a plugin provider from an agent that doesn't say whether its folder is a repository (Codex, Pi) was told "yes" for a project under a stray empty .git, under a worktree whose repository was deleted, or under a .git file that names nothing. The community ZCode plugin then tells the model "- <git label>: yes" and Command Code's sends isGitRepo: true, so the model may run git commands that fail with "not a git repository". They are now told "no", and with a .git on the way magpie can't read, nothing (ZCode's plugin leaves the line out, Command Code's sends false). Claude Code's and OpenCode's requests say it themselves and are passed on as they say it, so nothing changes for them; Claude Code 2.1.310's own check takes any .git, an empty one too. The only caller of GitOnDisk is tellWorkPlace (workdir.go), which needs no change. The library's skill groups had the same first-.git walk: gitRepoOf took the first .git within four folders of a linked skill for its checkout, so an empty one between a skill and its clone left the skill in no group, and gave one imported from there no From. gitRepoOf now asks provider.GitAt, passes such a .git over to the clone's, and reads the origin from the folder GitAt names (a linked worktree's common one), which replaces gitdirConfig. gitdirConfig also took "gitdir:" with no space after it, or with spaces around the line, which git doesn't take; such a .git now traces to nothing, as git finds nothing there. Checkouts git made are traced as before; the test's fake ones had only a config and now have a HEAD, objects and refs. Every other .git folder in the Go code is one a walk skips when it copies, hashes or checks a skill (carry.go, skillcheck.go, skills.go, skill_edits.go), or the one magpie removes from its own fetch of a skill (skillgit.go), not a decision about a repository. The Claude bridge's claudeWorkDir takes the temp folder for one in no repository; Claude Code decides that for itself, and its git status is off for every run (CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS), so it stays. TestPluginToldWhereTheAgentWorks gets a real repository for "in a repository" (HEAD, objects, refs; an empty .git was all it had) and a case under an empty .git in its own temp folder, so it fails without this on any machine. Its "not in one" cases, and the new provider tests' "no" ones, still need no repository above the temp folder, as the test did before. TestGitOnDiskIsWhatGitFinds lays out each kind of .git by hand; TestGitOnDiskAgreesWithGit asks git rev-parse --git-common-dir in each of those folders and in ones git made (init, worktree add, a worktree whose record was removed, --separate-git-dir, init --bare .git), for yes or no and where; TestGitOnDiskUnreadIsUnknown locks a .git folder and a worktree's .git file. provider-plugins.md and library.md say the same. What was run (tree 9a4504d9, on origin/main |
||
|
|
969868ccda |
library: a Python MCP server in a GitHub repository's folder is found and added filled in (CyberCaius on Discord)
CyberCaius pasted https://github.com/volcengine/mcp-server#subdirectory=server/mcp_server_askecho_search_infinity (Volcengine's askecho web search) into the Library's MCP search. The fragment was dropped, the MCP Registry was asked for "mcp-server" and "volcengine", nothing it lists is there, so the page offered only a blank command named "server". A GitHub address naming a folder (#subdirectory=, /tree/<ref>/…, /blob/<ref>/…/file) is now read before the registry: the folder's pyproject.toml names the program ([project.scripts]) and its README's "env": {…} examples the keys. It is offered as a normal market card: uvx --from git+https://github.com/o/r[@ref]#subdirectory=<path> <program>, with the keys asked for in the install sheet. Of several keys none is required (askecho takes an API key, or an access key and secret); one alone is. A bare repository is read that way only when the registry has nothing at it. A pypi.org/project/ page, or a one-word search naming mcp (with - _ or .) that the registry lists nothing by, asks PyPI's JSON API and offers uvx <package> with its description's keys. Claude Desktop is already wired for local Library servers (claude_desktop_config.json); the test installs it there. Run (mote): - go test ./internal/library -run 'TestMarket|TestParseRepoAt|TestEnvInputs': ok - go test ./internal/library rebased on |
||
|
|
d05482bab3 |
library: AnySearch in the market (lileo on Discord)
lileo asked for the AnySearch MCP. From AnySearch's own repo (github.com/anysearch-ai/anysearch-mcp-server, README): remote Streamable HTTP at https://api.anysearch.com/mcp; the key is optional (anonymous use has a lower rate limit), sent as Authorization: Bearer as_sk_..., and made at anysearch.com/console/api-keys. Like Exa, a remote entry with an optional secret header; the icon is the anysearch-ai GitHub account and the docs link the repo. Its examples also send X-Anysearch-Client; tools/list answers without it, so it isn't added. Probed by hand from mote (not in a test): initialize 200, serverInfo anysearch-mcp-server 1.0.0, protocol 2025-06-18; tools/list gives batch_search, extract, get_sub_domains, score, search. Run at this commit after the last rebase (on |
||
|
|
d6284bf8a0 |
library: a skill's installed dependencies are no change of the user's
ggbr on Discord (#help): easyeda/easyeda-api-skill says to run
`npm install` in its own folder. Once that ran, the Library tagged the
skill Changed here (本地已改动). The check for updates still ran on it
(it compares commits, not the folder), but Update all left it out as
changed, and its own Update asked to replace "your changes" and threw
node_modules away with the old version, so the user had to install again.
Cause: editState compared the hash of the whole library folder (only
.DS_Store left out) with Hash, the hash of the files as fetched. The
install's node_modules and its rewrite of package-lock.json made them
differ.
Now what installing dependencies or running the skill writes is not a
change (fromInstall): node_modules, .venv, venv, __pycache__,
.pytest_cache, .mypy_cache, .ruff_cache, *.pyc/*.pyo, and the lock files
package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lock(b), uv.lock.
- New Skill.Own: the hash of the files as fetched without those, set on
install, update and when skill_from binds a skill to its repo.
onlyInstalled compares the folder with it first.
- An agent's copy (copy mode) counts as edited only when its ownHash
differs from the library's.
- An update carries those entries from the version replaced into the new
one wherever the new one has no entry of its own (carryInstalled). The
new version's own lock file wins.
A file the user really edited (run.py, SKILL.md, package.json, ...) still
marks the skill changed and is never overwritten without asking. An edit
to a lock file alone is no longer protected; an update takes upstream's.
Skills already marked changed: they clear on their own on the next page
read when only installed folders and bytecode differ, or the lock file the
skill came with was left byte-for-byte (compared with Hash, leaving
installed folders aside). A skill fetched before this commit whose lock
file the install did rewrite has no Own, so it stays marked until its
next update (Update on its row asks once, keeps the old folder in the
backups, carries node_modules over and records Own). From then on, a
rewritten lock file isn't counted.
Run (mote, worktree at
|
||
|
|
4054251865 |
library: an MCP server can be kept to this computer, never synced
huhuy72219405 on X: "能不能把不同设备的mcp区分一下,有些mcp属于本地的, 同步之后其他设备不应该读取到". A server in Library > MCP now has a "This computer only" switch in its editor (Server.Local; CLI `magpie library mcp add ... --local` and `magpie library mcp local <name> on|off`; the TUI keeps it on edit and marks the row). - Collect leaves local servers out (carriedServers), so neither a sync nor a backup file takes one to another computer. Turning a shared server local takes it out of what is carried, so the other computers drop it at their next sync; the flag itself is never carried. - Put (sync, join, Restore, Undo, backup file) keeps every local server, with its agents, and clears Local on what comes in. - Another computer's server by a local server's name goes to Library.Away: given to no agent, not in the hub, carried on as it came, so a push from here never removes it from the computers that have it. settleAway (every change) promotes it once the name is gone here, and drops it once the name is shared here again. - The hub serves local servers like any other (it runs here); subagents aren't carried, so one naming a local server keeps it. Docs: docs/subsystems/library.md, docs/subsystems/sync-backup.md. Run at |
||
|
|
3ce2a9819f |
library: RTK for agents in WSL, with the distro's own rtk (lex on Discord)
lex: Claude Code and other agents in WSL couldn't use the RTK of magpie
on Windows. rtkAgents looked an agent up in rtkSpecs by its whole id, so
claude@wsl:Ubuntu never matched and WSL agents weren't on the RTK page at
all. Even matched, the specs read this machine's home, and Windows' rtk.exe
is no command inside the distro, where the hook runs.
Now an agent is looked up by its kind (rtkKind). One in WSL:
- has its files read and written under the distro's home as magpie opens
it (rtkClaudeDir, rtkCodexDir, rtkHome), with blocked/version checks
against the distro's rtk and OpenCode;
- uses the distro's own rtk: rtkDistroOf asks the distro (wsl.exe -d <d>
-e sh -lc) where rtk is on its shells' PATH, else in ~/.local/bin or
~/.cargo/bin (offPath), kept 15s; ReadRTK lists one RTKDistro per distro;
- switching on runs that rtk there (rtk init -g ..., its folder on PATH);
- Install RTK in WSL <distro> (POST /api/library/rtk/install {distro},
magpie library rtk install <distro>) runs RTK's own Linux installer in
the distro (curl, or wget).
A distro that isn't running is never started (#3896): its agents are
listed asleep with the switch off, and switching or installing says to
start it. The page has a card per distro (install, off-PATH, asleep) and
uses the distro's rtk for each WSL row's tags and switch; strings in zh,
zh-TW, ja and de. The install route now refuses a body it can't read
instead of installing on this computer.
Run:
- mote (macOS 27), at origin/main
|
||
|
|
c1da9ccda3 |
library: a stopped WSL distro's agents are listed, and a tick for one is written there once it runs (cybercaius on Discord)
cybercaius: with WSL not started, the Library's MCP page didn't list the agents in the distro at all, and nothing ticked for them could be kept. A stopped distro's agents are no targets (#3896: opening their files starts the distro), so they fell off the page. While a distro runs, each agent's places and what its MCP file takes are kept in wsl.json (keepShape, agent.WSLKeep, key library:<kind>). While it is stopped, Read lists its agents from that (asleepView, asleep: <distro>) with the library's ticks; one magpie never saw is listed only on rows that name it, as unseen, its chip disabled and kept by every click (keptOf). A tick on a stopped agent is kept in library.json (Takes accepts a known shape, serversAgents judges it by shape.reaches); nothing is opened or run in the distro. Woken, from KeepLinked's 30s loop, syncs once a distro the library names goes from stopped to running (wsl.exe -l --running starts nothing). The page greys a stopped agent's chip and says why in its tooltip and one line per distro; the MCP hub leaves them out. The CLI says the same on stderr (AsleepIn). en, zh, zh-TW, ja, de. Run at this tree (20695ad8b before this message; on |
||
|
|
da8039368f |
library: skills kept in ~/.agents/skills can be handed over to the library, and then turned off per agent
tnt1223 on Discord asked for the skills in ~/.agents/skills to move into
magpie's library folder and be managed there ("统一移入 magpie 的资源库文件
夹,交给 magpie 管理"), since a skill there can't be turned off for one agent
("不能决定某个 skill 是否自由开启"). Codex, Gemini CLI and the other readers
of that folder read it themselves, whatever the library ticks. Goose, Kimi
Code and Cindy use it as their own folder.
HandOverSkills (POST /api/library/skills/hand-over with names) does the
hand-over only when the user asks for it:
- A folder kept in ~/.agents/skills moves into library/skills/<name>
(moveIn). It is renamed, or, across disks, copied. A copy has to read
back the same (sameTree) before the original is set aside with the
backups. On any failure the folder stays where it was and the library's
link stays as it was.
- An entry there that only links to a folder elsewhere is removed, and
the library links straight to that folder. The folder itself stays.
- The user's own links to the skill in agents' folders are removed too,
since they would point at nothing. The library gives those agents its
own link.
- Every agent here that read the skill there (readsSharedHere, plus the
agent of each such link) is ticked. So each agent keeps the skill, now
from the library, until the user unticks it or turns it off here.
- A skill found there that isn't in the library yet is imported first.
- A name that can't be handed over is listed in Result.Unmoved, and the
other names are handed over all the same.
HandBackSkill moves the folder back and links the library to it again.
"Kept there" is now sharedEntry: the skill's own entry in the shared
folder, by its name, or, for a library link into it under another
folder's name, by that folder's name. Everything that read the old
by-name check follows it:
- SkillView.Always, plus the new Shared and SharedElsewhere fields;
- syncSkills' in-shared check;
- the shared folder's own target, which no longer gets a second link
beside such an entry. TestSharedUnderAnotherName covers this, and it
fails without the guard.
Where:
- GUI, Library > Skills: a row kept there has "Manage in magpie"
("交给 magpie 管理") in its source line. With more than one such row,
the skills heading has "Manage {n} in magpie". Each asks first, in the
page, and says:
- where the folder goes, or that only the link goes;
- which agents keep the skill, ticked;
- how to put it back.
Cancel sends nothing. The strings are in en, zh, zh-TW, ja and de.
- CLI: `magpie library skill hand-over <name…>|--all` and
`magpie library skill hand-back <name>`.
Existing users: nothing changes until they click. A library.json gains
no new key.
Run (mote, at 58e926e5d/d4b7c0586 rebased on
|
||
|
|
033b17bafe |
library: every skill named in another script is listed, under its folder's name
|
||
|
|
f02390544d |
edit: a JSONC delete takes the last member's trailing comma, so the MCP hub never leaves OpenCode's mcp as {,}
chenxiang0010 (Discord #general, Windows): turning the Library's MCP hub on
for OpenCode and off again left a comma at the end of opencode.jsonc's
"mcp", and OpenCode said "opencode.jsonc: invalid"; deleting the comma by
hand fixed it, and a second try didn't reproduce.
Cause: delJSONBytes looked for the deleted member's trailing comma in the
tidwall/jsonc copy, which blanks every comma before a closing bracket.
So when the member was the last one and had a trailing comma (as OpenCode,
editors and users allow), the comma was left behind; when it was the only
member, it was left with nothing before it: "mcp": {\n,\n}. The hub sync
then inserted the magpie entry in front of it ("magpie": {...},\n,) — a
double comma. OpenCode parses with jsonc-parser allowTrailingComma
(packages/opencode/src/config/parse.ts at v1.19.5, packages/core/src/config.ts
on dev): a trailing comma after a value is fine, a lone one is an error.
magpie's own validity check went through the same tidwall copy, so it
passed the broken file. Once the comma was deleted by hand there was no
trailing comma left, which is why it didn't happen again.
- delJSONBytes takes the last member's own trailing comma (nextToken, as
delItem already did for arrays), and its line with trailing blanks.
- insertKey adds no comma after the first member of an object that holds
comments only (it used to, leaving a trailing comma only some apps read).
- edit.ValidJSONC reads JSONC as jsonc-parser with allowTrailingComma does.
SetJSON, DelJSON, PatchJSON, SetJSONItem and DelJSONItem refuse an edit
that would turn a file the app reads into one it can't (checkJSONC):
nothing is written, and the error names the file.
- A lone comma an older magpie left is dropped by the next object edit of
that file (dropLoneCommas), so users already hit are mended by the next
sync that writes it. A file nothing writes again keeps it until then.
Every JSON/JSONC object writer goes through SetJSON/DelJSON/PatchJSON
(library MCP for OpenCode, Zed, VS Code, Claude, etc., agent wiring for
DevEco, MiMo Code, OpenCode, ...), so all of them get it.
Tests (red on the old json.go/jsonarray.go, put back by hand, green now):
- TestHubToggleLeavesValidJSONC: 12 file shapes (LF, CRLF, tabs, compact,
trailing commas, comment-only, comment after, comma after a comment) x 7
add/delete orders; old code: invalid in the trailing-comma and
comment-only shapes.
- TestDelOnlyMemberTakesItsTrailingComma, TestInsertIntoCommentOnly-
ObjectNoTrailingComma, TestLoneCommaMendedOnNextEdit: red on old code.
- TestValidJSONC, TestInvalidEditNotWritten.
- internal/library TestHubToggleKeepsOpenCodeJSONCValid: the real
SetMCPHub on/off twice for OpenCode, LF and CRLF; old code: invalid at
the first "hub on" ("magpie": {...},\n,\n}).
|
||
|
|
fe05f0a721 |
library: a skill can be turned off on this computer alone, and a sync neither carries that nor turns it on
hanslin1666 on Discord (#general 1565016936344191096) wanted a library
skill off on one computer only ("只在这台电脑上关掉"). The only way to do
that was to untick its agents, and the ticks are what a sync carries, so
every other computer lost it too. A sync from a computer that had it on
also gave it back here.
Skill.OffHere (library.json "offHere", omitempty) turns a skill off on
this computer. No agent here gets it, whatever Agents says. Every reader
that gives a skill to an agent now asks gives():
- syncSkills, including the shared ~/.agents/skills check;
- desktop_skills.go;
- skill_changed.go;
- skill_edits.go;
- behind;
- Targets.
Agents stays what a sync carries, and the page shows those chips faded.
Collect never carries OffHere, so turning a skill off changes no part a
sync uploads. Put keeps this computer's OffHere for a skill it puts, so
a sync from a computer that has it on (or that gives it to more agents)
leaves it off here.
Where to turn it off:
- GUI: a power button on the skill row (aria-pressed). When off, an
"Off on this computer" tag sits on its own line under the name; it
says why and turns the skill on when clicked.
- CLI: `magpie library skill off-here|on-here <name>`.
- TUI: the row says the skill is off.
The strings are in en, zh, zh-TW, ja and de.
Existing users: nothing changes. An older library.json has no offHere,
so every skill stays on, and a skill that was never turned off writes no
key (TestSkillOffHereOldLibraryIsOn).
Not covered:
- a project's skills;
- a library skill whose own folder is inside ~/.agents/skills, which
agents read in place;
- a skill another computer removes (the flag goes with it).
The skill's files in the library folder still update while it is off.
Docs: docs/subsystems/library.md and sync-backup.md.
Run at the parent
|
||
|
|
e0ea15b8e8 |
library: an MCP hub, one magpie server in place of every library server (#2679)
With Library → MCP → "MCP hub" on (off by default), each agent that takes an MCP server over HTTP is given one entry, magpie, at /mcp/magpie/hub/<agent>, in place of the library servers ticked for it. magpie runs those servers itself, once for every agent: a command starts on its first call and ends after 10 idle minutes, a URL server is reached with its headers and MCP sign-in. Tools are <server>__<tool>; a tool off in the library is neither listed nor run. Any other app connects at /mcp/magpie/hub, which serves every library server. Both are guarded as /mcp/magpie/tools is (local or a gateway key, no foreign page, 4 MiB, the key's limit per call). An agent that reaches no server over HTTP (Claude Desktop), has a magpie entry of its own, or sits beside a library server called magpie keeps each server's own entry, and the page says why. Off gives every agent its servers back and ends every process the hub started. GUI: a switch under the MCP list, a line of what it serves, the address, and a Connect… sheet. The sheet lists every agent magpie detects that takes MCP (not a fixed four), each with where it stands; one given none of the hub's servers has a Connect that ticks it for every server it can reach (servers/agents-all), so it gets the entry, and the sheet stays open. Then any other app: Cursor (when it isn't a detected agent), VS Code, Other, with the JSON and, in the app, "Add to …" through the app's own install link built in Go (servers/hub-open; the page never sends a link). CLI: magpie library mcp hub on|off. Design: docs/subsystems/mcp-hub.md. With #3885 ( |
||
|
|
62045475b4 |
library: Codex on magpie reaches a command's MCP server through the gateway, run only while a thread uses it (#3885)
Codex starts every stdio server in its config once for each thread it has loaded and keeps them as long as the thread: YPYT1 counted 204 node processes, 21 GB, beside one Codex. While Codex is on magpie (Wired, not disconnected, this machine's gateway key, not WSL) the library now gives it a server run by a command as url = <gateway>/mcp/run/<name>, which magpie serves over streamable HTTP and runs the command for itself (internal/library/mcp_run.go): - a session (Mcp-Session-Id) starts its own child only when it sends something past initialize, the first page of tools/prompts/resources lists and ping; those are answered from what the first child said for the same command, args and env, and a list_changed from a child drops that list; - a (re)started child gets the session's own initialize replayed, so a server that keeps state per client still keeps it per thread; - a child idle for 15 minutes is stopped (a later call starts it again), DELETE stops it, and a server changed or removed from the library has its children stopped at the next sync; - server-initiated requests and notifications go to the session's newest open stream (GET, or a POST answered as SSE). The gateway route lets only this machine in: no Origin, a loopback Host, no forwarded or LAN address (TestRunMCPThisComputerOnly). A server with an env var magpie hasn't, a remote one, and Codex off magpie, in WSL or on another machine's key keep the command as before. agent.Rewired re-syncs the library when Codex is connected or disconnected, so it is handed the commands back when it leaves magpie. Tests (internal/library/mcp_run_test.go, a fake server): starts on a call and not on initialize/lists, idle end and DELETE, a server's own request round-trips, list_changed, a changed/removed spec, an unknown session, and the Codex entry in a sandbox (url when wired, the command back when not, a keyed env var kept as a command). Each was red with its part broken by hand: the init cache removed, the sweep off, runsFor forced false, forget a no-op, the Origin/Host guard dropped. Real runs: - mote, sandbox HOME, real codex 0.162.1 + @modelcontextprotocol/ server-memory: config.toml gets url = "http://127.0.0.1:3581/mcp/run/ mem"; codex app-server's mcpServerStatus/list lists its 9 tools through the bridge. - this Mac, sandbox HOME with only the DeepSeek provider copied, codex 0.162.1 on deepseek/deepseek-flash: a real turn called mem create_entities and read_graph through the bridge and answered with the stored observation. Three codex exec turns at once that used no tool started 0 memory-server node processes (before: one each). - Windows 11 (xiaomi-gpu), sandbox profile, codex 0.161.0: url entry written, app-server lists the 9 tools, 0 memory-server node.exe left after Codex closed. Run at the pushed head (mote): GOOS=linux/windows/darwin go vet -tags nogui ./internal/library/ ./internal/gateway/ ./internal/agent/: ok. go test -count=1 -timeout 45m ./internal/library/ ./internal/gateway/ ./internal/agent/ ./internal/gui/: library ok (167s), gateway ok (596s), agent ok (279s); gui FAIL only TestMainWindowCorners/macOS_26_SDK ("a toolbar doesn't change the corners ... yet the main window's was taken off"), #3949, red on mote's macOS 27 on main too; no gui or AppKit file is touched here. Windows (win-run): go test -run 'TestRun|TestFakeRunServer|TestMCPProxy' ./internal/library/ ./internal/gateway/: ok. Not tried: the Codex desktop app (the same config.toml), a server that asks the client for sampling or elicitation in a real agent. Codex picks up the new entries when it restarts. Reported-by: YPYT1 |
||
|
|
425a613224 |
library: a server run with npx -y reaches the agent as node running the package (#3885)
npx stays running as the server's parent for the server's whole life. On Windows that is cmd.exe + npx's node + a second cmd.exe beside the server: measured on xiaomi-gpu with @modelcontextprotocol/server-memory, 4 processes and 143 MB (cmd 8.1, npx node 76.2, cmd 8.2, server 50.8) for one instance. Codex starts an instance a thread; #3885 had 223 node processes under codex.exe. A library server `npx -y <registry package> args` (no other npx flag) is now installed with npm into ~/.config/magpie/mcp-npm/<hash> in the background, and the next sync writes it into each agent on this machine as `node <package bin> args`: node by name for npx by name, or the node beside an npx given by path. Until the install is done, or when npm fails (tried again after an hour), the agent keeps npx. An unpinned spec is installed again after a day, as npx would fetch the newer one; an install no library server runs any more is removed a day after its last. The library's own entry, a server's check, Copy config… and WSL agents keep npx. Taking a server off ends node's run of the program (launchedBy reads the node line), as before for npx. Run at this head (rebased on origin/main 1ff54f079; nothing it brought touches internal/library): - mote: go test -count=1 -timeout 45m ./internal/library ok (116s); GOOS=linux/windows/darwin go vet -tags nogui ./internal/library ok; ./internal/proc/... ./internal/testenv/... and the root package ok; TestNpx*/TestReadNpx under -race ok. - xiaomi-gpu (win-run): TestNpx*/TestReadNpx ok. - Real, on xiaomi-gpu, Node 22 + real npm registry, sandbox HOME: the library synced server-memory into a Codex config.toml; the install took 12.8s and the second sync wrote command = "node", args = [the install's …\server-memory\dist\index.js]. Started from that entry, the server answered initialize and tools/list, and its process tree was 1 process at 56.2 MB, against 4 processes and 143 MB through npx. - Broken by hand: without the npxDirect call in syncMCP, TestNpxServerRunsByNode is red ("the package was never installed"). Not tried: a real Codex or Claude Code session starting the node entry (the entry has the same command/args shape they already start), and macOS's process tree (npx's node and sh there too). Not done (#3885 stays open): Codex starting the same MCP once a thread. |
||
|
|
053d0d37f8 |
library: Install RTK uses brew only when Homebrew has rtk's bottle, and keeps why it failed on the card (Scott__D on X)
Scott__D on X: "Magpie 里的这个 RTK 安装一直都不成功". The RTK card sat on
"Installing RTK… this can take a minute." over `brew install rtk`.
Cause: Homebrew bottles rtk only for Apple silicon on the newest macOS
(arm64_sequoia, arm64_tahoe, arm64_golden_gate, and Linux). On an Intel Mac
or macOS 14 and older, `brew install rtk` builds rtk from source, and first
the 19 formulae it builds with, rust, llvm and python among them: hours.
InstallRTK gives the installer five minutes, so each try was ended, said so
in a status line gone after ten seconds, and the next try started over.
Reproduced on mote with a sandbox Homebrew (HOME and prefix of its own)
and HOMEBREW_FAKE_MACOS=14.7: brew info rtk says "stable 1.1.0, HEAD" with
no "(bottled)", brew install rtk lists 19 dependencies to build, and
magpie's InstallRTK spent 3m43s in it before failing.
Fix:
- rtkInstaller asks `brew info rtk` and uses brew only when it says
"(bottled)", brew's own word for pouring the bottle here. Otherwise, and
when brew fails or doesn't answer in 30s, it is rtk's own script
(install.sh from rtk-ai/rtk's README, which downloads rtk's release for
darwin x86_64/aarch64 and Linux). The answer is kept an hour per brew,
since ReadRTK asks on every read while rtk isn't installed.
- A failed brew says Homebrew's first Error: line and what it says to do,
not the support-tier notice its output ends with.
- The card keeps "The install failed: {why}" beside Get RTK until the
next try (as the upgrade's error already did), in every language.
- The five-minute bound on the installer was already there and stays.
Run on mote (macOS 27.2, arm64):
- real InstallRTK, sandbox HOME, sandbox Homebrew, HOMEBREW_FAKE_MACOS=14.7:
chose rtk's script, installed rtk 1.1.0 into the sandbox ~/.local/bin in
12.2s (`rtk --version`: rtk 1.1.0); the card then offers Put RTK on PATH.
- real InstallRTK, same sandbox, macOS 27 as it is: chose brew (bottled),
installed rtk 1.1.0 in 10.7s.
- go test ./internal/library (TestRTK*): ok. New tests:
TestRTKInstallsWithBrewOnlyFromItsBottle (brew info output read from the
real brew, bottled and not), TestRTKBrewInfoThatHangs,
TestRTKBrewInstallSaysBrewsError (brew's real output on mote).
- GUI: library-rtk-install.test.cjs, 5 languages x 1100/420, Chromium and
WebKit: 22/22. All library-*, gui-de/ja/zh-tw and i18n-keys files: 770 of
771; the one red is i18n-keys "a plugin's words are its own" on
plugins/routing "masking…", red on origin/main too (#4053).
- gofmt -l: nothing. go vet ./internal/library ./internal/gui;
GOOS=linux and GOOS=windows go vet ./internal/library: ok.
- Full suite on mote, go test -tags nogui -count=1 -timeout 45m ./...
at base
|
||
|
|
e29ddc407f |
library: a Pi in WSL is given MCP servers, and so are seven more WSL agents
leokon on Discord (#help): the Library's MCP section listed only the Windows Pi, never a Pi installed in WSL. wslTargetOf left pi@wsl's MCP out because its version wasn't known, and Pi's MCP file depends on the version: 0.99+ reads mcp.json itself; before that, pi-mcp-adapter 3 reads mcp-adapter.json and 2 reads mcp.json. - The WSL probe now asks the distro's pi for --version (wslKind version: true). The answer is stored as the agent's wslVersion, and InstalledVersion returns it for an agent in WSL. - pi@wsl:<distro> gets piMCP. The file is chosen as on this computer, with the distro's npm roots for the adapter (~/.npm-global, /usr/local/lib and /usr/lib node_modules): wslPiRoots, piDetectIn. - Siblings: every agent with a local MCP target and no WSL one now has one, in its own file under the distro's home. These are Gemini CLI, Antigravity CLI, Crush, Cline, CodeBuddy Code, Kimi Code and Goose. - Every WSL MCP file is marked WSL with its distro, so a Windows program (C:\...\npx.cmd) is refused, as for claude/codex@wsl. - Not fixed: Kimi Code's and Goose's skills in WSL. On this computer they get the shared ~/.agents/skills, but the distro's needs that folder's sharing rule (#3966). Run (at |
||
|
|
dc1af8231b |
ghtoken: a Settings token GitHub refuses is said, and requests go without one (#3926)
A GitHub token in Settings → Network and sharing that GitHub refused (401, expired or revoked) failed every plugin and skill check, so a stale token was worse than none. Now it is treated as an environment token already was: the request is asked again without it, the token isn't sent again while magpie runs or until the field changes, and the anonymous answer (60 an hour) is the one taken. This overturns the package comment and TestSettingsTokenRefusedStaysAnError: the token being the user's choice is a reason to tell them, not to fail the check. The page stays honest about it: - Settings › Network and sharing still shows the token, masked, with Remove, and says in red that GitHub refused it and requests go without one until it is replaced (/api/settings githubTokenRefused). Before, a refused token simply read as none being set. - After a Settings token's refusal requests go anonymous, not with GITHUB_TOKEN/GH_TOKEN: the user put the Settings one ahead of those, and the page says "without one". Patch by MYCF711 (fix/settings-token-fallback, 7d93f1b5): the ghtoken change and its tests. Changed from it: the notice is in Settings' row, where the token lives, instead of the patch's Plugins page note, which cost ~630 bytes of core script the budget (28 bytes of room at |
||
|
|
c89284ae66 |
library: a server turned off everywhere has its running processes ended (#3885)
Turning MCP servers off in the Library rewrote the agents' configs, but Codex, the Codex app and Claude Code read them only at start, so the servers they had started kept running. With every server turned off, the reporter's machine still held 17.75 GB of node processes for them. A change, and the sync at start, now record each stdio server it took out of an agent's config as that config had it. Once no agent's config runs that command and those arguments (another agent's entry, or the user's own under another name, keeps it), proc.EndTrees ends every process whose command line runs it, with all it started: the cmd /d /s /c "npx -y x" wrapper, the node npx-cli.js under it and the server under that. magpie and what it runs under are never picked, and a process under one picked goes with that one. An interpreter with nothing after it (node, npx) is never matched. It runs after the change lets go of the Library lock and before it returns, so magpie library mcp ends them too before it exits. On Windows the processes come from a Toolhelp snapshot with their command lines (no PowerShell); elsewhere from ps -o pid=,ppid=,args=. Run at base |
||
|
|
fce0d84756 |
library: OpenCode 2's mcp.servers is read, written and emptied as servers, not taken for one
liam_8829 (Discord #feedback, 10-27) turned every MCP server off and found
opencode.json still holding a "servers" node with no type and no enabled.
That node is OpenCode 2's own container: 2.x writes servers to
mcp.servers.<name> (opencode mcp add --global does), still reads V1
mcp.<name> beside it, and V2 wins a name clash. magpie read every child of
mcp as a server, so it listed "servers" as a typeless server, never saw the
servers inside it (so it could not turn them off), and wrote its own as V1
mcp.<name> beside them.
Now, for the OpenCode format (opencode.json, a project's opencode.json,
and the targets sharing that format):
- mcp.servers is read as the container when it has no type/command/url of
its own, and its entries are servers;
- a server is written where it already is, or to mcp.servers when the file
uses that layout; a V2 entry gets no "enabled" (OpenCode 2 drops it; the
field there is "disabled");
- removing a server removes it from where it is, V1 or V2, never the
container. Turning everything off leaves {"mcp":{"servers":{}}} plus the
user's own entries, byte for byte.
Run:
- TestOpenCode2Servers (new): red on the old code ("found [mine]"); red
with del's fix taken out ("ctx7 ... still in"); red with the enabled drop
taken out ("an OpenCode 2 server has no enabled"); green with the fix.
- Real OpenCode 2.0.25 in a sandbox XDG_CONFIG_HOME, `opencode debug
config`: the written file (V1 mine + servers{gh, own}) resolves every
server; {"mcp":{"servers":{}}} resolves to no mcp, no error.
- go test -count=1 -timeout 45m ./internal/library ./internal/proc
./internal/provider:
library ok (312s), proc ok (40s) at b67c7eaa0 (rebased on origin/main
|
||
|
|
e4552cca9f |
library: a cargo RTK upgrades on Windows, and says why when it can't
新v学员 (Discord #feedback, 10-27): upgrading an RTK installed with cargo
failed silently on Windows. Four causes, each fixed:
- No cargo on magpie's PATH (magpie started before Rust was installed,
or from a shortcut whose PATH rustup never touched): rtkUpgrader gave
no upgrade, so Upgrade was greyed with only a tooltip, which a click
never shows. Now the cargo rustup put beside rtk is run by its path;
with no cargo anywhere, the card (and the CLI) says it was installed
with cargo, to install Rust from rustup.rs or run the command shown
(RTKView.NoUpgrade, Manual), and UpgradeRTK's error says the same.
- CARGO_HOME (D:\Rust\.cargo is common) moved cargo's folder: an rtk
there wasn't cargo's to magpie. cargoBins reads it, for finding rtk
and for the upgrade; on Windows the folder matches whatever its case.
- cargo install --git built rtk-ai/rtk's default branch, develop, whose
Cargo.toml says 0.49.0 while v1.1.0 is out from master: the upgrade
left rtk as it was, or older, on every OS. It now names --branch
master, as rtk's own installation guide does.
- Windows refuses cargo's move over a running rtk.exe ("failed to move
… (os error 5)", exit 101, after the whole build), and an agent runs
rtk for every command. On that refusal the rtk is renamed aside
(rtk.exe.old-<pid>, which Windows allows), a copy put in its place,
and cargo run again; its build is kept in magpie's CARGO_TARGET_DIR,
so the retry builds nothing. Old copies are removed on the next
upgrade.
A failed cargo now says its first error with the cause, and what to do
for the common ones (rtk in use, link.exe/dlltool missing, GitHub
unreachable), not its last three lines, which only said the build
failed and where its files were left.
Run:
- Real Windows (10.0.0.132, sandbox CARGO_HOME/RUSTUP_HOME/USERPROFILE,
rustup + cargo 1.99.1, removed after): plain cargo install over a
running rtk.exe fails with "拒绝访问。 (os error 5)" exit 101; a
Windows build of this package's tests (GOOS=windows go test -c, a
scratch test calling ReadRTK/UpgradeRTK, not committed) with no cargo
anywhere gave NoUpgrade "cargo" and the new error; with cargo only
beside rtk (not on PATH) and the old rtk.exe running, UpgradeRTK
built rtk-ai/rtk master and went 1.0.0 -> 1.1.0 in 3m26s, the running
rtk kept running, rtk.exe.old-<pid> was left and removed once it
exited. The build used the gnullvm toolchain with llvm-mingw; the
gnu toolchain failed with "error calling dlltool" and lld's missing
-lgcc_eh, which is the output the tests use.
- New tests (rtk_cargo_test.go) and the updated
TestRTKUpgradeCargoNamesThePackage are red on origin/main
(
|
||
|
|
33ccc61884 |
library: one market skill from a huge repository installs alone; GitHub's file list is never cut (#2794)
Adding clean-code from sickn33/agentic-awesome-skills in the market failed with "GitHub's list of sickn33/agentic-awesome-skills's files wasn't understood: unexpected end of JSON input" (CaiusLuo; stablyai/ orca the same, ye4241). The repository's download is over 200 MB, so its skills are fetched file by file from GitHub's list of its files (#1941), and that list is 11.3 MB: apiGet cut every answer at 8 MB and dropped the read's error, so JSON was handed a cut-off body. From ye4241's patch on the issue (made on |
||
|
|
5b4da5bee3 |
proc: magpie on Windows finds fnm's node and npx (#2685)
What changed
- fnm puts its Node on a terminal's PATH from the shell profile
(`fnm env | Invoke-Expression`), never in the registry, so magpie
started from the Start menu had no node: a Library MCP server run by
bare npx was "notfound", and one run by npx.cmd's full path (the
reporter's C:\Users\...\fnm\aliases\default\npx.cmd, alone or under
`cmd /c`) exited 1 with cmd's "'node' is not recognized", since the
package npx fetched runs node by name.
- Windows UserPath (no-op before) adds the folder fnm's default alias
names, after what PATH has. UserBinDirs (FindTool) gets each fnm
Node: the default alias first, then installations newest by number.
- fnm's Windows layout, checked against Schniz/fnm master (config.rs,
directories.rs, version.rs, fs.rs, commands/env.rs): root FNM_DIR,
else etcetera's Windows data_dir\fnm (home\AppData\Roaming, APPDATA),
else legacy ~\.fnm; versions in node-versions\<v>\installation with
node.exe/npx.cmd directly in it (no bin on Windows); aliases\default
a junction to an installation folder; the "system" alias points at
Z:\_fnm_\..., read as none. XDG vars on Windows only move fnm's
multishell links, not its versions. LOCALAPPDATA isn't used for them.
- The shared node-version helpers (nodeVersions, parseNodeVersion,
nodeVersionLess, isDir) and addPath moved from the !windows files to
nodever.go unchanged; fnmWin* there take home/APPDATA/FNM_DIR as
arguments so the tests run them on every OS.
- The Library check (checkStdioAt, this machine only) starts a bare
command PATH lacks from where proc.FindTool finds it and puts that
folder on the child's PATH (stdioProgram, withPath), as the owner's
plan on the issue said. Docs: agent-wiring.md, library.md.
Run
- macOS: go test -count=1 ./internal/proc/ ./internal/library/ ok
(TestNoCommandBypassesProc and the other proc guards included);
gofmt -l clean; go vet GOOS=windows/darwin for proc, library, cli,
daemon; GOOS=linux vet proc, library and (-tags nogui) cli, daemon;
GOOS=windows test binaries for proc and library build.
- Windows box (Win 11 x64), cross-compiled amd64 test binaries:
TestUserPathFnmNode (real junction via mklink /J, npx.cmd that runs
node by name) red on origin/main 4a1cd7765's code ("PATH after
UserPath = [C:\windows\System32], want fnm's default alias"), green
here; TestFnmWin* green.
- Real fnm 1.39.0 + Node v24.22.1 installed into a sandbox
(USERPROFILE/APPDATA under C:\Users\yeton\fnm-2685, no FNM_DIR,
registry PATH without node). A throwaway probe calling UserPath then
library.CheckServer on chrome-devtools-mcp@latest:
|
||
|
|
27ca0bef53 |
library: the MCP Registry is asked with a budget of its own (#3043, shupivot)
The market's one client gave every request 20 seconds, and the Registry's
search answers in 13-37 s often enough (9 of the reporter's 33 tries past
13 s, 6 past 20 s, the slowest 37.3 s) that a search came back empty with
"context deadline exceeded" - twice in ten tries, nothing listed, and
nothing to do but type the same box again. The registry is asked with a
60 s client now, past its measured tail; skills.sh and the icons keep
the short one. The error that remains says what it is (SearchError, the
source named, #1589), the client's own seq guard keeps a slow answer
from overwriting a newer keyword's results, and what the market has of
its own still lists beside the failure.
Red before, on the baseline code with the shared client's timeout stood
in at a scale a test can wait for (the probe: list=0, "context deadline
exceeded (Client.Timeout exceeded while awaiting headers)" - the
reporter's error verbatim); after, the same slow registry answers and
the search lists freecad-mcp. A registry past even its own budget still
fails as a named SearchError (control).
Ported from skygunner's branch fix/mcp-registry-timeout (11d176bd7),
author kept; reported by shupivot.
Run at this head (
|
||
|
|
758be6d14e |
library: magpie-setup is first in the market's skills, so an agent can set magpie up as asked
Leyuu_5 on X: "功能越来越多,感觉可以来个skill让AI来帮设置需求了". The skill
lives in magpie-community/plugins (skills/magpie-setup, e513644) and
teaches an agent to turn a request into magpie's own commands. Listing
it in featuredSkills puts it first under Library › Market › Skills,
official, one click to add, with no setup.
What was run at this head:
- go test ./internal/library ./internal/cli: ok (library's first run
failed only with "no space left on device" while writing testlog.txt;
run again on its own: ok 193.7s)
- TestFeaturedSkills extended: magpie-setup first, quota second, both
Official/Featured with a description; "setup", "routing" and
"gateway key" find magpie-setup first, "quota" finds magpie-quota
and not setup. Red with magpie-setup taken out of the list.
- gofmt -l internal/: empty; go vet (darwin), GOOS=linux go vet -tags
nogui, GOOS=windows go vet on internal/library and internal/cli; go build
- library.InstallMarketSkill("magpie-community/plugins", "magpie-setup")
in a sandbox HOME against the pushed plugins repo: Installed
[magpie-setup], SKILL.md in library/skills/magpie-setup.
Not run: the full ./... suite (the disk had under 1GB free), the GUI
suite (no GUI asset changed; market-featured-skill.test.cjs fakes the
list).
|
||
|
|
769355ab93 |
library: an MCP server's startup timeout reaches Codex as startup_timeout_sec, a hand-written one stays (#3168, miaomiaozi)
The Library's MCP server editor has a "Startup timeout" field (seconds), shown when an agent that reads one is installed (AgentView.Startup; Codex only). It is written to Codex's [mcp_servers.<name>] startup_timeout_sec, user-wide and in a project's .codex/config.toml. Empty writes nothing, so Codex keeps its own 30s, as before. The key and its unit are from Codex's own source: RawMcpServerConfig in codex-rs/config/src/mcp_types.rs (cb2581dae8de) has startup_timeout_sec: Option<f64> in seconds, and the older startup_timeout_ms, which is read only when _sec is absent. A value the user wrote in config.toml is never written over. magpie records the value it last wrote (Applied.Startup per agent, Project.Startup per project file). A value in the entry that differs from that record, one there before magpie wrote any, or any startup_timeout_ms, is the user's (startupTheirs), and magpie leaves the key alone. Once the user takes theirs out, magpie's goes in. The TUI's server editor keeps the GUI-set value, as it does for OAuth. Other agents with a startup timeout (Grok Build, Hermes, OpenCode) and a `magpie mcp add` flag are #3536. Run, in a sandbox HOME with pinned GOMODCACHE/GOCACHE: - go test -tags nogui ./internal/library ./internal/tui: ok (162s, 16s). - New tests: TestCodexStartupTimeout, TestCodexStartupTimeoutKeepsUsers, TestCodexProjectStartupTimeout. Broken by hand, each red: every existing value counted as the user's -> "startup_timeout_sec = 120, want 45"; magpie always winning -> "= 20, want 90"; no encode (the old code) -> "= <nil>, want 120". - GUI: new mcp-startup-timeout.test.cjs, Chromium and WebKit, en zh zh-TW ja de, 1100 and 390px: 22/22; red on the old client.js (no field). The 59 GUI files the change reaches (mcp-*, library-*, i18n-keys, gui-de/ja/zh-tw, every editServer/lib-editor file): 935 of 937 pass. The red, library-row-remove's hook-row trash in Chromium, fails the same way on origin/main |
||
|
|
14b10f1166 |
library: an MCP server signed in to in Claude Code, in WSL too, says so instead of "needs sign-in" (CyberCaius on Discord)
CyberCaius signed in to a remote MCP server with Claude Code's /mcp in
WSL, and the Library still said 需要登录. The check connects as magpie,
without the agent's tokens, so an OAuth server answers it 401, and magpie
read no agent's own sign-in anywhere: not on Windows, not in a distro.
The check now reads each Claude Code target's .credentials.json, beside
the settings.json the target already has (readOwnSignIns,
mcp_agent_signin.go). A distro's Claude Code is a target under the
distro's home (wslTargetOf), so its file is read there through
\\wsl.localhost with no new setting. An mcpOAuth entry of the server's
name and URL with an access or refresh token, as Claude Code 2.1.310
counts one, names the agent in ServerHealth.AgentSignIn; the row says
"signed in in Claude Code (Ubuntu)" with the ok dot, and the tooltip says
magpie can't list its tools without signing in itself. An entry without
a token, another URL by the same name, and a file that can't be read or
parsed name nobody, so the row stays "needs sign-in". The tokens are
never sent or kept. A stopped distro has no target and isn't started.
On a Mac only the file is read, never the Keychain. The sign-ins are part
of the check's cache key, so a sign-in in the agent since isn't answered
from the session's earlier check. Strings in zh, zh-TW, ja and de.
Run:
- TestCheckNamesAgentsSignedInThemselves (internal/library): agent.FakeWSL
forces the Windows+WSL switch (Ubuntu running, its home a temp root),
sandbox HOME/USERPROFILE/XDG_CONFIG_HOME, CLAUDE_CONFIG_DIR cleared, a
real httptest server answering 401 with WWW-Authenticate.
- Broken by hand, each red with a FAIL naming the behavior:
- the old behavior (the reader names nobody): reading only this
computer's Claude folder (claudeDir()) instead of the target's:
"signed in in claude@wsl:Ubuntu, the check says {State:auth ...
AgentSignIn:[]}".
- counting an entry with no token: "a sign-in with no token counted".
- leaving the sign-ins out of healthKey: "signed in on both sides, the
check says ... AgentSignIn:[claude@wsl:Ubuntu]" (stale cache).
- library-mcp-health-wsl.test.cjs, chromium and webkit, en/zh/zh-TW/ja/de:
red on the old client.js (expected "signed in in Claude Code (Ubuntu)",
got "needs sign-in"), 12 of 12 after.
- gofmt -l (nothing); go vet on darwin, GOOS=linux -tags nogui and
GOOS=windows for ./internal/library ./internal/gui; go build darwin,
GOOS=windows and GOOS=linux -tags nogui ./...; go test -tags nogui
-count=1 -timeout 45m ./internal/library ./internal/gui: ok (187s, 63s).
- GUI: library-mcp-health, library-mcp-health-wsl, mcp-signin-health,
mcp-signin, mcp-oauth-app, library-mcp-tools, library-mcp-tool-switch,
library-mcp-unshown, library-items, i18n-keys, gui-zh-tw, gui-ja,
gui-de: 161 of 161 pass.
These ran first at a base before origin/main
|
||
|
|
c417b1f4e3 |
library: a skill removed from its source is said so, and every such skill goes in one click, asked first
スライム on Discord (#help, 10-22): taste-skills took some of its skills
out, Update all reported each of them as a failure, and the only way
out was to delete them one by one.
An update or a check that reads the source whole and finds the skill's
folder (or its SKILL.md) gone now calls it removed upstream, not a
failure. GitHub tarballs and other git repositories both work this way.
- UpdateSkill returns *GoneError.
- UpdateSkills and UpdateSomeSkills list it in Result.Gone, not
Unupdated.
- A check gives status "gone".
- Each marks Skill.Gone. The mark is cleared when a check or an update
finds the skill there again.
- A fetch that failed, a skill left out of a fetch as too big, and a
folder that can't be read stay unknown, never gone (goneFrom).
Nothing is deleted by itself. RemoveGoneSkills takes the named skills
out, or every marked one when none are named, through RemoveSkills, so
the folders go to the backups. A skill found in its source again is
kept and said so.
- GUI: a "Removed upstream" tag replaces Update available and the
update icon. Update all says gone skills apart from failures. "Clean
up N" sits in the group heading, or in the bar when there is one
group, and opens a sheet naming each skill. One changed here carries
"Changed here". Strings are in en, zh, zh-TW, ja and de.
- CLI: `magpie library skill rm --gone [--yes]` asks at a terminal and
refuses without --yes otherwise. It names the ones changed here.
update and status print the hint.
- TUI: the row says "removed from <repo> · d takes it out".
- API: POST /api/library/skills/remove-gone {names}.
- Docs: the Skill updates row and Verification in
docs/subsystems/library.md.
Record for this push: 13 commits on origin/main
|
||
|
|
75df6f4891 |
library: the git skill tests run again, with the machine's git found before the sandbox
Every test that builds a git repository (gitRepo in skillgit_test.go) looked git up with exec.LookPath after sandbox() had replaced PATH, found none and skipped with "git isn't installed". TestInstallFromGitRepo and the rest of the kind-git tests were skipped on every machine and on CI. realGit is now looked up once at package init, before any sandbox. gitRemoved is a fixture helper the next commit's test uses: as a file's body in a commit, it removes that path from the repository. Record for this push: 13 commits on origin/main |
||
|
|
c2636b7b5b |
library: an MCP command given to agents in WSL is checked in their distro
loong on Discord, Windows host with agents in WSL: a stdio server whose
command is a WSL program (`node /home/loong/tools/xxx.js`), given only to
WSL agents, showed "exited (1) … Node.js v24.9.0" on the Library's MCP
page. The check started it on Windows, where his agents never do; a
sibling written as `wsl -d Ubuntu … node …` checked fine.
What changed:
- checkSides (mcp_check_wsl.go) reads each agent id's `@wsl:<distro>`.
No WSL agent, not Windows, a Windows path for the command
(windowsPath: magpie's own image server, `C:/x/npx.cmd`) or Settings'
Detect agents in WSL off: this computer, as before. Otherwise each
distro is a side, after this computer when an agent here has it too.
- In a distro the command is found as the agents' shell finds it
(new wslrun.In: the same login-then-interactive probe Find uses, so
nvm's node is found; cached for findAge) and started through
wslrun.Tool.Command, the existing `wsl.exe -d D --exec /usr/bin/env
PATH=… MAGPIE_WSL_RUN=… <path> args` path, so no new quoting. Its
env goes over WSLENV (Tool.Env); its Cancel stops the run inside the
distro.
- A distro that isn't running is never started for a check: Why
"wsldown", naming it, painted as not checked (ring), like novar.
Beside a side that was checked it is left out.
- Mixed: each side in turn, the first failure ends it. ServerHealth
gains Checked (where it started, "" for this computer); the row says
" · WSL Ubuntu" / " · Windows" on a failure, the tooltip "Failed in" /
"Checked in". New strings in zh, zh-TW, ja, de.
- healthKey (Go and client.js) includes the sides, so agents moving into
WSL is a check anew.
- docs/subsystems/library.md says all this.
Tests:
- TestCheckWSLOnlyServerInItsDistro: ok in Ubuntu with the exact wsl.exe
argv; a stopped Arch is wsldown with no probe and no run; a command
the distro lacks is notfound there.
- TestCheckWindowsServerHere: a Windows-only server checked here, WSL
never asked; Windows-path commands stay here.
- TestCheckMixedServerEachSide: ok in both; WSL exit named Ubuntu's;
Windows failure stops before WSL; stopped distro = checked here only;
healthKey differs when agents move into WSL.
All force wslrun.On and fake wsl.exe (Run) and the distro run
(wslCommand runs this test binary as the fake server).
- library-mcp-health-wsl.test.cjs: chromium + webkit, en/zh/zh-TW/ja/de.
Broken by hand, each red:
- checkSides always this computer: WSLOnly and Mixed red.
- windowsPath exemption removed: WindowsServerHere red.
- mixed drops this computer: Mixed red.
- healthKey without sides: Mixed red.
- stopped distro reported as a failure: WSLOnly and Mixed red.
- client.js without the " · <place>" on a failure: the GUI test 12 of 12 red.
Run:
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows ok.
- GUI: the 94 library-*/mcp-*/i18n-* files, both engines: 780 of 783;
library-loading (webkit) and library-pick-remove (chromium zh-TW) red at
--test-concurrency=4, load ~45, pass alone 3 of 3; filed #3300, #3299.
- Full suite at 3831de1a3 (base
|
||
|
|
b91bcf2606 |
library: a standalone Windows rtk gets rtk's own upgrade action (#2006, Edward4226; LoKi)
An rtk.exe that no package manager installed (rtk's own Windows release unzipped into %USERPROFILE%\.local\bin, say) had no upgrader, so the Library page showed RTK's update with no usable Upgrade. LoKi (lokic7123-star) hit it on v0.1.1285 and again on 0.1.1320; Edward4226 reproduced it and wrote this patch (his bc2056804, author kept). rtkUpgrader now gives such an rtk.exe the rtk-windows-release action (shown as "rtk's own Windows release"): on amd64, when winget's folders, cargo's folder and winget's own records/winget list didn't claim it. UpgradeRTK then takes RTKLatest's version, downloads checksums.txt and rtk-x86_64-pc-windows-msvc.zip from rtk-ai/rtk's release through source.DoOfficial, checks the zip's SHA-256 against checksums.txt, takes rtk.exe out of it, writes it beside the old one and swaps it in with steady.Rename, putting the old one back if the swap fails. Changed from Edward's patch in review: - The action no longer names a version: it read rtkLatest under the lock RTKLatest holds while it asks GitHub (up to ~16s), so ReadRTK, a page draw, would wait on it. UpgradeRTK already falls back to the last known version through RTKLatest. - A winget that couldn't say whether it owns the rtk (timed out, failed, couldn't run) is no answer, not "not winget's": askWingetOwns now returns (yes, known); only winget missing, exit 0 without rtk-ai.rtk, or 0x8A150014 (no package) count as known-no. The winget arm above is unchanged (yes only when winget listed it). Without this, a winget timeout handed a possibly winget-owned rtk to the standalone path. - Only a zip member named rtk.exe is taken (no "any .exe" fallback, which could pick rtk-proxy's), and an oversized one is refused rather than cut short. - An aside (rtk.exe.old-<pid>) an earlier upgrade couldn't remove, because an agent was running that rtk, is removed on the next upgrade. - The arch is a var (rtkArch) so the upgrader test runs on arm64 hosts instead of skipping; the redundant winget/cargo folder checks are gone (the switch's earlier cases already return for those). - Two of the patch's tests failed as written on macOS (ReplacesBinary counted VERSION as a leftover; UpgradeRunsTheInstall compared the script rtkPath finds there with rtk.exe's text); both fixed. - New tests: TestRTKWindowsStandaloneAsksWinget (no winget / unlisted / listed / failed / hung), TestRTKWindowsReleaseZipNeedsRTKExe, the arm64 case, and a stale aside in TestRTKWindowsReleaseSwapsTheFile. Run at the cherry-pick on origin/main |
||
|
|
c358e76607 |
zcode: on Windows, write where ZCode reads, %HOME% before %USERPROFILE%
Gearclickist on Discord: magpie connects ZCode without an error, but
ZCode on Windows never lists magpie as a provider; on a Mac it does.
ZCode 3.14.3 (the same JS in the Mac and Windows builds, diff -rq of the
extracted app.asar) picks its data folder from setting.json's dataBaseDir,
then ZCODE_DATA_BASE_DIR, then process.env.HOME, and only then
os.homedir() (USERPROFILE). magpie used Go's home, which on Windows is
USERPROFILE. With HOME set (Git Bash, MSYS2, Emacs and the like), ZCode
reads %HOME%\.zcode\v2\provider_config.json and magpie wrote
%USERPROFILE%\.zcode\v2\..., a folder ZCode never opens. On a Mac HOME is
Go's home too, so the two always met.
appdir.ZCodeHome gives %HOME% on Windows when it is set, absolute, and
the folder asked about is USERPROFILE (a folder given on purpose is
kept). The agent target, the ZCode credential and team readers and the
library target use it. ZCode's CLI database stays under USERPROFILE (seen
on Windows below), so the sessions reader is unchanged; its comment says
why.
Run:
- go test ./internal/agent/ -run TestZCode; the new
TestZCodeOnWindowsUsesTheHomeZCodeReads forces zcodeOS=windows with
HOME and USERPROFILE apart. Broken by hand (ZCodeDataIn(home) back in
zcode()): red, "ZCode's folder on Windows with HOME set: .../001/.zcode
... want .../003/.zcode".
- gofmt -l; go vet for darwin, linux (-tags nogui) and windows.
- Windows box, sandbox folders only, HOME and USERPROFILE set apart:
ZCode 3.14.3 for Windows, extracted and started there, kept its logs,
workspace and provider_config.json under HOME\.zcode\v2 and only
cli\db under USERPROFILE. The old magpie.exe's `zcode provider magpie`
wrote profile\.zcode\v2\{config,provider_config}.json (the bug); this
build's wrote home\.zcode\v2\..., beside ZCode's own files, and nothing
under the profile.
- Full suite (go test -timeout 45m ./..., one at a time on the box):
68 packages ok, exit 0, at d87be7f13 and again after rebasing onto
|
||
|
|
e656888867 |
library: Library → Instructions gives Devin its global AGENTS.md (#3151, eqe365 on Discord)
eqe365 on Discord (#3151): Devin CLI reads AGENTS.md, but Library →
Instructions listed Devin as keeping no user-wide instructions file.
Devin's target had Skills and MCP and no Instructions.
Source: the docs Devin CLI 3000.11.92 ships with it,
share/devin/docs/extensibility/rules.mdx ("Rules & AGENTS.md" → Global
Rules). It reads global rules from ~/.config/devin/AGENTS.md
(%APPDATA%\devin\AGENTS.md on Windows) at the start of every session, and
the singular AGENT.md there too. Devin's folder (a.Dir) is already that
folder, so Instructions is AGENTS.md there, or AGENT.md when only that
one exists (firstThere). The GUI is data-driven and needs no change.
Test: TestDevinInstructions (internal/library/agent_skills_test.go)
checks:
- the target is AGENTS.md before the file exists;
- Save writes the shared block after the user's own text;
- with only AGENT.md present, that file is the target.
With targets.go reverted it fails: "Devin's instructions: "", want
.../.config/devin/AGENTS.md before the file is there".
Run with this change on origin/main
|
||
|
|
0f044e9447 |
plugins: a GITHUB_TOKEN GitHub refuses is dropped for anonymous requests, not shown as an error (till on Discord)
till's Plugins page said "无法连接 GitHub: GitHub refused GITHUB_TOKEN (no GitHub token is set in Settings → Network and sharing)". ghtoken.Token falls back to the environment's GITHUB_TOKEN / GH_TOKEN, and a stale one there made every GitHub read fail, though GitHub serves the same reads without a token. ghtoken.Do now sends a GitHub API request with the token. When the token came from the environment and GitHub answers 401, it remembers that token as refused for the rest of the process (Token() skips it, so GH_TOKEN is still tried after a refused GITHUB_TOKEN, and Settings no longer shows it) and asks once more without Authorization, returning that answer. A token set in Settings is never dropped: its 401 is still Refused()'s error. An anonymous rate limit after the drop is said by LimitedBy as before. Every caller goes through it: plugin fetchJSONFrom (tagged-repo search, git plugin checks, githubHead) and getURLFrom (Bun), and library apiGet, skills fetch, skilltree fetchBlob and latestRTK via doGitHub. internal/davsync/github.go stays strict: its token is the one the user gave sync to write a private repo, outside ghtoken, and an anonymous retry can't write there, so it would only hide why sync failed. Tests (httptest only): ghtoken_test covers an env token refused then asked again without, not sent again (and GH_TOKEN tried next), a Settings token refused stays an error, an env token refused then an anonymous rate limit is reported, and another host untouched. plugin TestTaggedReposStaleEnvTokenDropped is till's case: TaggedRepos with GITHUB_TOKEN=stale-till lists 7 repos, no error. github_token_test and library TestGitHubRateLimitSaid now expect the env token dropped and the Settings token still refused. Broken by hand, each red: (a) no anonymous retry: every new env test, the plugin and library tests red, and TestTaggedReposStaleEnvTokenDropped shows till's exact error; (b) no memory of the refusal: NotSentAgain, the plugin and library tests red; (c) a Settings token also retried: SettingsTokenRefusedStaysAnError, the plugin and library tests red. Run on the commit before the rebase (base |
||
|
|
4ef718651f |
library: InUse answers while a sync holds the library's lock
#2774: the macOS window stayed white at start. The window waits on
boot.js before it paints, and boot.js asks library.InUse through the
built-in plugins. InUse took the library's mu, which a sync holds for
its whole run: 13-16s on the reporter's Mac, with many agents and
skills. InUse only reads library.json, and save replaces that file whole
(edit.WriteAtomic), so InUse now reads it without mu. A read beside a
sync sees the file from before or after one of the sync's writes, never
half of one. A file that can't be read is still an error, never 0.
TestInUseAnswersWhileASyncHoldsTheLock holds mu and expects InUse to
return 3 within 5s. It also expects a half-written file to be an error.
With the lock put back by hand, it goes red:
--- FAIL: TestInUseAnswersWhileASyncHoldsTheLock (14.32s)
inuse_unlocked_test.go:36: InUse waited on the sync's lock
The sandbox cold start measured for this work has a short library sync,
so boot.js came at about the same time before and after (4527ms against
4822ms after listen at ~4s). The reporter's 13-16s sync wasn't
reproduced here.
What was run (worktree at
|
||
|
|
7916045591 |
library: RTK's tag for Grok Build and Grok App gives their own reason and rtk-ai/rtk#2136, not DeepSeek Harness's (新v学员 on Discord)
Every agent RTK has no hook for got dsh's tooltip on the RTK tab: "{agent}'s
hooks can only allow or deny a command, not change it" with
rtk-ai/rtk#3847 ("FR: Support DSH"). For Grok Build that is wrong twice:
the issue is dsh's, and Grok's PreToolUse hooks can rewrite a command
(updatedInput, shown on rtk-ai/rtk#1890). What holds is that rtk init has
no Grok agent (src/hooks/init in rtk v1.0.1 has none), and
rtk-ai/rtk#2136 is the open request for Grok Build (#4513 was closed as
its duplicate). Each link was checked with gh issue view; the others in
rtk.go (#3847, #3934, #4311, #3898, #4187, #3404) are right.
rtkNoHookWhy in plugins/library/client.js gives each agent its own reason:
dsh keeps its text and #3847, Grok Build and Grok App cite #2136 (Grok App
runs Grok Build), and an agent with no entry gets a reason with no link.
New strings in zh, zh-TW, ja and de. rtk.go's grok and grok-app reasons,
which the CLI shows, cite #2136 too.
TestRTKNoHookIssuesAreEachAgents fails when an rtkNoHook agent has no page
reason (or the reverse), when the page and rtk.go cite different issues,
when two agents cite the same issues without a reason in sharedRTKIssues,
or when the fallback carries a link. library-rtk-nohook.test.cjs checks
Grok Build's tag says #2136 and never #3847, DeepSeek or "hook".
Run in a worktree rebased on origin/main
|
||
|
|
9fd80b2128 |
library: skills install from any git repository, GitLab and a company's own among them (sunset on Discord)
ProbeSkills took only a GitHub source or a folder. It now also takes any
git repository's address: https/http on gitlab.com or a self-hosted
server (any depth of groups), a GitLab or Gitea page of a folder
(/-/tree/<ref>/<path>, /-/blob/..., /src/branch/...), ssh://,
git@host:group/repo.git, a bare host.name/group/repo, and file://.
Such a source is kind "git" (gitSource, skillgit.go).
It is fetched with the user's own git (proc.FindTool), so their
credential helpers and SSH keys reach an intranet host: git init, then
fetch --depth 1 --no-tags -- <url> <ref|HEAD>, checkout FETCH_HEAD into
a magpie-skill-* folder, .git removed; the same keepProbe/maxFetch path
GitHub's tarball takes.
What the user typed is data: an address starting with - and any
transport:: address (ext::, fd::, file::) are refused before git runs;
the address follows --; git runs with protocol.ext.allow=never and
core.symlinks=false, no shell, GIT_TERMINAL_PROMPT=0, and ssh -o
BatchMode=yes unless the user set their own SSH command (GIT_SSH,
GIT_SSH_COMMAND, core.sshCommand), so a sign-in it can't make fails
instead of waiting. An address with a password or token in it is
refused: library.json is shown and backed up. Git missing, a sign-in
refused, an unknown host key, a missing branch and an unreachable host
each say so plainly (gitError).
Updates: Commit keeps the repository head the skill was fetched at. A
check runs git ls-remote; another head is fetched (once per repository
and ref) and the skill's folder hashed, so a commit elsewhere in the
repository leaves it current and moves Commit on. UpdateSkill and the
edited-skill refusal work as for GitHub; EditedError and the page's
Changed here / Update / replace question name the repository instead of
GitHub. findNew, Group again, icons and the market stay GitHub's only
(documented).
Page, TUI and docs: the add box's placeholder in en/zh/zh-TW/ja/de
(zh: owner/repo、GitHub 或 GitLab 链接、任意 git 仓库地址,或本机上的文件夹),
a git skill's source shown as a link (https) or text (SSH), its own
Update and Check for updates; the TUI's prompt; library.md's Skills and
Skill updates rows. GIT_SSH/GIT_SSH_COMMAND are listed in agentenv's
notAnAgent (TestFolderVarsAreListed).
Tests (fail on the old code: gitSource/gitPath don't exist there, and
skill-git-source.test.cjs fails on the old assets' placeholder, checked
by stashing client.js/i18n.js): TestGitSourceReads,
TestInstallFromGitRepo (a local bare repo over file://: probe, install,
check finds an update, update, a commit elsewhere stays current, an
edit here is refused naming the repo), TestGitTreeURLInstallsFolder,
TestGitMissingSaysSo, TestGitSignInRefusedSaysSo (a local httptest 401,
GIT_CONFIG_NOSYSTEM so no Keychain), TestGitRefusesOptionsAndTransports,
TestGitErrorsSaid. No test reaches the network.
Run (worktree at origin/main
|
||
|
|
f191d6423b |
agent, library: a dsh patch list that opens with a YAML document start marker is edited, the marker kept (#2667)
What changed - dshParse (internal/agent/dsh.go) and dshRead (internal/library/dsh.go) let a patch list open with "---", YAML's document start marker, where before they failed the file as "not a list of entries magpie can edit". The marker goes in the head and is written back with it. - The marker counts only at the left edge, with at most a comment after it, and only before anything but blank and comment lines. A second "---" (a second document), one after the first entry, an indented one, "----", "--- x" or one after "[]" still fail the file instead of being kept as if they were the list's. ggbdpq's patch took a bare "---" anywhere before the first entry, so "---\n---\n- a" (two documents) was edited as one list. - The only line-scanning YAML readers with this check are these two; the rest go through yaml.v3 (edit.GetYAMLTop/SetYAMLTop read node lines and take a leading --- already). Run (macOS arm64, go1.26.8, load average 130-270 from other sessions) - New tests: TestDshDocStart and TestDshDocStartOnlyFirst (agent), TestDshDocStartPatchList and TestDshDocStartOnlyFirst (library). The #2667 fixture is the reporter's bytes. - Broken by hand, each red: marker never taken (all four red with the reported error); no only-once guard (both OnlyFirst red on "---\n---\n- id: a"); library alone reverted (library red, agent green); anything after "--- " taken (both OnlyFirst red on "--- x"). - gofmt -l: clean. go vet ./... (darwin), GOOS=linux and GOOS=windows go vet -tags nogui ./...: clean. - go test -tags nogui -timeout 45m ./... under set -o pipefail, sandbox HOME, at 244538d6d (this change on |
||
|
|
dccfefdf72 |
library: a skill brought in from an app's versioned folder follows the app's updates (#2635)
iomect's ego lite keeps its skill in a framework version folder and points its own links at the current one: ~/.agents/skills/ego-browser -> ~/.local/share/ego/ego-skills ~/.local/share/ego/ego-skills -> ~/.local/share/ego/active_version_dir/Resources/ego-skills/ego-browser ~/.local/share/ego/active_version_dir -> /Applications/ego lite.app/.../Versions/0.6.0.12 .../Versions/Current -> 0.6.0.12 ImportSkill linked the library to the fully resolved folder (Versions/0.5.1.13/...). After the update to 0.6.0.12 the old folder was still there, so the library and every agent it gives skills to kept the old skill. importSkill now links to linkVia(f.at, f.real), and Source.Dir is that same path. linkVia follows the found entry's links one at a time, and stops at the first one outside every skills folder (the agents', the shared ~/.agents/skills and the library's): for ego that is ~/.local/share/ego/ego-skills, which the app keeps pointing at its current version. A Versions/<v> part is named Versions/Current when Current is a link to that same version, which covers an entry that links straight into the versioned folder. If that path doesn't resolve to the same folder as today, linkVia returns the resolved folder, as before. Nothing else changes: every comparison of Source.Dir already goes through realDir. Tests (skill_version_test.go): - TestImportedSkillFollowsAppUpdate uses the reporter's layout (ego lite.app, ego Framework.framework/Versions, active_version_dir, ego-skills, ~/.agents/skills/ego-browser), brings it in at 0.5.1.13, then moves the app's links to 0.6.0.12 and checks the library's skill is 0.6.0.12's, listed and not missing. - TestImportedSkillThroughVersionsCurrent does the same with an entry linking straight into Versions/0.5.1.13. - TestImportedSkillPlainLink checks that a link to a plain folder is still linked to that folder. Broken by hand: - with `via := f.real` (the old link), FollowsAppUpdate and ThroughVersionsCurrent went red (the skill stayed "ego 0.5.1.13"); - with the Versions/Current step taken out, ThroughVersionsCurrent went red. Not done: a skill brought in before this keeps its old resolved link until it is brought in again, or its link in the library is replaced. No ego install here; the tests use the layout from the reporter's ls. Run: gofmt -l clean; go vet ./... (darwin), GOOS=linux and GOOS=windows go vet -tags nogui ./... clean. go test -timeout 45m ./... under set -o pipefail with a sandbox HOME, load ~280: 65 packages ok (internal/library 352s), internal/gui red with 8 real-window AppKit tests killed at their deadlines (#2645). internal/gui doesn't use this code. It passed alone with the real HOME, with this change (186s at load ~260-341) and on |
||
|
|
8bb9375e74 |
library: another app's MCP server in an agent's config is offered to bring in, not taken for the agent's own (#2635)
iomect's Codex server, written in ~/.codex/config.toml as
[mcp_servers.netcatty-external]
command = "/Applications/Netcatty.app/Contents/Resources/app.asar.unpacked/electron/cli/netcatty-external-mcp"
args = []
env = { NETCATTY_EXTERNAL_MCP_DISCOVERY_FILE = "…" }
never showed under the Library's servers found in agents. The TOML was
read correctly; the cause was appOwned. It marked any command under a
".app/Contents/" as one the agent's app writes itself (Codex's node_repl
and cua_repl,
|
||
|
|
9228bd443f |
library: skills are grouped by source when the skills CLI keeps its lock under $XDG_STATE_HOME (@_yukirock on X)
skills 1.7 writes its global lock to $XDG_STATE_HOME/skills/.skill-lock.json
when that variable is set, and only to ~/.agents/.skill-lock.json otherwise.
The Library read only the ~/.agents one, so with XDG_STATE_HOME set every
`npx skills add` skill had no repository and the "By source" view could not
group them. Both locks are now read, the XDG one winning per skill, since a
lock written before the variable was set still names older skills.
XDG_STATE_HOME joins agentenv.Vars, so the desktop app takes it from the
login shell like the other folder variables (TestFolderVarsAreListed).
Not handled: a project install's ./skills-lock.json.
Run (worktree at origin/main
|
||
|
|
61ca3924cb |
library: a pasted "npx skills add owner/repo --skill x" reads as its repo
The skills page's add field now takes the command a skills page offers
to copy (npx, bunx, pnpx, pnpm or yarn dlx, bun x, with -y, --skill and
--agent flags) and installs from the repository it names (RockyShowlle
on X). Anything else is used as typed.
Run at base
|
||
|
|
83f3316cfe |
library: a pasted repo binds a skill copy identical to its own, so it updates
When a skill in the library is a copy whose every file matches the
repository the user pastes, it is now bound to that repository, as if it
had been installed from there. Before, it was only grouped under the repo
and never updated (RockyShowlle on X). A copy that is linked from
elsewhere (npx skills, a git checkout) or that was edited stays grouped
only.
Run at base
|
||
|
|
ea3babac89 |
library: TestSkillRelinkKeepsUnreadableCopy holds under load, where the library skill's hash is remembered past its chmod
Red in a full run at |
||
|
|
6b3ee5a03b |
library: a repository that keeps its skills again under a plugin's folder lists each once (碳碳双键 on Discord)
tw93/waza keeps its eight skills in skills/ and again in plugins/waza/skills/. Some of the plugin copies lag the top ones. Typing "tw93/waza" in Library → Skills listed "16 skills", each one twice. unhiddenFirst only folded a copy in a hidden folder (.claude/ skills, #1964) into the unhidden one; two unhidden copies both stayed. It now keeps one copy of each skill. It prefers the copy outside hidden folders, then the one fewest folders deep, then the first. That covers both candidates (the probe and install) and skillDirsIn (the new-skill check). Run: - TestRepoWithAPluginCopyListsEachSkillOnce uses waza's real paths. Against the old skills.go it is red (9 lines: 16 candidates, the plugin's descriptions, 16 tree dirs); with the fix it is green. TestMarketInstallsASkillKeptInClaudesFolder (#1964) is green too. - Real use: ProbeSkills("tw93/waza") against GitHub in a sandbox HOME lists skills/check … skills/write, 8 in all, each once. - gofmt -l clean; go vet -tags nogui ./... clean for darwin, linux and windows. - Full suite: go test -timeout 45m ./... at load average ~115 (other sessions' suites). 63 packages ok. internal/agent and internal/gateway timed out at 45m with no test hung (TestOpenCodeAndCrushKeep… and TestStrictAffinity… had each run 0s), and go list -deps shows that neither imports internal/library. internal/gui's TestPanelJoinsFullScreenSpaces is #2450, red on main already. |
||
|
|
a80bc30092 |
agents: the Cursor editor's ~/.cursor is no Cursor CLI
The editor makes ~/.cursor on its own, so the folder alone says nothing
of cursor-agent (dirShared): cli-config.json or the command finds Cursor
CLI. The Library still writes the MCP servers and skills the editor reads
there when only the editor is here (SharedHere).
Run at this head before the rebase onto
|