Files
yetone 1b29cb81a2 agent, wslrun, sessions, gui: Settings → General has Detect agents in WSL; off, magpie asks wsl.exe nothing and shows no WSL agents or sessions (#1264)
On Windows magpie lists the running distros and probes each one for agents,
their sessions and Claude Code. Etsuya233 asked for a way to turn that off.
settings.NoWSLAgents (per machine, kept by KeepOwn) now gates every
auto-discovery path: agent.wslAgents/wslHomes/WSLRunning, sessions'
wslFiles/wslDirs (via the new sessions.WSLOff hook), and wslrun.Find, which
the Claude subscription uses to run Claude Code in WSL. The toggle is shown on
Windows only and is on by default.

Verified:
- red without the change: TestWSLDetectionOff (1 WSL agent with detection
  off; with only sessions reverted, a distro's session is listed),
  TestFindWithDetectionOff (Find returned Ubuntu after asking wsl.exe).
- go test -tags nogui ./... in a sandbox HOME: every package ok except
  TestPluginLoginTakesTheLapseOff, which timed out at 63.7s under the full run
  and passes alone (-count=3) and with its package (-count=1); it doesn't
  reach WSL.
- go vet -tags nogui on agent, wslrun, sessions, settings and gui for darwin,
  linux and windows.
- GUI: wsl-agents-setting (en/zh/zh-TW/ja/de, 900 and 440px) 30/30;
  gui-ja, gui-de, gui-zh-tw, i18n-keys, keep-awake, lightweight,
  settings-sections, settings-groups 44/44 in Chromium and 44/44 in WebKit.
- Windows box (10.0.0.132), nogui magpie.exe in a sandbox profile with a
  logging wsl.exe first on PATH: on, `magpie agents` listed Claude Code · WSL
  magpie-desktop after 3 wsl.exe calls; off, `agents`, `ls` and `sessions`
  made no wsl.exe call and wrote no wsl.json.

Not tried: the toggle in the real Windows GUI window, and Claude Code in WSL
through the Claude subscription with the setting off (unit-tested only).
2026-10-08 16:57:39 +08:00
..