5b4da5bee (#2685) made proc.UserPath add fnm's node on Windows, and on
macOS and Linux it reads the login shell's PATH. The app, the panel and
the daemon called it; magpie serve and magpie web didn't, so one started
by autostart or a service without a terminal's PATH ran an MCP server or
agent by npx.cmd's full path with no node ("'node' is not recognized").
Both now call it once their flags are read, before the gateway starts.
magpie tui runs in a terminal and keeps that PATH.
TestGatewayStartsGetUserPath parses internal/cli and fails when runGUI,
runPanel, webCmd or serveCmd stops calling proc.UserPath.
Run:
- go test ./internal/cli ./internal/proc: ok. The new test is red on
origin/main's web_cli.go (webCmd and serveCmd named).
- gofmt -l clean; go vet -tags nogui GOOS=windows and linux: ok.
Not tried: magpie serve started from a Windows service with fnm.