leokon on Discord (#help): the Library's MCP section listed only the
Windows Pi, never a Pi installed in WSL. wslTargetOf left pi@wsl's MCP
out because its version wasn't known, and Pi's MCP file depends on the
version: 0.99+ reads mcp.json itself; before that, pi-mcp-adapter 3 reads
mcp-adapter.json and 2 reads mcp.json.
- The WSL probe now asks the distro's pi for --version (wslKind
version: true). The answer is stored as the agent's wslVersion, and
InstalledVersion returns it for an agent in WSL.
- pi@wsl:<distro> gets piMCP. The file is chosen as on this computer,
with the distro's npm roots for the adapter (~/.npm-global,
/usr/local/lib and /usr/lib node_modules): wslPiRoots, piDetectIn.
- Siblings: every agent with a local MCP target and no WSL one now
has one, in its own file under the distro's home. These are Gemini
CLI, Antigravity CLI, Crush, Cline, CodeBuddy Code, Kimi Code and
Goose.
- Every WSL MCP file is marked WSL with its distro, so a Windows
program (C:\...\npx.cmd) is refused, as for claude/codex@wsl.
- Not fixed: Kimi Code's and Goose's skills in WSL. On this computer
they get the shared ~/.agents/skills, but the distro's needs that
folder's sharing rule (#3966).
Run (at d8c70504d + this commit; rebased on d50f84c9f, two mover mins):
- go test -tags nogui ./internal/agent ./internal/library on mote: ok.
- GOOS=windows and GOOS=linux go vet ./internal/agent ./internal/library:
ok.
- gofmt -l: clean.
- New tests:
- TestWSLPiMCP covers three fake distros: Pi 1.2 gets mcp.json
(native); Pi 0.98 with no extension gets mcp-adapter.json; Pi 0.98
with adapter 2 in ~/.npm-global gets mcp.json (fmtPi). Each is in
the page's view, and is written to its distro and not this
computer's Pi. A Windows program is refused.
- TestWSLMCPSiblings covers the 7 siblings: path, WSL mark, writes,
and refusal. The OS switch is forced with agent.FakeWSL.
- GUI, on mote: library-*.test.cjs, wsl-agents-setting and i18n-keys
(Chromium and WebKit, every language): 769 of 770 pass. The red is
i18n-keys "a plugin's words are its own" ("Runs as" in
claude_code_cli.go), red on main since 7f827b3b0, #3897.
- Full suite on mote (go test -tags nogui -timeout 45m ./...) at
d8c70504d + this change: 76 packages ok, no FAIL, exit 0.
- Real run, on the Windows box: magpie built on Windows, run in a
sandbox USERPROFILE. `magpie library mcp add wslfetch uvx
mcp-server-fetch agents=pi@wsl:magpie-desktop` wrote the server into
magpie-desktop's ~/.pi/agent/mcp-adapter.json. The distro has pi
0.73.0 from npm, which the probe asked; it is before 0.99 and has no
extension. A C:\Program Files\nodejs\npx.cmd server was refused for
pi@wsl. Both files were then removed.
Broken by hand, each turned the new tests red:
1. pi@wsl with no MCP: TestWSLPiMCP.
2. The version not passed: Debian got mcp.json.
3. No distro roots: Arch got mcp-adapter.json.
4. No WSL mark on the file: the Windows program was written.
5. The gemini case removed: TestWSLMCPSiblings.
Not tried:
- A real Pi 1.x in WSL. magpie-desktop's own pi is 0.73 and was left
as it is. The 1.x choice (mcp.json) is covered by the test only.
@earendil-works/pi-coding-agent 1.4.0 answered `--version` with "1.4.0"
on the box.
- The seven siblings with real installs in WSL.
- A distro that is stopped. Its saved probe from before this release
has no pi version, so the file is chosen as for an unknown version
(mcp.json), until the distro is probed while it runs.
- The GUI on Windows. Its MCP list shows any agent whose view has an MCP
file, unchanged.