4794de398ea8337d223a91e207181c56fcf4ad76
48
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6d7e5b53a0 |
library: the Library page opens without looking at the same folders thousands of times (#1771, oxyuan)
oxyuan's profile after v0.1.1214: every page opens at once but the
Library, ~1.3s a visit on Windows, 68% of it in library.resolve and the
read 97% system calls.
Cause: resolve follows links a part at a time, and for each part it
called linkTarget (an Lstat, and a Readlink for a link) and then Lstat'd
the same part again. One read of the page resolves a few hundred paths,
most of them many times over (each agent's skills folder for each skill,
CC Switch's folder and the source for each skill, home and the shared
folder once per skill), so the same ~150 folders were looked at
~10,000 times a read. On Windows each look is a cgocall.
Fix: while a read of the page (Read, Glance) holds the library's lock,
lookPart (linkmemo.go) keeps what each entry was found to be, one Lstat
and a Readlink for a link, for the rest of that read; linkTarget and
resolve both go through it, so the second Lstat is gone too. No change
runs while the read holds mu, so nothing the read keeps can be changed
by magpie under it. Nothing is kept past the read: the next visit looks
again, so a link made or moved on disk between visits shows. A look that
failed for another reason than "not there" is unknown and isn't kept. I
looked at a cache across visits keyed on the folders' times; checking it
costs one stat per folder on the way, the same as the memo's single look,
so it would save nothing over this.
Numbers, 11 agents, 40 skills from a linked folder given to all of them,
10 MCP servers (the package's sandbox, test binary built for each):
Windows 11 x64 box, median of 7:
Glance 10,144 looks, 116ms -> 117 looks, 26ms
Read 10,473 looks, 150ms -> 284 looks, 61ms
macOS (arm64), median of 7:
Glance 11,660 looks, 41ms -> 159 looks, 13ms
Read 12,040 looks, 53ms -> 360 looks, 28ms
The rest of a full Read (comparing the agents' copies, found skills)
runs without the lock, as before, and isn't memoized.
Tests: TestReadLooksAtEachFolderOnce (red with the memo taken out, and
with it outliving the read), TestLinkChangedBetweenVisitsShows (red with
a memo kept across visits), TestUnreadablePartIsLookedAtAgain (red when
an unknown look is kept).
Run: go test -tags nogui ./internal/library ./internal/gui (ok);
gofmt -l; GOOS=linux and GOOS=windows go vet -tags nogui
./internal/library; node --test internal/gui/tests/library-*.test.cjs,
chromium and webkit: 450/450 on the second full run. The first full run
had library-mcp-tool-switch red in WebKit (#1609, filed) and
library-chip-fan red once in Chromium under --test-concurrency=4; it
passed 3/3 alone and in the second full run. Not tried on oxyuan's
machine or with their library.
|
||
|
|
2d721f7f3d |
library, gui: the skills in your agents can be picked and removed together
wongxy on Discord: 资源库技能支持批量删除 (batch delete for the Library's skills). The library's own skills already have this: Select, then Remove…, since #1852 ( |
||
|
|
e528aeb3ce |
agent: DevEco Code, Huawei's OpenCode, as an agent (#1885)
foobra asked for DevEco Code (npm @deveco/deveco-code), Huawei's
HarmonyOS coding agent. It is OpenCode underneath, so it joins through
openCodeLike as MiMo Code did (
|
||
|
|
a43fa6809b |
library: two changes in one millisecond each get a backup folder of their own (#1743)
liubing reported on #1743 that TestRemoveFoundEntryEveryFormat failed in a full run on Linux, the backup read holding another format's content, on an unmodified main too. The backup folder was named by the millisecond and taken as this change's own: a second change in the same millisecond wrote into the first's folder, its file kept under its folder's name since the first's held the name, and the copy at the name the change wrote was the other change's. The test's loop runs one change per format, all named config.json, and on a fast machine two land in one millisecond. A user's two quick changes did the same: the backup the second change named wasn't its own. freshBackup makes the folder with os.Mkdir, adding -2, -3... when the millisecond's is taken. pruneBackups' sort keeps them in order. Siblings checked: the skill backups (keepLibrarySkill, keepReplaced, setAside, carry's and RemoveSkills' aside) use per-skill paths under the stamp; setAside already steps past a taken name, and the others only collide on the same skill in the same millisecond, where move fails loudly rather than mixing; they are left as they were, since a folder each would split one change's skills over many folders. Run: go test -tags nogui ./internal/library/ ok on macOS and in Docker golang:1.26.8 GOTOOLCHAIN=local (also -count=30 of the two tests). The original red didn't show in Docker in 100 runs; it was reproduced by injecting a minute-wide stamp, which turned TestRemoveFoundEntryEveryFormat red on the old code and leaves it green with the fix. Broken by hand: os.Mkdir -> os.MkdirAll (no claim on the folder) turns TestBackupsInOneMillisecond red. |
||
|
|
d0e412e7a6 |
library: a checked MCP server's PWD is home too, and #1727's cwd test holds on macOS (#1727)
The previous commit starts the check's server in home. Its own test failed on macOS with that fix in: the child reported /private/var/folders/.../magpie-test-home-N and HOME was /var/folders/.../magpie-test-home-N, the same folder spelled through macOS's /var symlink, compared as strings. The test now compares the folders with os.SameFile. exec sets PWD to Dir by itself only when Env is nil, and the check sets Env, so the server ran in home with PWD still naming magpie's own folder; a shell-script server that reads $PWD would see the folder the fix moved it out of. The check now sets PWD=home with Dir (not on Windows, which doesn't use PWD, as exec does), before the server's own variables so one it sets still wins. The two subtests now give each run a home of its own (t.Setenv HOME and USERPROFILE) and move the process with t.Chdir, so the "needcwd" fake's ./logs goes with the test instead of staying in the package's shared test home, and nothing is left in another cwd when a subtest fails. The read-only-cwd subtest also checks that ./logs landed in home: Windows doesn't enforce a folder's read-only bit, so that is what makes it fail there without the fix. Run (sandbox HOME, private GOCACHE): TestCheckStdio -count=3 on macOS; the whole internal/library package. Broken by hand: without cmd.Dir both subtests fail (wrong folder; "mkdir logs: permission denied"); without the PWD line the cwd subtest fails on its PWD. On the Windows box (windows/amd64 test binary): TestCheckStdio passes, and without cmd.Dir both subtests fail there too (the server ran in the test's temp cwd, and ./logs wasn't in home). Co-authored-by: ump45nose <52391318+ump45nose@users.noreply.github.com> |
||
|
|
1f0ff81dfc |
agent: Grok App's own route picked in magpie is taken, and Disconnect can put one back; a sync that isn't connected writes nothing (#1625)
Follow-up to fjrtdk's commit before this one, which this keeps: magpie never names itself as Grok App's route. - Set refused every own route (errGrokAppRoute) while Options still offered them, so the picker showed choices that only errored. It also broke Disconnect: when unwire leaves no route (Use set it to magpie, nothing stashed), Disconnect sets connect.was's route back through Set, got the error and stopped half done. An own route now takes magpie's channel out and is written as [models] default, the way picking another provider leaves magpie on other agents. That route can't be magpie, so the App's sign-in is never touched. - Sync ran rememberRoute/releaseRoute before checking for the channel, so every user with Grok App installed but not connected got stash entries. Now it returns before them unless the channel is there or the route is still magpie (an older magpie's takeover to put back). - Check again warns when the route is magpie and the channel is gone, which that commit dropped. - The notice uses the App's own labels (Settings › Account, Use; ja 「使う」, de Einstellungen › Konto / Verwenden, from grok-app 0.2.40's settings.nav.account and prov.useThis) and says a chat can pick magpie's models in its model picker (composer_prefs_set, which doesn't move the route). - Sibling: rtk init has no grok agent for Grok Build either (rtk 311ebcb agents: claude codex copilot cursor droid gemini hermes opencode pi trae vibe antigravity), so Grok Build is in rtkNoHook too. Run: gofmt -l clean; go vet ./... on darwin, GOOS=linux -tags nogui and GOOS=windows clean; go test ./internal/gateway ./internal/agent ./internal/library -count=1 pass; node --test i18n-keys and agent-notice-lang pass. Broken by hand: that commit's grokapp.go fails TestGrokAppOwnRouteStays, TestGrokAppDisconnectPutsTheRouteBack and TestGrokAppSyncUnconnected; dropping the Check branch fails TestGrokAppSyncUnconnected; dropping rtkNoHook["grok"] fails TestRTKNoHookGrokBuild. Not tried: the Grok App GUI itself; the config format and behaviour are from grok-app 0.2.40's source. Co-authored-by: fjrtdk <fjrtdk@gmail.com> |
||
|
|
ea3d480edf | agent: Grok App keeps its own route; magpie is a custom provider under Accounts, and the Library writes instructions, MCP and skills on agent-home (#1625) | ||
|
|
97dfed0f3e |
library: a site's well-known kit of skills is one group, by the lock's sourceBaseUrl (#1862)
WardLu (#1862): skills that `npx skills add` got from a site's /.well-known/agent-skills/ index were one group per skill. That was Feishu's lark-base, lark-doc and lark-sheets, and Fish Audio's fish-audio-api and fish-audio-sdk. readSkillLock grouped them by each skill's own sourceUrl (".../lark-base.tar.gz", ".../fish-audio-api/skill.md"). Now a lock entry with sourceType "well-known" is grouped by its sourceBaseUrl, read as host/path (wellKnownBase/siteOf): - the user, query and trailing slash are dropped, and the host is lower-cased without "www."; - so Feishu's three are open.feishu.cn/lark-cli/skills/regular and Fish Audio's two are docs.fish.audio; - a kit on the same host with a different base URL stays apart. Hosts are not merged. Fallbacks: - an older lock with no sourceBaseUrl takes the part of its sourceUrl before /.well-known/; - an entry with neither is grouped by its sourceUrl, as before. Two things this new key would otherwise get wrong: - Group again (RegroupSkills) tried every owner/repo-shaped key on GitHub. A kit one folder down a site (docs.example.com/kit) has that shape, so a key whose owner has a dot is skipped now. GitHub owners have no dot. - the heading's link sent a key with no path ("docs.fish.audio") to github.com. repoURL now opens it at https://docs.fish.audio. Run: - go test ./internal/library (all pass). New TestWellKnownKitGrouped uses the issue's base and source URLs for 3 Feishu + 2 Fish Audio skills, plus another kit on open.feishu.cn, an entry with no base, and a docs.example.com/kit kit that Group again must not fetch. - With the well-known branch disabled it fails, with the reporter's five one-skill groups. - With the dot check removed it fails on a GitHub fetch. - new TestWellKnownBase: a table of base and source forms. - skill-repo-groups.test.cjs now has a docs.fish.audio group that opens the site. It fails with origin/main's assets, which say "on GitHub". It and skill-regroup/skill-groups pass in chromium and webkit. - gofmt -l; go vet for darwin, linux -tags nogui and windows on internal/library. Not run: the reporter's real ~/.agents/.skill-lock.json. The issue quotes only these three fields of it. A row's own link still isn't its sourceUrl. |
||
|
|
9a34a784dc |
library: Collapse all / Expand all for the skill groups (#1862)
WardLu (#1862) asked for a way to fold every skill group at once in a library of many groups. Library > Skills now has a Collapse all / Expand all button beside the sort (foldAllButton in library.js): - without a filter it sets every shown group's kept fold (magpie.libSkillFolds), the same as clicking each heading; - while filtering it folds or opens only the groups the filter shows, until the filter changes (unfiltered), and leaves the kept folds alone; - it says Collapse all while any shown group is open, else Expand all; - it is hidden with fewer than two groups (A->Z, or a filter only one group matches); - a part inside a group keeps its own fold, and nothing is sent. skillHits/groupFolded pull out the rules drawSkills already used, so the button and the headings can't disagree. Strings in en, zh, zh-TW, ja, de. docs/subsystems/library.md's Skill groups row describes it. Run: - new internal/gui/tests/skill-fold-all.test.cjs: chromium and webkit, en/zh/zh-TW/ja/de, at 640 and 1180. 22/22 pass, three times. With origin/main's assets it fails in every case (no button). - the skill-*, library-* (skills side), pick/remove/import skill tests and i18n-keys, at concurrency 4: everything passes except pick-skills.test.cjs in WebKit. That test is red with main's own assets too (#1672, being fixed separately). - screenshots in German at 640 and 1180: the button sits in the heading row and wraps with it. Not run: a real library with many groups in the app window. I didn't check by hand that the scroll check fails when something scrolls. |
||
|
|
76c6580ea6 |
gui: a skill group's agent chips count only the skills magpie decides, and a row's chip for one an agent reads from ~/.agents/skills itself is locked (#1862, WardLu)
A skill kept in ~/.agents/skills is had by every agent that reads that
folder itself (SkillView.Always), whatever is ticked. Its row's chip said
so only on a click, greyed like a chip that can't take the skill, while
the group's chip counted s.agents alone. Turning the group off for Codex
then said "off for Codex" and left the row lit.
What changed:
- groupChips (group headings, parts and the Select bar) counts, gives and
takes only the skills magpie decides for each agent. agents-some is
sent, per agent, the names it doesn't read itself, so a skill Codex
reads from the shared folder is never sent for Codex.
- A chip whose agent reads only some of them itself says how many, in its
tooltip. After a click, the status says "Codex still reads 1 of them
from ~/.agents/skills itself".
- An agent that reads every one of them itself has a lit, locked chip, as
the row's is. It sends nothing, and a click says why.
- The group's heading says "N in ~/.agents/skills", with a tooltip naming
the agents that read it, before any click.
- A row's locked chip is lit, with a small lock on its corner, rather
than greyed out at .35.
- Nothing deletes from the shared folder or touches another agent's
config. Servers and hooks keep their own reach rules unchanged.
- Strings in zh, zh-TW, ja and de. docs/subsystems/library.md (Skill
groups) says it.
What was run:
- New skill-group-shared.test.cjs, in Chromium and WebKit; en, zh, zh-TW,
ja and de; 640px and 1180px:
- heading note;
- partial chip tooltip;
- the locked row chip's opacity and its lock;
- the post sent, the status, and parents and rows agreeing after a
click;
- All;
- a fully locked group chip sends nothing;
- no sideways scroll.
22/22 pass, twice. It fails on the old code (no heading note; Codex is
sent mango too).
- group-skill-chips, skill-parts, skill-groups, shared-skills,
every-skill, library-all, i18n-keys, library-own-folder,
skill-repo-groups, library-pick-remove and library-null-agents pass in
both engines.
- pick-skills is red in WebKit on origin/main's own assets too, the same
as here. It is out of date since
|
||
|
|
e0ecf01610 |
mcpauth: an MCP server's own OAuth app is called back at Claude Code's http://localhost:<port>/callback, so an app made for Claude Code signs magpie in as it is (新v学员 on Discord)
What changed:
|
||
|
|
accc8c0903 |
library: an MCP server whose sign-in has no client registration (GitHub's) is signed in to as the user's own OAuth app (新v学员 on Discord)
What changed: GitHub's remote MCP server (api.githubcopilot.com/mcp/)
points to https://github.com/login/oauth, whose metadata has no
registration_endpoint, so magpie's sign-in, which always registered
itself (DCR), could never sign in to it. A server now carries an
optional OAuth app, `oauth: {clientId, clientSecret, callbackPort}`,
Claude Code's names for --client-id/--client-secret/--callback-port
(oauth.clientId in its .claude.json). mcpauth.StartWith signs in as
that app without registering: PKCE S256, a loopback callback
http://127.0.0.1:<port>/callback (any port unless callbackPort is set),
client_secret_post with a secret (basic only when the server lists
basic alone), "none" without one.
Without an app, a server with no registration endpoint now fails with
mcpauth.ErrNoRegistration, which says to make an OAuth app with the
vendor (GitHub's under Settings > Developer settings > OAuth Apps, with
http://127.0.0.1/callback) and give it under "OAuth app" in the editor.
The editor opens those fields with Client ID focused when that error
comes back. Filling them makes Sign in read "Save and sign in", and
Cancel asks before dropping them, as the earlier Cancel fix does.
GitHub answers token errors with 200 and {"error": ...}; tokenRequest
now reads a 2xx body with `error` as the error, and bad_refresh_token /
incorrect_client_credentials count as a dead sign-in as
invalid_grant/invalid_client do.
Secrets: the client secret sits in library.json like header and env
values. A backup without keys blanks it; WithSecrets puts this
computer's secret back only for the same client ID. No agent file is
given the app. The TUI editor, which doesn't show it, keeps it on save.
check() keeps it only on an HTTP server, requires a client ID when a
secret or port is given, and a port 1-65535.
Run (worktree at
|
||
|
|
55e81bce40 |
gui: Cancel in an MCP server's editor leaves the server as saved, after a Sign in too (新v学员 on Discord)
GitHub's remote MCP server, brought in from CC Switch with its token as an Authorization header: removing the header, picking Sign in, then Cancel (even with Discard asked and picked) left the header removed in library.json and every agent's file. Cause: Sign in calls ready(), which saved the whole form whenever its name, transport, URL or headers differed from the saved server. The sign-in (mcpauth.Start) uses only the name and URL, so the headers never needed saving for it. Now ready saves only when the sign-in is to another server than the saved one (new, name, transport or URL changed); the button then reads "Save and sign in" (zh, zh-TW, ja, de), and what it saved becomes the form's saved state, so Cancel doesn't offer to discard what is already written. Audited the page's other sheets for the same thing: the hook editor, paste-many, the server sheet, the skill how-to, By agent (Done only) and the confirm dialogs save nothing before their own Save. Env and command arguments in this editor only ever saved through Save; the new test covers them too. Run: - New mcp-editor-cancel.test.cjs: Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and 390 wide, 22/22 twice. Broken by hand each: the old headers-count rule, the saved state not updated after the save, and the button not saying it saves; each 0/11 in Chromium. - mcp-signin (updated for the new label), mcp-signin-health, library-mcp-health, library-mcp-copy-config, library-servers-bulk, library-env-refs, i18n-keys, ux-safety: pass. - library-mcp-tools and library-mcp-tool-switch have WebKit reds (the footer over the clicked switch) that come and go, 1 to 7 per run, the same with this commit's parent's assets. - Sandbox HOME, rebuilt magpie web: header removed, Sign in (GitHub answered with its no-registration refusal), Cancel, Discard: the header is still in library.json and ~/.claude.json, and no save request was sent. |
||
|
|
eb1fab34c7 |
library, gateway: an MCP server magpie is signed in to no longer shows "Signed in" beside "needs sign-in" (新v学员 on Discord)
What was wrong, reproduced in a sandbox HOME with mcpauthtest's fake OAuth server behind a sandbox magpie: - A server no agent has is checked only on a click (#1597). Clicked before its sign-in it said "needs sign-in"; after signing in, the page rechecked only servers in use, so the row kept that result beside the new "Signed in" tag. The page now rechecks any server it has a result for once its key (sign-in included) changed. - The check sent magpie's token but never renewed it on a 401, so an expired access token with a good refresh token read "needs sign-in" beside "Signed in". checkHTTP now renews once and asks again, as the gateway's relay does. - A server that refuses even a just-renewed token was still "Signed in". mcpauth.Rejected marks such a sign-in run out, from the check and from the gateway's /mcp/<name> relay; ServerHealth.SignIn carries the status back (only for a server magpie has a sign-in record for) and the row's tag turns to "Sign-in ran out". mcpauthtest.Fake gains RefuseTokens for the last case. Run: - go test -tags nogui ./internal/mcpauth/... ./internal/library ./internal/gateway (HOME and GOCACHE in scratch): ok. - gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on the touched packages: clean. - New TestCheckRenewsMagpiesSignIn, TestCheckSaysSignInRanOut, TestMCPProxyRefusedAfterRenewalRunsOut. Broken by hand: renewal removed from checkHTTP, Rejected removed from the check, and from the gateway; each went red. - New mcp-signin-health.test.cjs: Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and 390 wide, 22/22. Each of the two library.js changes reverted on its own: 0/11 in Chromium. library-mcp-health, mcp-signin and i18n-keys pass. - Sandbox repro before and after with the fake server: both cases now show one tag; forget+revoke shows "Sign-in ran out · needs sign-in". Not run: a real vendor's server refusing a renewed token; the fake stands in for it. |
||
|
|
a4385e0999 |
gui: the Library's Select bar removes the skills, servers or hooks picked, a whole group at once with its header's box (#1852)
What: Select's bar on the skills, servers and hooks pages gets Remove…
(red, beside Clear). It asks first, as Remove all does, naming the count
("Remove 3 skills?", or "Remove pack-a?" for one), and posts only the
picked names to the existing remove-all endpoints (RemoveSkills /
RemoveServers / RemoveHooks), so each goes exactly as its row's Remove
would: same backups, only magpie's own copies. A group's or part's header
box (already there in Select) picks the whole group, so an outdated group
goes in one step. Groups have no menu, so no "Delete group…" item was
added.
A name that wasn't removed stays picked, its row's second line shows
"Not removed: <error>" in red, the status names it ("notes removed ·
stuck wasn't removed: …"), and nothing reports success for it. When every
name fails the endpoint answers 400: the sheet stays open with its button
enabled again. The label stays "Remove…" whatever the count (the count is
beside it and in the sheet): "Remove 3…" rewrapped the bar at 440px in
ja and moved the box under the pointer (library-servers-bulk caught it).
No Go change: the batch removals already reported Unremoved per name.
Strings in zh, zh-TW, ja, de. docs/subsystems/library.md says it.
Run: new internal/gui/tests/library-pick-remove.test.cjs (Playwright
1.62.0, chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 390 px): group
box picks 3, Cancel posts nothing, Remove takes 3 and leaves the rest, a
partial failure keeps the failed one picked with its error, a total
failure keeps the sheet; every click checked for no scroll and nothing
moving. Red by hand: dropping every name from picked after a partial
failure, and dropping the partial-failure status. With it, both engines:
library-servers-bulk, library-hooks, i18n-keys, gui-de, gui-ja,
gui-zh-tw, click-scroll, group-pick-filter, remove-found-skill,
library-items, remove-all-skills: 60/60 pass. library-servers-bulk
chromium failed once in a parallel run, then passed 3/3 alone and 2/2 in
the same parallel run on this tree and on origin/main.
Not run: pick-skills.test.cjs is red in webkit (en, zh: the click on the
"pdf" row times out) on origin/main
|
||
|
|
e08902e79d |
agent, library: Hermes Agent's folder is %LOCALAPPDATA%\hermes on Windows, and rtk's installer is told it (新v学员 on Discord)
新v学员 runs magpie on native Windows. Library -> RTK -> Hermes Agent
failed with "rtk's installer didn't add its hook to Hermes Agent:
Config: C:\Users\admin\AppData\Local\hermes\config.yaml ...". magpie
hard-coded ~/.hermes. Hermes' own default
(hermes_constants._get_platform_default_hermes_home) is
$LOCALAPPDATA\hermes on win32 (~/AppData/Local/hermes when LOCALAPPDATA
is empty) and ~/.hermes elsewhere, with $HERMES_HOME overriding it.
rtk 0.51's resolve_hermes_home knows only $HERMES_HOME and ~/.hermes,
on every OS.
What changed:
- appdir.HermesHome / HermesHomeIn / HermesDefaultIn: $HERMES_HOME,
else Hermes' per-OS default. This is the one place that resolves it.
- agent: hermesIn (Agents-page model wiring) and hermesProfiles use it
through place.hermesHome / hermesDefault. A WSL distro keeps
~/.hermes (Linux paths, Windows env not read). The Agents-page wiring
was wrong on native Windows too: without HERMES_HOME it wrote
%USERPROFILE%\.hermes\config.yaml, which Hermes never reads.
- sessions.HermesDir uses it, so Windows sessions are found.
- library/rtk: the hermes spec reads and writes the agent's own folder
(a.Dir), and rtkSpec.env passes HERMES_HOME=<that folder> to
`rtk init -g --agent hermes --auto-patch`.
- Tests resolve the folder through appdir instead of home/.hermes. New
TestHermesDefault/TestHermesHome (appdir), TestHermesFolder (agent:
Windows default, profiles under it, WSL unchanged), and
TestRTKHermesHome (library, a fake rtk that behaves like 0.51).
- docs/reference.md and docs/subsystems/library.md describe the
Windows folder and the env.
Run:
- gofmt -l clean. go vet ./... on darwin, GOOS=linux -tags nogui and
GOOS=windows.
- darwin: go test ./internal/appdir ./internal/library
./internal/sessions ./internal/agent ./internal/tui.
- TestRTKHermesHome against the old rtk.go fails with the reporter's
exact message ("didn't add its hook ... AppData/Local/hermes/
config.yaml"), and its default subtest fails with HERMES_HOME="".
- Windows box (cross-compiled test binaries, testenv sandbox
USERPROFILE/LOCALAPPDATA): appdir Hermes tests, agent
Hermes|Reseat|Effort (incl. TestHermesFolder) and library Hermes|RTK
pass. TestRTKHermesHome skips there (shell fake). The sessions binary
failed only TestHermesMessageVisibility, because its testdata wasn't
copied to the box.
- Real rtk.exe 0.51.0 on the Windows box: with
HERMES_HOME=<sandbox>\AppData\Local\hermes it wrote the plugin there
and patched that config.yaml. Without HERMES_HOME it wrote
C:\Users\<user>\.hermes, ignoring a sandbox USERPROFILE (rtk asks
Windows for the home folder). That confirms the cause and the fix.
The stray folder it made on the test box was removed.
Not run: real Hermes on Windows (no install, and running hermes under
a temp HERMES_HOME rewrites the live launcher); the GUI suite; the full
go test ./... ; the reporter's own machine.
|
||
|
|
6ccf23efa6 |
gui: the Library's Backups button is at the top of every tab, after Library folder (Dade on Discord)
Dade: each Library tab's 备份 (Backups) sat at the very foot of the page,
under the whole list, and was hard to find. It is now a button in the
Library's head strip, on every tab (Instructions, MCP servers, Skills,
RTK). That strip stays at the top as the page scrolls. The button sits
right after 资源库文件夹 (Library folder) and looks the same: a small
glyph (a clock with a turning arrow, as macOS draws backups) and a label.
- It opens magpie's backups folder.
- Its tooltip keeps the sentence the foot had ("magpie keeps a copy of
every file before it writes it.") with the folder's path.
- It is disabled until the library has loaded, as Library folder is.
The foot line and its .lib-foot/.lib-link styles are removed. Two
messages that pointed to "Backups, at the foot of the Library" now say
"at the top", in all five languages. The page with no agents, which had
no foot, now has Backups too.
Run:
- library-backups-top.test.cjs covers chromium and webkit,
en/zh/zh-TW/ja/de, each of the four tabs, and browser 1000/420px plus
window 1000/800/560px. It checks the button comes right after Library
folder on the same line and looks the same, waits for the library, has
a label that doesn't wrap, has no left border, causes no sideways
scroll and nothing at the foot, opens the backups folder, and doesn't
move the page on click. 10/10 pass. Without the button appended, red.
- library-loading, library-discover-jump, library-all, library-items,
library-rtk-gain and library-own-folder pass (138).
- go test ./internal/gui -count=1 under a sandbox HOME: ok.
- mobile-web.test.cjs: the phone widths pass. Its desktop 900/1280
comparison with origin/main fails only on the library page (about 650
pixels: the new button in the strip). Its before/after screenshots show
nothing else changed, and it matches again once this is on main.
|
||
|
|
e3a497d7a2 |
library, gui: Hooks are a fifth Library category, kept once and written into each ticked agent's own hooks file (#1790, AllenReder)
What: the Library page has a Hooks tab beside Instructions, MCP, Skills
and RTK. A hook is a command, an event, an optional tool filter, a
timeout and the agents ticked for it. magpie writes it into each agent in
that agent's own file and shape:
Claude Code <claude dir>/settings.json hooks.<Event>[{matcher, hooks[]}]
Codex <codex home>/hooks.json same shape
Gemini CLI ~/.gemini/settings.json same shape, timeout in ms
Cursor ~/.cursor/hooks.json flat entries, version 1
Portable events (turn end, after a tool, before a tool, prompt sent,
session start) map to each agent's own name; "shell"/"edit" map to each
agent's own tool names. An agent's own event (codex:PermissionRequest,
cursor:afterFileEdit, ...) is offered too and given to that agent only.
Rows have agent chips (All first), Select + bar, and Remove all, like
skills and servers. An agent that can't take a hook has its chip greyed
with the reason: every agent but those four ("has no hooks magpie can
write"), an agent in WSL (not yet), and another agent for a native event.
The page also says when an agent has all hooks turned off
(disableAllHooks, hooksConfig.enabled=false, [features] hooks=false).
Why these choices (product call delegated to us): the four agents are
the ones with a documented, file-based command-hook API whose events line
up; others (OpenCode's JS plugins, dsh, ...) have no comparable file, so
they're named as unavailable rather than half-supported. Removal is
exact: Applied.Hooks records each entry as written (canonical JSON), and
only an entry still exactly as written is taken out; one the user edited
is theirs, and their own hooks beside it are never touched. A hooks file
that doesn't parse is a problem, never treated as empty or written over.
Codex keeps trust per hook in config.toml keyed by group position, so
taking a group out re-keys the user's trust for the groups after it
(codexRekey) instead of silently untrusting them. Carried bundles
(backup/WebDAV/S3) don't carry hooks in this first version.
Run:
- go test ./internal/library ./internal/gui (sandbox HOME): pass. New
hooks_test.go: each agent's shape; the user's edited entry stays and is
no longer recorded; an unparseable file is left alone and reported;
Codex trust moves with its groups; native events/unavailable agents;
hooks-off reported.
- library-hooks.test.cjs: 12/12 in chromium and webkit, at 440px, in en,
zh, zh-TW, ja, de; against the old library.js it fails (timeouts on the
missing tab). All 52 new strings translated in the 4 languages.
- library-loading.test.cjs expects the Hooks tab in its tab lists
(it failed on this change before; 6/6 now).
- Every library-*/skill-* GUI test in chromium and webkit: all pass but
WebKit timeouts in library-mcp-tool-switch/library-mcp-tools, which fail
the same on origin/main
|
||
|
|
d7a1fcd41a |
library, gui: a skill pack added a while ago is grouped whole, and the Skills head has Group again (White Immortal on Discord)
Of mattpocock/skills' 38 skills only 20 were grouped with the repository on the Library page; the rest sat under On this computer, and nothing could trace them again. Cause: installing from a repository again (noteFrom) grouped a library skill with it only when its SKILL.md was byte for byte the repository's. A pack added a while ago is mostly older copies: of the copies at mattpocock/skills 3cca18b3 (2026-09-04), 18 of 37 match HEAD; at 8b78b531 (2026-08-13) 2 of 35. The GUI's parts draw all 38 when the data has them (checked with a Playwright run against 38 skills in the repo's real folder layout, github, lock-traced and mixed paths, both engines). noteFrom now also notes a skill traced to nowhere by a name the repository has, when the library has others from that repository (same file, or traced there already). A skill traced to another repository, and a same-named skill when the library has nothing from there, are left alone. RegroupSkills (POST /api/library/skills/regroup) fetches each GitHub repository the skills are traced to and runs the same; it fails only when no repository could be fetched. The Skills head has Group again (busy while it runs, status says how many joined), en/zh/zh-TW/ja/de. Run: TestRegroupOlderCopies (fails with the name match off: edited and later stay ungrouped), TestInstallAgainNotesFrom, TestSkillRepoTraced; skill-regroup.test.cjs in chromium and webkit, en/zh/zh-TW/ja/de at 1100 and 440 wide (red on the old assets: no Group again); skill-parts and i18n-keys pass; go test -tags nogui ./internal/library ./internal/gui ok; gofmt, go vet. Not tried against the reporter's library or real GitHub. |
||
|
|
8902ec2179 |
library: a server that admits only the apps it lists says so at Sign in, and leaves the sign-in to each agent (#1619, Xichun123)
Figma's remote MCP server (mcp.figma.com/mcp) allow-lists clients by the client_name they register with: its registration endpoint (api.figma.com/v1/oauth/mcp/register) answered a plain registration named Magpie 403 with the bare body "Forbidden" (tried once, by hand). The Library's Sign in then showed "registering magpie with the server's sign-in failed (403): Forbidden", which reads as a fault to retry. magpie doesn't register under another client's name. A 401 or 403 from registration is now mcpauth.ErrClientRefused: the server's sign-in admits only the apps it lists and turned magpie away; the agents given it still have the server's own address, so each signs in itself (in Claude Code, /mcp). That address is what they already get while magpie isn't signed in (library.through), so Claude Code, a client Figma lists, signs in there with its own registration. The message is translated into zh, zh-TW, ja and de. Other registration failures keep their status and body. docs/subsystems/library.md says it. Run: TestSignInRefusedByAnAllowListLeavesItToTheAgents (new, through library.SignInServer against mcpauthtest serving Figma's 403 bytes) fails without the change with the reporter's exact "registering magpie with the server's sign-in failed (403): Forbidden", passes with it, and checks claude, codex and cursor keep the server's own URL. mcp-signin.test.cjs (Figma case added) passes in Chromium and WebKit, en and zh; gui-ja, gui-de, gui-zh-tw and i18n-keys pass. go test -tags nogui ./internal/mcpauth/... ./internal/library/ ./internal/gui/ ok under a temp HOME; gofmt -l clean; GOOS=linux and GOOS=windows go vet ok. Not tried: Claude Code's own /mcp sign-in to Figma (no Figma account here). |
||
|
|
16b5c8700f |
gui: a library MCP server no agent or project has isn't checked on its own; its status says "not checked" and a click checks it (#1597, xiaozhu1337)
Opening the Library's MCP tab started (or reached) every server in the library once a session to list its tools, the ones switched off for every agent too. Some users keep many servers in the library and turn on a few, and each unused one was still started. A server that no agent has, here or in a project magpie keeps (inUse), is now left out of that check. Its status reads "not checked", with the reason in its tooltip, and a click checks it, as a click already checks any other server again. Once an agent is given it, the page renders again and the server is checked as before. New strings in zh, zh-TW, ja and de. Verified: - library-mcp-health.test.cjs: a server on for no agent shows "not checked" and is not in the first check; one on only in a project still is; a click on it checks it alone (fresh) and opens no editor. Chromium and WebKit, en and zh. Without the library.js change it fails: the first check asks for "idle" too. - library-mcp-tools and library-mcp-tool-switch: their padding servers were on for no agent and relied on the old check, so they are on for Claude Code now; the tests are otherwise unchanged. - library-servers-bulk, mcp-signin, library-mcp-copy-config, project-servers, library-zed-mcp, search-mcp, gui-ja, gui-de pass in both engines. library-mcp-tool-switch times out in WebKit at load ~180 on some languages with and without this change (#1609, filed earlier). |
||
|
|
f1001ec991 |
library, gui: each of an MCP server's tools has a switch, and the agents that can leave one out are told to (nf1qaz2w on Discord)
nf1qaz2w asked to turn single tools of a Library MCP server on and off.
|
||
|
|
6f4fb883eb |
library, gui: an MCP server's tools are listed by name and description (nf1qaz2w on Discord)
nf1qaz2w on Discord: "mcp现在好像只能看到有几个工具,看不到具体的工具名和描述等, 能否支持下?" The Library's MCP check kept only len(tools) from tools/list. What changed: - internal/library/mcp_check.go: ServerHealth carries ToolList (json "toolList"): each tool's name and the first paragraph of its description, whitespace collapsed and cut at 500 runes (a tool with only a title gets the title); names cut at 128; at most 500 tools kept while Tools still counts all. tools/list is now asked through listTools, shared by the stdio, streamable HTTP and SSE checks: it follows nextCursor up to 10 pages, each page with a step budget of its own (the #1467 per-step timeout), and a page after the first that is refused ends the list there. Before, nextCursor was ignored and only the first page counted. - internal/gui/assets/library.js/.css: a server whose check listed tools shows a chevron on its "N tools" status; a click opens the list under the row (name in the code font, description under it, "N more not shown" when magpie kept fewer than the server has, and Check again). Clicking the count again shuts it. A server with no listed tools keeps the old click, which checks it again. The list stays while it is checked again, no editor opens, no left-border stripe, no native select. The click guard keeps the clicked status in place (a centred row gives up 1px as it grows). - i18n: "Click to see them", "Click to hide them", "{n} more not shown" in zh, zh-TW, ja, de. - docs/subsystems/library.md: the check's tool list and paging. There is no CLI/TUI output of a server's check, so nothing changed there. What was run: - go test ./internal/library: TestCheckKeepsToolNames runs the check on the tools/list reply @modelcontextprotocol/server-filesystem really gave (captured with npx, testdata/filesystem-tools-list.json, 14 tools, the longest description 457 chars); TestCheckToolPages (no description, title only, a 1000-char description cut, two pages by nextCursor, the JSON the page reads); TestCheckToolPagesEnd (a server that pages forever is asked 10 times). With the list not kept and paging off, the first two fail: "got {State:ok Tools:14 ToolList:[] ...}, want ok with 14 tools, each listed" and "...Tools:3 ToolList:[]..., want ok with 4 tools over 2 pages". - GUI: internal/gui/tests/library-mcp-tools.test.cjs, Chromium and WebKit, en/zh/zh-TW/ja/de, at 980 and 420 wide: 20/20 pass; against the old library.js it fails. library-*.test.cjs, mcp-signin, search-mcp, i18n-keys and click-scroll in both engines: 377/377 pass. - gofmt -l (nothing), go vet / GOOS=linux / GOOS=windows go vet -tags nogui on internal/library and internal/gui, go build for darwin, linux and windows (nogui). Full go test -tags nogui ./... under the queue lock: every package ok but internal/provider, where TestClaudeSavedAccountDir failed "sign-in never finished" (waitDone's 2s bound on a fake claude process under full-suite load); alone it passes 5/5. Not touched here. |
||
|
|
26816de2f9 |
library, agentplug: an agent a plugin adds is given the Library's instructions, MCP servers and skills where its agent.library says (AlmarionAI on X)
Agent plugins wired models and keys only: library.targetOf had no case
for them, so the Library's instructions, MCP servers and skills never
reached an agent a plugin adds, while the announcement said the
Library carries over.
An agent export can now say
library: { instructions, mcp, mcpFormat, skills }
each a path (~ and $VAR expanded, as config is). mcpFormat names the
agent whose MCP file it is shaped like (agentplug.MCPFormats: claude,
codex, gemini, opencode, cursor, zed, ... 18 of the library's
mcpFormats). A format outside the list, or an mcp without one, keeps
the plugin from loading. library.pluginTarget makes such an agent a
Target, so it is written as any agent is: magpie's marker block in the
instructions file, servers merged beside the user's own (their fields
kept), skills linked or copied, Applied recording only magpie's part,
backups kept. Takes refuses a place the plugin doesn't name, and says
which agent.library key would give it.
Docs: docs/subsystems/library.md and agent-wiring.md; plugins.html
(en, zh, ja) gets the library field and what magpie does with it.
Run:
- internal/library/agent_plugin_test.go: TestPluginAgentGetsTheLibrary,
TestPluginAgentWithoutAPlaceIsRefused, TestPluginAgentMCPFormat,
TestPluginMCPFormatsAreWritten. With targetOf's plugin case and the
check() validation taken out by hand, the first three go red.
- e2e: a nogui build in a scratchpad HOME (env -i, no live configs),
`magpie plugin add` of a throwaway toy agent plugin; `library
instructions set/agents`, `library mcp add/rm` wrote and took back
only magpie's block and server, the user's "mine" server, its "note"
field and other keys kept, backups made; with mcp dropped from the
plugin, `library mcp add ... agents=toy` is refused naming
agent.library.mcp.
- go test -tags nogui ./... (one unrelated FIFO flake in internal/agent,
fixed in the commit before), gofmt -l clean, go vet for GOOS=linux
and GOOS=windows clean. No GUI code changed.
|
||
|
|
177fbdfe28 |
library, gui: the agents a skill is installed for have an All chip, one click takes them all off (#1531, liuweifeng)
Installing a skill from a repository starts with every agent lit, so installing it for one agent alone meant unticking each of the others. The picker now has the All chip the library's skill and server rows already have (allChip): lit while every agent that can take it is lit, a click takes them all off, another puts them all back. Only this one is then All + that agent's chip, two clicks, with the same control as the rows rather than a new idiom. The same fix reaches every sibling picker that chooses agents before an item is added: the market's skill install, the MCP server editor (add and edit), pasting several servers, and the market's server install. No new strings: All and its tooltips are already in every language. The CSS sets All a little apart from the icons outside a row. docs/subsystems/library.md says so. Run: - new internal/gui/tests/skill-install-agents-all.test.cjs: Chromium and WebKit, en/zh/zh-TW/ja/de at 1100px and 420px, with the reporter's repository: All lit at first, All -> none, Codex -> install posts agents ["codex"]; All puts every agent back; the server editor's All too. 28/28 pass; on the old library.js/css 0/28. - the library's sibling GUI tests (by-agent, every-skill, group-skill-chips, library-*, market-have, market-featured-skill, pick-skills, project-servers, skill-install-skip, skill-name-many-agents, mcp-signin, import-all-skills) in both engines: all pass, except library-servers-bulk's known 2px flake (#1322), which fails the same way with this change reverted. - screenshots of the picker in zh at 1100px and de at 420px. No Go changed. |
||
|
|
5fb75d26cf |
agents: WorkBuddy AI, the international build, gets magpie's models in its own ~/.workbuddy-ai/models.json (#1494, ysicing)
WorkBuddy AI (www.workbuddy.ai, bundle com.workbuddy.workbuddy-ai) keeps its data in ~/.workbuddy-ai: its cli/product.json sets dataFolderName ".workbuddy-ai", and the custom-models reader (getUserConfigPath in 5.6.2's app.asar) takes ~/<dataFolderName>/models.json when WORKBUDDY_CONFIG_DIR isn't set. magpie only wrote ~/.workbuddy/models.json, the China build's, so the reporter's WorkBuddy AI never listed magpie's models although magpie said it was wired. WorkBuddy AI is now its own agent, workbuddy-ai, built from the same code as WorkBuddy (workbuddyBuild): its models.json in ~/.workbuddy-ai, a bare list as WorkBuddy writes one, under its own key (magpie-workbuddy-ai). WORKBUDDY_CONFIG_DIR stays WorkBuddy's, so the two rows never write one file. Its MCP servers and skills go to its own folder too (library target), and the library's "trust it in WorkBuddy" note names WorkBuddy AI when a server is given to it. README agent lists and docs/reference.md list it. Run: go test -tags nogui ./internal/agent ./internal/library ./internal/usage ./internal/gateway (sandbox HOME); new TestWorkBuddyAIWritesItsOwnFolder (writes ~/.workbuddy-ai only, China file untouched, env var ignored); GUI library-workbuddy-trust in Chromium and WebKit, en/zh/zh-TW/ja/de, red on the old library.js for the WorkBuddy AI case. A built magpie in a sandbox HOME lists "WorkBuddy AI ~/.workbuddy-ai/models.json", and `magpie workbuddy-ai provider magpie` wrote deepseek/deepseek-chat there with key magpie-workbuddy-ai and no ~/.workbuddy. Not tried in the WorkBuddy AI app itself (needs a signed-in account); the path is read from the installed 5.6.2's own code. gofmt -l, GOOS=linux/windows go vet clean. |
||
|
|
69c47c9e57 |
library, gui: the Library page is drawn at once from a glance, and the agents' own skills and out-of-date copies come in after it (#541)
Even with the memo, the first read after skills change still reads them through, and before this the page showed only its outline until the whole read was done (0day404, #541: minutes on Windows). library.Glance (GET /api/library?glance=1) is the view without FoundSkills and the skills' Behind, marked partial. The page asks for it first, draws it, then asks for the whole read. The Skills tab shows "In your agents · Looking through the agents' skill folders…" (aria-busy) until the whole read comes. The other tabs aren't drawn again for it. A whole read that a change answered first is dropped (take() counts the answers), so it never draws an older library over a newer one. Read now runs behind and foundSkills after letting go of the library lock, so a change doesn't wait on them either. New strings in zh, zh-TW, ja and de. docs/subsystems/library.md describes the memo and the glance. Tests: - TestGlanceLeavesOutTheAgentsSkills (Go). - library-loading.test.cjs: drawn from the glance, the wait row, then the found skill, with reads glance then read. Chromium and WebKit, 980 and 420px. Red on the old library.js. Run: go test -tags nogui ./internal/library ./internal/gui; node --test for library-*.test.cjs, skill*.test.cjs, gui-ja, gui-de and i18n-keys in both engines; gofmt; vet on darwin, linux and windows. |
||
|
|
61aa681e60 |
library: an MCP server, or the servers picked, are copied as an agent's project file has them, to paste into a project magpie doesn't keep (#1478, xiaozhu1337)
A project's MCP servers could only be given by adding the project to
magpie first. For a one-off (add them, then let the project keep them),
that is a detour. Now the servers page's Select bar, and a server's
editor, have Copy config…: a menu of the agents that read a project's
servers from a file (Claude Code .mcp.json, Codex .codex/config.toml,
Gemini, Cursor, OpenCode, ZCode, Pi), each with its file. A pick puts
that file's text on the clipboard and the status says where to paste it.
What changed:
- library.ConfigOfServers(agent, names): the servers written by the same
code a project of magpie's is written with (mcpFile.put, through() for
one magpie is signed in to, the agent's own variable syntax) into a
fresh file in a temp folder, read back and removed. Nothing in the
user's files is written. A server the agent can't take there (SSE for
Codex or Pi, a ${VAR} it can't read) is left out and named, as a
project's sync leaves it out.
- POST /api/library/mcp/config answers {file, text, skipped}.
- library.js: copyConfigButton in the pick bar and the editor's bar;
strings in zh, zh-TW, ja, de.
- docs/subsystems/library.md says so.
Run:
- TestConfigOfServersIsTheProjectFile: for every agent in
projectMCPFiles, the copied text equals byte for byte the file magpie
writes into a fresh project with the same servers, the servers left out
are those supports() refuses, a signed-in server is the gateway's
/mcp/<name>; with through() taken out it fails.
- library-mcp-copy-config.test.cjs in Chromium and WebKit, en/zh/ja/de at
440px: the menu's agents and files, the post, the clipboard text, the
left-out status, nothing copied when nothing fits, the editor's button;
no sideways scroll. The library and project GUI tests that draw the
pick bar or the editor (18 files) pass in both engines.
- go test -tags nogui ./internal/library/ ./internal/gui/ under a temp
HOME; gofmt -l; GOOS=linux and GOOS=windows go vet -tags nogui.
- Not clicked in a running magpie window; the page against a faked API
and the library code under a sandbox HOME only.
|
||
|
|
91581fca27 |
library: a WSL agent under NAT is given a signed-in MCP server with the LAN key, so the gateway no longer answers its every call 401 (#1488, ggbdpq)
A server magpie signed in to (#615) is given to the agents at the gateway's /mcp/<name>, at the address each reaches the gateway at. A WSL distro under NAT reaches it at Windows' address, so its requests come from another machine, and lanGuard refuses such a request without an enabled gateway key with a 401, which an MCP client takes for the server asking it to sign in. through() gave it no key. Its models already carry the LAN sharing key there (keyAt, whqtian on Discord); the relay didn't. The gateway's checks are unchanged: a request from another machine still needs the key, and mcpProxy still lends a sign-in beyond loopback only to a request that carried it (sharedWith). What changed: - agent.KeyAt exports keyAt: the LAN sharing key for an agent that reaches the gateway from another machine while sharing is on, else gateway.Token. - through() gives such an agent Authorization: Bearer <that key>. The gateway takes it in lanGuard, and mcpProxy drops Authorization for magpie's token, so the server never sees it. An agent on loopback, and one in WSL while nothing is shared, stay keyless. - access.LANChanged runs after sharing is turned on or off or its key is made anew; the library syncs again then when it relays any server, so the entry carries the key there is now without a visit to the Library. - docs/subsystems/library.md says so. Run: - TestSignedInServerCarriesKeyBeyondLoopback (library: a FakeWSL distro routed via 172.20.0.1, LAN on) fails on the old through() ("claude@wsl: Ubuntu under NAT is given headers map[X-Team:acme], want the LAN key as its Authorization") and passes now; with the LANChanged call commented out it fails at "after a new key ... is given" the old key. - TestMCPProxyFromWSLWithLANKey (gateway, through lanGuard as the server runs it): 401 without the key and the server not called, 200 with it, the server gets magpie's token and never the key. - go test -tags nogui ./... under a temp HOME; gofmt -l; GOOS=linux and GOOS=windows go vet -tags nogui on the touched packages. - Not tried on a real Windows + WSL NAT machine with a real OAuth MCP server; FakeWSL and httptest only. Patch by ggbdpq in #1488; the LANChanged resync added on top. Co-authored-by: ggbdpq <ggbdpq@gmail.com> |
||
|
|
c78974407b |
library: an MCP server's check gives each step its own budget, 60s for a URL, says which step went unanswered and for how long, and doesn't keep a timeout for the session (#1467, xiaozhu1337)
xiaozhu1337's remote MCP servers are slow but healthy: initialize took 0.6-12s, notifications/initialized 0.7-3.5s and tools/list 38-53s. The check had one 15s budget for all of it (checkTimeout), so every such server showed "no answer", and CheckServers kept that first result for the session. Now each step (initialize, notifications/initialized, tools/list; connect for an SSE server's stream) has a budget of its own: remoteStep 60s for a URL, stdioStep 30s for a command (was 15s for the whole check). The timer is reset as each step starts (stepTo). A timeout says its Step and how long it Waited (ms), and the row reads "no answer to tools/list", the tooltip "No answer to tools/list in 60 seconds". A timeout isn't kept, and it drops an earlier answer kept for the server, so the next look (or a click on the status, as before) asks again. Strings in en, zh, zh-TW, ja and de; the old "No answer in 15 seconds" is gone. No per-server setting: the per-step budget covers the reported timings. Run: - TestCheckSlowRemoteServer, TestCheckTimeoutNamesTheStep, TestCheckTimeoutAskedAgain (new): fail on the old code (one budget: the 2.9s server times out at initialize; the step is always initialize; a timeout, and an earlier ok after a fresh timeout, are served from the cache), pass now. The rest of TestCheck* pass. - go test -tags nogui ./... under a temp HOME: all ok. - gofmt -l: clean. go vet (darwin, GOOS=linux, GOOS=windows) on internal/library and internal/gui: clean. - GUI: library-mcp-health (status names the step, stays one line within 220px), i18n-keys, gui-ja, gui-de in Chromium and WebKit: 13/13 pass. - Real use: `magpie web` on 127.0.0.1:3783 under a scratch HOME, a library server on a fake streamable HTTP MCP on 3784. POST /api/library/mcp/check: at 8s/2s/45s it is ok with 7 tools (55s); with tools/list at 70s it is timeout, step tools/list, waited 60000 (62s); then at the reporter's slowest 12s/3.5s/53s a non-fresh check asked it again and got ok with 7 tools (68s). |
||
|
|
e04824714d |
library: a skill's templates and other big files go with a backup and a sync (Crispin)
Crispin on Discord (#help): a skill's template files, a PPT among them,
didn't reach the other computer. Collect read each skill file with a 2 MB
cap and left everything bigger out, so a .pptx template with its pictures
never travelled. Links, copies and WSL copies on one computer already carry
every file (copyDir and hashFiles have no filter); only the backup/sync
carry dropped them.
- A file goes up to 16 MiB, all skills together up to 32 MiB. A sealed
backup is JSON with the bytes base64'd twice (~x16/9), and a sync reads
at most 64 MiB of one, so 32 MiB raw is what still fits.
- readSkills fills that budget smallest file first across every skill, so
one skill's big file never keeps another skill's SKILL.md from coming.
- What is left out (Left) and the computer being put to already has is
kept (keepLeft): a Put no longer sets the folder aside without it. A Left
name is checked like a carried one.
Run:
- New tests fail on the old code: TestCarryTemplates (template left),
TestCarrySmallFirst (zzz's notes.md left), TestCarryKeepsWhatWasLeft
(the local file went), TestSkillTemplatesTravel (0 bytes of 6291456).
Pass on the new. TestSkillTemplateReachesEveryAgent covers link, copy
and WSL copies of a pptx.
- Break check: maxCarriedAll = 48 MiB makes TestSkillTemplatesTravel fail
("the backup is 64 MiB, more than a sync reads").
- Real use: built nogui binary, sandbox HOMEs, a real 2.8 MB and a real
14 MB .pptx in a library skill, `magpie backup` then `restore
--no-agents` on another HOME: sha256 identical both times.
- go test -tags nogui ./... (temp HOME, pinned caches): all ok.
- go vet (darwin, GOOS=linux, GOOS=windows) on internal/library and
internal/backup; gofmt -l clean.
|
||
|
|
c4476d5658 |
library: skills from GitHub are checked as the skills page opens, and one changed here is marked and asked about before an update replaces it (#1449)
YangZhiqiang98 asked (#1449) that the Library find which skills have updates and update them. magpie already checked skills from GitHub (a market install among them) by hand and could update them, but an update deleted the library's folder, so a skill the user had changed (by hand, through an agent's link, or in an agent's copy not yet taken in) was lost without a word, and nothing checked unless the user pressed Check. - A skill is "changed here" when its library folder no longer hashes to what was fetched (Finder's .DS_Store aside), or an agent's copy was edited since its mark and not yet taken in (editState, skill_changed.go). The view says so (SkillView.edited) and the row shows "Changed here". - UpdateSkill refuses such a skill with *EditedError unless told to replace it. The row's Update asks in the page first (Keep mine / Update; Update sends replace). Update N, the group's Update N and the CLI's update-all leave it as it is and say so. The CLI takes `magpie library skill update <name> --replace-edits`. - The version an update replaces is moved to the backups when it was changed, or when it can't be told (a skill with no hash from before). - View.checkDue: no check since magpie started, or none for 12 hours. The page then runs the check once by itself as the skills open, and says only what there is to update or add. Not checked, by design: skills the skills CLI manages (`npx skills update` updates them; magpie only groups them), linked local folders, skills imported from an agent with no source, and From-only skills have no remote; CC Switch-installed skills can still be updated by hand. Verified: - go test -tags nogui ./... (sandbox HOME); new TestUpdateKeepsASkillChangedHere, TestUpdateKeepsACopyEditedInAnAgent, TestUpdateKeepsWhatItCantTell, TestCheckDue, TestCheckSkillsMarksItDone, all from httptest. With editState forced to "not changed" the first three fail. - gofmt -l, go vet, GOOS=linux and GOOS=windows go vet -tags nogui on ./internal/library ./internal/gui ./internal/tui . - GUI: new skill-update-edited.test.cjs (Chromium and WebKit, 860 and 400px, en and zh; no scroll on click; fails with the row's ask removed), plus the 22 other library skill tests, gui-ja, gui-de, gui-zh-tw, i18n-keys and click-scroll: 262 pass. - Real use in a sandbox HOME with github.com/anthropics/skills: installed pdf and docx, the real check said both current; an edit through Claude Code's link was refused by `skill update pdf`, skipped by `skill update` (docx updated), replaced by `--replace-edits` with the edit in backups/<time>/library/skills/pdf; docx edited later shows edited, a .DS_Store doesn't. |
||
|
|
599d784f59 |
library: magpie-image runs this computer's magpie, whatever path another computer or an old install saved (#1439, dawn1095)
magpie-image was kept in library.json with one computer's magpie by full path (os.Executable at install). A WebDAV sync carried C:\Users\...\Downloads\magpie-windows-amd64.exe to a Mac (and a Mac's app to Windows), and a magpie moved out of Downloads left its old path behind: the Library page said it couldn't start, and agents were given a program that isn't there. - heal (self_here.go): a server that is magpie's own -- `mcp ...` run by a program named magpie (magpie, magpie.exe, magpie-<os>-<arch>[.exe]) -- whose program isn't an existing absolute path here is pointed at this magpie, as the library is read (load) and after every change (so a bundle Put from another computer is healed before it is written into the agents). Every agent writer, project MCP files, the WSL side and CheckServers read through load, so all of them get it. A magpie program that does exist here (another build) and any server run by another program are left as they are. - Collect carries magpie's own server as plain "magpie": two computers with the same library carry the same bundle, so davsync's library hash matches and a sync doesn't write one's path over the other's. - The path given is update.Program (exported cliProgram): the AppImage rather than its mount, Homebrew's opt link rather than the Cellar. - TestWSLMagpieImage now says which magpie this (simulated Windows) computer runs. Verified: - New tests: TestOwnServerFromElsewhereRunsThisMagpie (Windows path read on macOS, a Mac path, an exe moved out of Downloads, a bare "magpie"), TestUsersOwnServerStaysAsItIs, TestCarriedOwnServerIsEachComputersMagpie. Broken by hand five ways (heal off; no heal in change; no marker in Collect; ownServer matching every server; existing magpie builds not kept) -- each went red with a FAIL naming the behaviour, green restored. - gofmt -l clean; go vet -tags nogui ./...; GOOS=linux and GOOS=windows go vet (library, update, davsync); go build, GOOS=linux -tags nogui and GOOS=windows builds; go test -tags nogui ./... green in a sandbox HOME. - Sandbox app (own HOME, ports 3561/3562) seeded with a library.json holding the reporter's Windows path for magpie-image plus a user's own missing Windows tool: on start library.json, Codex's config.toml and Claude Code's .claude.json got the running binary; /api/library/mcp/check answered magpie-image ok with 3 tools, the user's server unchanged and notfound. Not verified: on the Windows box, or a real two-computer WebDAV sync. |
||
|
|
059171006b |
library: DeepSeek Harness is given a server's ${NAME} as a !!js expression it reads from its environment (#1435, CnsMaple)
A Library MCP server whose headers or env named a variable as ${NAME}
(#1250) was refused for dsh, because dsh had no reference syntax in
refsOf. dsh does have one: a YAML !!js value is evaluated as the row
activates (dsh 0.2.0-rc.2: cordis-plugin-include's entryListSchema
reads the tag, quoted or not; cordis-plugin-loader's interpolate
evaluates it across the whole config), and dsh-mcp-client's README uses
GITHUB_TOKEN: !!js process.env.GITHUB_TOKEN. A stdio server needs it so:
it inherits dsh's environment without credential-shaped names
(scrubbedParentEnv).
What magpie writes now (refsOf fmtDsh -> refDsh, dshRef):
- a whole ${NAME}: !!js process.env.NAME (bare, as the README has it)
- text mixed with variables: the text as JSON string literals joined
with (process.env.NAME ?? ""), YAML-quoted. The user's text is only
ever inside a JSON string literal, so nothing in it runs as code, and
NAME is the envRef pattern [A-Za-z_][A-Za-z0-9_]*. An unset variable
inside a mixed value is "", not "undefined".
dshUnref reads exactly those forms back as ${NAME}, so an entry magpie
wrote reads as same and a sync changes nothing; any other !!js still
keeps the entry the user's (hasJS), as before.
The reporter asked for the value to be resolved into a literal when the
file is written. This writes a reference instead, keeping #1250's rule
that the token never lands in an agent's file as plain text. dsh
evaluates it from its own environment at load time. Their side note
that a quoted !!js isn't evaluated is not what dsh 0.2.0-rc.2 does: its
own --dump-config prints !!js quoted, and the quoted forms evaluated in
the run below.
Since AgentView.NoEnvRefs comes from refsOf, dsh's chip is no longer
greyed and the GUI notice drops it with no string change.
docs/subsystems/library.md says what dsh gets.
Run:
- real dsh 0.2.0-rc.2 `dsh headless` in a sandbox (HOME and DSH_HOME
under a scratch dir, never ~/.dsh), on a cordis.patch.yml written by
magpie's mcpFile: a stdio fixture got T1435_A=<token> (whole) and
"Bearer <token>" (mixed); an injection string with quotes, backticks,
${, backslashes and "'); process.exit(3); ('" arrived verbatim; an
unset variable in a mixed value gave "pre--post"; a streamable-http
fixture received Authorization: Bearer <token>, the whole-variable
header and the literal header. magpie read every entry back as same.
A whole !!js process.env.UNSET makes dsh leave the server out as an
invalid config.
- go test -tags nogui ./... (temp HOME, pinned caches): green.
- break by hand: refsOf without fmtDsh, encode writing raw values, and
decode not unref'ing each make TestEnvRefsDsh fail (decode also
TestDshImportKeepsJS).
- gofmt -l; go vet ./...; GOOS=linux and GOOS=windows go vet -tags nogui
./internal/library; go build for darwin, linux and windows (nogui).
Not run: dsh on Windows (the reporter's system), and a real LLM turn
calling a tool through the server (no dsh account in the sandbox; the
MCP servers had connected before dsh stopped for its missing LLM
credential). No GUI test was run, as no GUI file changed.
|
||
|
|
2c1b593675 |
library: Zed takes MCP servers, in its settings.json context_servers (lc on Discord)
lc on Discord ("agent未识别到zed"): the MCP server editor's agent chips
had no Zed. magpie already edits Zed's settings.json for its model, and
Zed reads its MCP servers from context_servers in that same file, so Zed
is now an MCP target like the other agents.
What Zed takes, from its own source (zed-industries/zed 2c99f547):
- crates/settings_content/src/project.rs ContextServerSettingsContent is
untagged: a command as command/args/env (enabled, remote, timeout
beside it), a url as url/headers (enabled, timeout, oauth), or an
extension's entry as settings. docs/src/ai/mcp.md writes the same.
- crates/context_server/src/transport/http.rs only POSTs (and DELETEs):
streamable HTTP, no SSE. So an SSE server is refused for Zed and its
chip is greyed with the existing reason (AgentView.NoSSE).
- stdio_transport.rs hands command.envs over as written and http.rs sends
headers as written: no ${NAME}. Zed is refNone, so a server naming a
variable is refused and its chip greyed (AgentView.NoEnvRefs).
Changes:
- targets.go: "zed" gets mcpFile{agent.zed's settings.json, fmtZed}; the
path is agent.zed's for every OS (~/.config/zed, $XDG_CONFIG_HOME/zed,
%APPDATA%\Zed, $MAGPIE_ZED_CONFIG_DIR).
- mcp.go: fmtZed under "context_servers", encoded as Cursor/Desktop are;
magpie owns url/headers/command/args/env only, so enabled, remote,
timeout and oauth the user sets on magpie's entry stay. The file is
JSONC and edited in place (edit.SetJSON/DelJSON), so comments, other
settings and the user's own servers are kept.
- mcp.go, sync.go: an entry Zed's extensions configure (settings, no
command or url) is never written over: a library server by that name
is a Problem for Zed (errZedExtension), asking for another name.
- envref.go: a comment citing why Zed has no syntax.
- docs/subsystems/library.md: Zed's file, format, no SSE, no ${NAME},
the extension guard, and the new tests.
Tests:
- internal/library/zed_mcp_test.go TestZedMCP, on a Zed-style JSONC
settings.json with comments, trailing commas, a user stdio server
(enabled:false, timeout), a user remote server and an extension's
entry, at the default path and under MAGPIE_ZED_CONFIG_DIR: found
servers, the page's chips, written entries, SSE/${NAME}/extension
refusals, user keys kept through an edit, uncheck and remove leaving
only the user's, comments kept, a Sync rewriting nothing.
- internal/gui/tests/library-zed-mcp.test.cjs: Zed's chip on every row
and in the editor, a click gives it the server, greyed with the reason
for SSE and ${NAME}; Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and
560px, no sideways scroll. No new strings.
Broken by hand, each went red and was restored: no zed target, no
extension guard, SSE allowed, enabled owned by magpie, wrong key (Go);
Zed without noSSE (GUI).
Run (temp HOME, Go caches pinned): gofmt -l internal/ (clean); go vet
-tags nogui ./... on darwin, GOOS=linux and GOOS=windows; go vet
./internal/library ./internal/agent; go build ./..., GOOS=linux go build
-tags nogui ./..., GOOS=windows go build ./...; go test -tags nogui ./...
(all ok); node --test library-zed-mcp.test.cjs (22/22, both engines).
Not verified: a real Zed reading the written file (the live
~/.config/zed was never touched); Linux and Windows beyond vet/build;
Zed found in WSL (not in ownFolder, so no MCP target there); a
project's .zed/settings.json (not added).
|
||
|
|
d9caa3dd13 |
library: Hermes Agent in a WSL distro takes skills and MCP servers there, and so does every other WSL agent that keeps them in its own folder (omp, OpenCode, MiMo Code, Droid, Grok Build, Command Code, AtomCode, Qoder, MiniMax Code, fx, dsh) (#1323, Kevinzz224)
wslTargetOf knew only Claude Code, Codex, Pi and OmO, so hermes@wsl:Ubuntu
was never a Library target and a skill meant for it could only go to
Windows' ~/.hermes. An agent whose places are all its own folder (a.Dir,
or beside a.Path) now gets the target targetOf makes on this machine, at
the distro's home the agent was found with: copies for skills, its MCP
file marked as WSL's (a Windows program is refused, magpie's own image
server goes by its WSL path), and the skills it reads besides its own are
the same distro's agents'. Agents whose places depend on this machine's
variables or home (Kimi Code, Crush, Cline, CodeBuddy, Goose) stay out.
Run: TestWSLOwnFolderTargets fails without the change (hermes@wsl,
omp@wsl, droid@wsl, opencode@wsl aren't targets; no copy of the skill),
passes with it. go test -tags nogui ./internal/library ./internal/agent
under a temp HOME on macOS (library ok; agent's TestFolderVarsAreListed is
red on main since
|
||
|
|
56d1665251 |
library: a skill an agent has of its own is removed from every agent that has it, from its row under "In your agents" (trash) or with d twice in the TUI, without bringing it into the library first (#1303, sxwedo)
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. |
||
|
|
e387c5a2ed |
library: Alma takes the Library's MCP servers, in ~/.config/alma/mcp.json as its own MCP settings write them (#1292)
Alma 0.4.164 (read from a copy of its app.asar, out/main/index.js) reads
its servers from <home>/.config/alma/mcp.json on every system, as
{mcpServers:{name:{command,args,env} | {url,headers,transport?}}}: a
server with a url is streamable HTTP falling back to SSE, and SSE only
when transport is "sse". It has no ${VAR} expansion, so a server naming
a variable is refused for Alma as for Kimi or Devin. Alma reads the file
as it starts and when its MCP settings refresh; there is no watcher.
The user's own servers (the real file's computer-use entry with
ELECTRON_RUN_AS_NODE) are kept: TestAgentMCP's alma case writes one
first. Without the change TestAgentMCP/alma fails ("alma has no MCP
target") and TestTakesRefusesAlma refuses mcp.
Run: HOME=<temp> go test -tags nogui ./internal/library ./internal/agent;
go vet for darwin, linux and windows. Not tried with a running Alma.
|
||
|
|
c28a819a8e |
library: an agent that can't be given instructions, skills or MCP servers says where they go instead and lists the agents here that take them: OpenChamber has OpenCode's (give them to opencode), Claude Desktop keeps its instructions in its own settings and its Code tab reads Claude Code's (MOMO on Discord)
OpenChamber's server reads the global AGENTS.md, skills folder and opencode.json from OpenCode's config folder (openchamber/openchamber packages/web/server/lib/opencode/shared.js at 866dffd), so no path of its own is added; a second target on the same files would write them twice. Verified: TestTakesSaysWhereInstead fails on the old Takes with "Claude Desktop has no user-wide place for instructions that magpie knows of"; internal/library passes in a sandbox HOME. |
||
|
|
d1fca72f69 |
library: the Library's MCP servers go to WorkBuddy and CodeBuddy Code (#1266)
WorkBuddy had skills only, and CodeBuddy Code had no library target at all,
so their MCP chips could not be switched on.
WorkBuddy 5.5.6 (app.asar) reads ConnectorService.customMcpConfigPath:
$WORKBUDDY_CONFIG_DIR, then $CODEBUDDY_CONFIG_DIR, then ~/.workbuddy, plus
mcp.json, as {"mcpServers": {...}} in Claude's shape. It connects a server
only once the user has switched it on in its MCP settings
(mcp-approvals.json, module.app-server.js). magpie doesn't write that
approval. Instead, the servers page tells the user to switch it on once,
in en/zh/zh-TW/ja/de.
CodeBuddy Code 2.162.0 (PathUtils.resolveMcpFilePath) reads the first of
<dir>/.mcp.json, <dir>/mcp.json and <base>/.codebuddy.json that exists.
<dir> is $CODEBUDDY_CONFIG_DIR or ~/.codebuddy. The file holds mcpServers
in Claude's shape, and ${NAME} is expanded (McpConfigEnvExpandService).
User scope needs no approval. Skills go in <dir>/skills.
Verified: the real CodeBuddy Code 2.162.0 CLI, in a sandbox HOME, read
SaveServer's file back with `mcp get` and `mcp list`. That covered stdio
with ${MY_TOKEN} expanded, http and sse, and the user's own entry and
disabledMcpServers were kept. WorkBuddy.app was not run; its side is
from its code.
Tests: TestAgentMCPFiles (4 new cases) and TestCodeBuddyMCPFile fail
without targets.go. library-workbuddy-trust fails without library.js.
Run: go test ./internal/library ./internal/gui; go vet for darwin, linux
and windows; in Chromium and WebKit: gui-ja, gui-de, gui-zh-tw, i18n-keys,
click-scroll and all library-* GUI tests.
|
||
|
|
db0feb3615 |
library, gui: a remote MCP server's headers and a command's env can name ${NAME}: the library keeps the placeholder and each agent gets its own syntax, so the token is never written into an agent's settings (#1250)
The library keeps `${NAME}` as typed. refsOf (internal/library/envref.go)
gives each MCP format the agent's own syntax, with the source beside each:
${NAME} for Claude Code, Droid, Grok, Gemini, Crush, Copilot, Pi, OmO, omp,
Qoder, AtomCode, Hermes and Command Code; {env:NAME} for OpenCode and MiMo;
${env:NAME} for Cursor; Codex's bearer_token_env_var, env_http_headers and
env_vars; Goose's ${NAME} plus env_keys. An agent with no syntax (Claude
Desktop, Antigravity, Kimi, Cline, ZCode, dsh, Devin, Pi with
pi-mcp-extension) is never given such a server: supports() refuses it with
the reason, an entry magpie wrote before is taken out, and its chip is
greyed with the reason on the row and in the editor. Codex's and Goose's
extra keys are magpie's only while the server names a variable, so the
user's own env_vars / env_keys stay. The editor says how to write one under
Headers and Environment; a check whose variable isn't set where magpie runs
says which one ("GH_TOKEN not set").
Verified:
- go test -tags nogui ./... (sandbox HOME): all ok.
- New TestEnvRefs* (per-agent encode/read-back, left-out agents, library
keeps the placeholder, user values kept, health check novar) fail with
the behaviour turned off (refsOf -> ${NAME} for all, no refsProblem /
refKeys, no expansion).
- library-env-refs.test.cjs (Chromium + WebKit, en/zh/ja/de at 440px)
fails on the old library.js (4/4 subtests); gui-ja, gui-de, i18n-keys,
library-servers-bulk, library-all, by-agent, project-servers,
library-mcp-health, library-null-agents, library-items: 109/109 pass.
- Real: magpie built from this tree synced a library server with
Authorization: Bearer ${FAKE_MCP_TOKEN} and X-Api-Key: ${FAKE_KEY} into a
sandbox HOME, then against a fake MCP on 127.0.0.1:3561 that answers only
the right bearer: Claude Code 2.1.293 `mcp list` Connected, Gemini CLI
0.62.0 Connected, Codex 0.160.1 app-server listed the tool (authStatus
bearerToken), cursor-agent sent both headers expanded; no agent file held
the token. Antigravity got the Problem and no entry. Not run for real:
OpenCode (its mcp list goes through the user's background service),
Goose, Crush, Copilot and the rest; their syntax is from their source.
- go vet (darwin, GOOS=linux, GOOS=windows) for internal/library and
internal/gui.
|
||
|
|
9dc0121f90 |
library: installing a set of skills skips the ones in the way and installs the rest; the toast names the ones already in the library and the ones skipped (lc on Discord: 安装skills的时候,没有跳过已经安装的)
installFrom stopped the whole set at the first skill whose name was taken,
and returned before change saved library.json. The folders it had already
copied for the skills before that one stayed in the library's folder,
unlisted. Every later try then failed on the first of them with "the
library's folder already has a caveman-commit in it".
Now each skill is installed on its own (InstallSkills, InstallMarketSkill
and AddNewSkills, through installChange):
- the library lists it from the same source: had already (Result.Had),
nothing written, so the user's edits stay;
- a folder in the library's folder holding exactly its files (not a link,
sameTree, which counts a failed read as different): listed where it is,
as had;
- another skill by that name, listed or only a folder, or a folder that
can't be read: left as it is, in Result.Skipped with why;
- the rest are installed (Result.Installed). Only when nothing was
installed or had does the change fail, with the first reason.
The GUI's toast and the TUI's line say how many were installed, the ones
already in the library and each one skipped with why.
Verified (temp HOME, pinned caches):
- go vet -tags nogui ./internal/library ./internal/tui ./internal/gui .;
GOOS=windows go build and GOOS=linux go build -tags nogui of
internal/library and internal/tui: clean
- go test -tags nogui ./internal/library ./internal/tui ./internal/gui: ok
- with the old skills.go, market.go and skillnew.go, TestInstallSetSkipsOneInTheWay,
TestInstallListsItsOwnLeftoverFolder (fails with lc's exact "the library's
folder already has a caveman-commit in it") and
TestInstallSetSkipsAnotherByTheSameName FAIL; TestSkillsFromGitHub's
reinstall now asserts Had
- skill-install-skip.test.cjs (Chromium + WebKit, en and zh at 440px) fails
on the old library.js ("status ok", no names) and passes now; with
gui-ja, gui-de and 11 library GUI files, 99/100 passed, and the one that
failed (by-agent, Chromium, at load average ~150) passes 3 times in a row
in both engines when run alone
- not tried in the real app, or with lc's library
|
||
|
|
bc7c62dc11 |
library: the skills market offers magpie's own magpie-quota skill first, marked official, so an agent can read what is left of every subscription, plan and key (magpie quota --json) and wait for allowance (magpie quota wait); it lives in magpie-community/plugins, and its card shows no installs or skills.sh link until skills.sh lists it (ttmouse on X: magpie quota works, suggested an official skill to go with it)
Verified: TestFeaturedSkills; market-featured-skill.test.cjs, Chromium and WebKit, en/zh/ja/de at 520px, 8 pass (4 fail on the old library.js); market-have and skill-online-local pass (34); a livemarket-tagged run of InstallMarketSkill in a sandbox HOME fetched the real skill from GitHub into the library; npx skills add magpie-community/plugins -l lists it. go test ./...: all pass but TestSetAnswersWhileDevinAndProvidersHang (2.8s under two other -count=5 suites); alone -count=5 passes. |
||
|
|
92469ee9f9 |
library, gui: a check for updates lists the skills a repository added beside the library's skills from it, to Add or Ignore (Raven on Discord)
Raven: "check for updates" only updated skills already in the library; when
dontbesilent2025/dbskill or mattpocock/skills adds a skill, magpie never said.
CheckSkills now asks GitHub's git trees API once per repo@ref (ETag-cached, a
304 is free) and only when a skill folder under the installed skills' common
folder (newBase) is neither in the library nor already offered does findNew
fetch the tarball for names and descriptions. library.json's seenSkills keeps,
per repo@ref, the paths the install picker showed and the ones set aside, so
an offered skill is offered once. The Skills page shows them under "Also in
their repositories" with Add (to the agents that have the repo's other skills)
and Ignore, plus Add all / Ignore all (/api/library/skills/{add-new,ignore-new}).
Verified: TestCheckSkillsFindsNewOnes (fake repo: nothing offered after
install, no tarball on a second check; two added skills offered, a nested one
and a .wip one not; Add installs with the repo's agents; Ignore keeps it out
on the next check via 304; remove clears) fails without the change (no
NewSkills / findNew) and passes -race -count=10; TestNewBase. A real run in a
sandbox HOME against GitHub: tdd from mattpocock/skills/skills/engineering
offered its 19 siblings; dbs from dbskill offered nothing (the picker showed
all), 33 with seenSkills wiped, and Add installed dbs-action. GUI:
skill-new-in-repo.test.cjs (Chromium+WebKit, 860/440px, en+zh) fails on
main's library.js and passes; gui-ja, gui-de, click-scroll, library-items,
every-skill, pick-skills, import/remove-all-skills, skill-groups,
skill-repo-groups, github-token, library-all pass. -race on library, gui,
tui; gofmt, vet, darwin/linux/windows builds.
|
||
|
|
a7e7fe2b0f |
library: switching a group of skills on or off no longer reads every copy every agent has (#1031, mintonight: 开关一整个技能组时很卡,要10多秒才能完成)
The page already sends one request for a group (agents-some), but its one
change ran a sync that, for every skill given as a copy (every WSL agent,
Windows without the right to link, agents set to copies), hashed the copy
and the library's skill twice, in every agent, on every change, and the
page's read hashed the copies once more. Over a WSL distro's share that is
every file of every skill read through 9P each click.
A copy's mark now keeps the hash of what was copied (markCopy). A copy
whose mark says the library skill's current hash, with nothing in it newer
than the mark, is current without its files being read (copyIsFresh);
takeEdits' walk of a copy is not done a second time in the same sync, and
each library skill is hashed once per change (libHash). Copies with an old
mark, or edited since, are hashed as before. Claude Desktop's copies and
project copies use the same check.
Measured in a sandbox (55 skills x 31 files, copies for 10 agents, a
5-skill group switched on for an 11th): the change went from 1.54s to
0.31s and the page's read from 0.66s to 0.25s on a local SSD; the copies
not touched are no longer read at all, which is the cost over WSL.
TestSyncDoesNotReadUnchangedCopies fails without the change ("codex's
copy of pdf was read and made again"): an unreadable file in an unchanged
copy is left alone now. TestCopyFreshByMark checks a changed library skill
is still copied again, an old mark without a hash still works, and an edit
in a copy is still taken. go test -race ./internal/library ./internal/gui
pass, the new tests pass -race -count=10; vet, gofmt, darwin/linux/windows
builds pass. Not run on Windows or WSL.
|
||
|
|
dcbae2ef98 |
library, gui: the MCP servers page has the skills page's Select, Turn all on, Turn all off and Remove all, under one "In the library" heading (#1027, emo172)
The servers page had only By agent and the order, each with its own "In the library" heading, so with both the heading showed twice. Turning every server on or off, or removing them all, took one chip or one row at a time. The page now has one heading (lib-serverhead, which wraps when narrow) holding the order, Select, Turn all on, Turn all off, By agent and Remove all, as the skills page does. The skills page's helpers now serve both pages rather than being copied. picking names the page ("skills" or "servers"). pickingFor, pickRow, pickBar and groupChips(kind) are shared, and so are everyButtons, confirmEveryOff and everyOf, which replace everySkillButtons and everySkill. removeEveryButton, confirmRemoveEvery and removeEvery replace removeEverySkillButton. The skills page says and does what it did before.
- Turn all on and Turn all off post every agent shown to servers/agents-all (EveryServerAgents, now serversAgents(nil, …)). A hidden agent is left alone. Turn all on is greyed once every server is on for every agent that can reach it. Turn all off asks first, in the page.
- Select puts a box on each row. A row's click ticks it rather than opening the server. The bar's chips post the servers picked to the new servers/agents-some (SomeServersAgents), which gives an agent only the ones it can reach (mcpFile.supports) and leaves unnamed servers and agents as they are. An agent that can reach none of the picks has its chip greyed, with the reason.
- Remove all asks first. It says which agents lose the servers, the projects they are taken from, the sign-ins forgotten, and that the agents' own servers stay. It then posts every name to the new servers/remove-all (RemoveServers). This is one change that takes each server out as RemoveServer does: out of the library, its projects and its icon (removeServer, now shared by both), then out of every agent through syncMCP, which takes only what Applied says magpie wrote, and then forgets its sign-in. A name the library hasn't is listed in Unremoved, and the rest go all the same.
- The pick bar wraps, so its chips and Done fit at 440px in ja and de.
TestRemoveServers checks a server the user put in Claude Code's file and Codex's own "docs" of a library server's name: both stay, while fs, docs and neon leave the library, both agents and the project's .mcp.json, and the project's own "team" stays. neon's sign-in is gone, "nope" is reported, and an empty list or one with only "nope" errors. TestSomeServersAgents checks that Codex gets fs but not the SSE web, that git stays untouched, that a call naming no servers or no agents errors, and that a call naming an unknown server writes nothing. Both pass with -race -count=10, alongside TestEveryServerAgents and TestRemoveServer*.
library-servers-bulk.test.cjs passes on Chromium and WebKit in en, zh, ja and de at 440px. It checks one heading with every button, Turn all on's post without the hidden Copilot CLI, Turn all off's Cancel posting nothing and Confirm keeping Copilot CLI's, the pick bar's codex chip posting agents-some for the two picked and its greyed state for web alone, the All box, Done, and Remove all's lines, Cancel and post. It also checks for no sideways scroll and that each control clicked stays where it was on the screen. The fake check answers every server, since an unchecked one is checked again at each drawing. It fails without the change and passes 6 runs beside pick-skills, every-skill and gui-ja at --test-concurrency=4. by-agent, pick-skills, every-skill, remove-all-skills, group-*, library-*, mcp-signin, project-servers, skill-*, i18n-keys, gui-ja and gui-de pass. skill-how's WebKit case and click-scroll's "Live and a day" fail the same on the unchanged origin/main when run beside each other, and pass alone. go test -tags nogui ./internal/..., go vet, gofmt -l, and the linux (nogui) and windows builds pass. Not tried in the real app. docs/subsystems/library.md says it.
|
||
|
|
4c170cbad6 | library, gui: DeepSeek Harness is listed under Library › RTK with why RTK has no hook for it, not left out (lc on Discord) — RTK rewrites the shell command an agent is about to run, and dsh's hooks can only allow or deny one (its Claude Code bridge drops updatedInput; deepseek-harness's pre-tool-input-rewrite is only proposed), and rtk 0.51's init has no --agent dsh (rtk-ai/rtk#3847; the open #3934 only adds AGENTS.md text, which rewrites nothing). So the RTK tab left dsh out and it read as magpie not seeing it. rtkNoHook names it with the reason: the row has a No RTK hook tag (zh/ja/de) and a switch that can't be turned on, magpie library rtk prints the reason, and on/off for dsh answer it instead of "rtk has no hook for dsh". TestRTKNoHookListed and library-rtk-nohook.test.cjs (Chromium, WebKit, en/zh) are new and fail without the change. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass (TestProvidersAnswerWhileListsComeIn and TestUserPath failed once under the full run's load and pass on their own). | ||
|
|
a5df344e43 |
docs: code-standards gets the acceptance criteria a change must show before merge or release and the PR review patterns, and docs/subsystems covers gateway routing, agent wiring, providers and accounts, the library and the GUI shell (Junjie Zhou on Discord)
code-standards.md: a failing test before the change (a real FAIL, not a compile error), tests under a temp HOME with GOPATH/GOMODCACHE/GOCACHE pinned and never a live agent config, vet/build (linux nogui, windows)/test with pipefail, GUI tests in Chromium and WebKit with gui-ja/gui-de, real-account checks in a sandbox, the UI rules; a PR merges only after it is run merged onto main and with --match-head-commit; a release counts only with the tag on main, 16 assets and Latest. The review section is distilled from recent PR reviews (#706–#931). New references, each following the README's format and linking real source: gateway-routing.md (plan/planGroup, rests, sink, affinity, attempt/translate), agent-wiring.md (Agent fields, ConnectHow, applied.json drift, stash, DisconnectPreview, Reseat/Rewire, WSL twins and ListsFor), providers-accounts.md (providers.json, keys, Accounts, token refresh, logins, groups, Quotas), library.md (change/sync, instructions, MCP formats, skills link/copy, backups, RTK), gui-shell.md (Run, startBackend, Handler/held/revalidated, magpie web, gateway mode, nogui). Every link and backticked identifier was checked against the tree at origin/main. Docs only. |