Files
magpie/docs
yetone d1b4eff5aa agent: version detection and updates for agents installed in WSL distros (mewcoder on X)
A WSL twin row (<kind>@wsl:<distro>) showed no CLI version and no Update
button; the host path's cliupdate machinery only knew host binaries.

Now a twin in a running distro is read and updated inside the distro, for
every cliSpecs kind that has a command (cliupdate_wsl.go):
- one `wsl.exe -d <distro> -e sh` probe prints the command's real path,
  --version and exit code, with its own folder, npm prefix, ~/.local/bin and
  ~/.bun/bin first on PATH (wsl.exe -e has no login PATH, node CLIs exit 127);
  kept 10 min in wslProbes, dropped by Rescan and after an update.
- wslHowInstalled applies the host rules to the Linux path: own updater
  (spec.self), Homebrew, npm, bun, pnpm; volta, yarn and unwritable prefixes
  are left alone.
- the update runs in the distro through wsl.exe (wslRunUpdate); a Linux
  brew's newest is asked in the distro too.
- a stopped distro is never started: no version, and an update says to
  start it. CLIs() lists twins, so Update all takes them in.
No GUI change: the Agents row is keyed by agent id.

Run: gofmt clean; go vet darwin, linux, windows on internal/agent;
go test ./internal/agent ok on mote. TestWSLAgentCLIVersionAndUpdate (fake
registry + fakeWSL distro with an nvm prefix) goes red with the CLI hook
removed from CLI(). Real: win-run on xiaomi-gpu, magpie-desktop's own codex
read 0.162.1, Update true, updated to 0.167.1.
internal/gui on mote: only TestPanelHiddenByWailsMarksPageOutOfSight failed
(AppKit test killed at 120s, mote load ~80; no GUI file touched).

Not tried: real brew in a distro, proxy env inside the distro, sudo-owned npm
folders, kinds without a bin (Goose, mu), starting a stopped distro. Host's
proxy settings are not carried into the distro.
2026-11-11 11:35:41 +08:00
..