Files
magpie/internal/library/every_agent_test.go
T
yetone fefe3f658c library: DS Bot gets MCP servers, skills and instructions in its own DSH home (#5897)
sunset on Discord: DS Bot (ds-bot) can be given a magpie model, but the
Library's MCP page offered no DS Bot. It had no target in targetOf and was
listed "not looked at (#5897)" in noLibrary.

DS Bot's desktop app runs its own DSH (0.2.2-rc.1 in DS Bot 0.3.8) with
DSH_HOME at its data folder (agent.dsbotHome; app/src/main.mjs) and boots
the profile ds-bot (app/src/profile.mjs) with dsh-base's bundles. Read
from github.com/Fei2411/DS-Bot and the npm packages at 0.2.2-rc.1:
- dsh-agent-instructions reads $DSH_HOME/AGENTS.md (then CLAUDE.md);
- dsh-skill-filesystem reads $DSH_HOME/skills and ~/.agents/skills, and
  a project's .agents/skills;
- dsh-mcp-client is in the app's installation (a dependency of
  @deepseek-ai/dsh in app/package-lock.json), so a patch list's insert
  row naming it loads, as in dsh; DS Bot's own bundle patch disables
  none of these.
So ds-bot gets dsh's target on its own home: AGENTS.md, skills, and
MCP rows in every profile's patch list (agent.DshPatchFiles, which globs
profiles/*/cordis.patch.yml, profiles/ds-bot's included). It reads
~/.agents/skills too (readsShared) and .agents/skills in a project.

#5624: when DSH_HOME names DS Bot's folder, the dsh agent's home is
DS Bot's. The Library's dsh target now steps back there
(agent.DshAppHome), so the two agents' rows are never written into one
patch list under two names. This doesn't fix #5624's model wiring.

Run (all at 3b47e8745 rebased on efcf8d9c0, on mica since mote was
over its cores):
- go test -timeout 45m -count=1 ./internal/library ./internal/agent: ok
- GOOS=linux and GOOS=windows go vet ./internal/library ./internal/agent: ok
- gofmt -l internal/library internal/agent: clean
At the first base (4f94b8a82, on mote): the same go test and vet ok,
and node --test internal/gui/tests library-mcp-*.test.cjs,
library-all and library-gone-agents in Chromium and WebKit: 330 of 330
pass. No GUI file changes here; the page lists agents from the API.

Broken by hand: renaming the ds-bot case turned TestDsbotLibraryTarget,
TestDshNotOnDsbotHome and TestEveryAgentInLibrary red; dropping the
DshAppHome check turned TestDshNotOnDsbotHome red.

Not tried: a real DS Bot app loading the server (no DS Bot install on
the test machines); Windows and Linux runs of the package.
2026-11-17 21:31:45 +08:00

76 lines
3.0 KiB
Go

package library
import (
"testing"
"github.com/yetone/magpie/internal/agent"
)
// noLibrary are the built-in agents the Library gives nothing to, each
// with why. Every other agent has a place for skills, MCP servers or
// instructions: OpenBot was added with none, so it was in no picker of the
// Library (SSNQT on X). A new agent fails TestEveryAgentInLibrary until it
// gets a target or a line here.
var noLibrary = map[string]string{
"claude-science": "not looked at (#5897)",
"openchamber": "not looked at (#5897)",
"mothx": "not looked at (#5897)",
"penguin": "not looked at (#5897)",
"aside": "not looked at (#5897)",
"cursor-local": "not looked at (#5897)",
"vscode": "not looked at (#5897)",
"vscode-insiders": "not looked at (#5897)",
"vscodium": "not looked at (#5897)",
"zoo-code": "not looked at (#5897)",
"copilot-jetbrains": "not looked at (#5897)",
"air": "not looked at (#5897)",
"air-ide": "not looked at (#5897)",
"morph": "not looked at (#5897)",
"muse": "not looked at (#5897)",
"empryo": "not looked at (#5897)",
"nanobot": "not looked at (#5897)",
"ante": "not looked at (#5897)",
"astrbot": "not looked at (#5897)",
"qwenpaw": "not looked at (#5897)",
"openclaw": "not looked at (#5897)",
"pencil": "not looked at (#5897)",
"openpencil": "not looked at (#5897)",
"newmax": "not looked at (#5897)",
"raycast": "not looked at (#5897)",
"kirocrew": "not looked at (#5897)",
"t3code": "not looked at (#5897)",
"openmausbot": "not looked at (#5897)",
"snow": "not looked at (#5897)",
"aionui": "not looked at (#5897)",
"cherrystudio": "not looked at (#5897)",
"lody": "not looked at (#5897)",
"miniq": "not looked at (#5897)",
"avibe": "not looked at (#5897)",
"obsidian": "not looked at (#5897)",
"paseo": "not looked at (#5897)",
"paimon": "not looked at (#5897)",
"shelley": "not looked at (#5897)",
"kun": "not looked at (#5897)",
"dim": "not looked at (#5897)",
"open-code-review": "a review CLI with its own fixed tools, not a coding agent; whether it reads skills or MCP not looked at",
}
func TestEveryAgentInLibrary(t *testing.T) {
sandbox(t)
for _, a := range agent.All() {
if a.WSL != "" || a.Plugin != "" {
continue // a distro's twin and a plugin's agent have their own
}
why, listed := noLibrary[a.ID]
tg := targetOf(a)
switch {
case tg == nil && !listed:
t.Errorf("%s (%s): no place in the Library; give it a target in targetOf, or a reason in noLibrary", a.ID, a.Name)
case tg != nil && listed:
t.Errorf("%s: in noLibrary (%q) but has a target", a.ID, why)
case tg != nil && tg.Skills == "" && tg.MCP == nil && tg.Instructions == "":
t.Errorf("%s: a target with nothing in it", a.ID)
}
}
}