Repository navigation
feat(wsl): admit no new WSL host or move in serve-only (kill switch 2/2) - #34694
Conversation
17a2c09 to
b494660
Compare
d5c4907 to
b4b8acf
Compare
b494660 to
bd357a7
Compare
|
No actionable comments were generated in the recent review.
|
Main refuses wslHosts:add while the internal gate is closed and reports acceptsNewWork in the WSL host capability; moves already need the open gate. The renderer hides Add WSL distro and every Move entry point once main says serve-only, while saved hosts keep their Connect and Remove.
…lity The renderer's acceptsNewWork now starts false, so Add WSL distro and the Move entries never flash in serve-only before the capability reply.
…en it is offered In serve-only Add WSL distro is hidden, so the refusal keeps its terminal-only words there.
#34676's test mocks use-wsl-hosts-enabled; WslHostsSection now also reads useWslHostsAcceptNewWork, which follows the same gate there.
bd357a7 to
f6217cd
Compare
ELI5
The previous PR keeps saved WSL hosts and moved projects working when the internal WSL switch is off (serve-only). This PR makes sure serve-only can't grow: nobody can add a new WSL host or move another project onto one. Saved hosts still connect and can be removed.
What Changed
Main:
wslHosts:addrefusal itself now lives in feat(wsl): serve saved WSL work behind a closed hosts gate (gate states, kill switch 1/2) #34683, so that PR is safe on its own.refuseUnlessOpenon preview, start and cancel, plus the orchestrator), so nothing changes there.wslHosts:getCapabilitynow also returnsacceptsNewWork(true only with the open gate). It's an optional field, so a renderer from before this change treats it as absent, which means allowed. Main still refuses either way.Renderer:
wslHostsAcceptNewWork, which startsfalseand is set from the capability bywsl-host-ipc-bridge.ts, so Add and Move never flash in serve-only before main answers.useWslHostsAcceptNewWork()means WSL hosts are enabled and main accepts new work.AddRepoHostSelectorSlot);WslHostsSection), where serve-only also doesn't show "Turn on in Experimental";useWslMoveTargetForRepo: the project menu and the project settings runtime row;wslHostChatAvailable()now also requireswslHostsAcceptNewWork, so serve-only keeps the terminal-only words instead of pointing at a hidden button.Flag-off: with the gate open,
acceptsNewWorkis true and nothing changes. With the gate closed and nothing saved, there's no WSL API and no service, as before.Why
Serve-only exists to keep users' existing work reachable after a rollback. Admitting new hosts or moves behind a closed gate would defeat the rollback. Both main and the renderer enforce it, so an older renderer, or a direct IPC call, still can't add a host.
Linked Issue
N/A (WSL hosts kill switch, PR2 of the design).
Visual Proof
N/A beyond the e2e screenshot
wsl-hosts-serve-only-settings.png: the "Add WSL distro" button and the move entries are removed, and nothing is added.Testing
wsl-host-handlers-user-actions.test.ts:acceptsNewWork: false, and Remove still works.use-wsl-hosts-enabled.test.tsx: with the gate open, new work is offered; once main reports serve-only, saved hosts stay enabled but nothing new is offered.structured-agent-session-launch-failure-wsl.test.ts: serve-only keeps the terminal-only words. This fails without the check.e2e serve-only case (extended). Both gate-closed cases pass locally, hidden (
ORCA_BACKGROUND_LAUNCH=1).wslHosts.addis refused (disabled).wslMove.startis refused (wsl_move_unavailable).The 18 suites that import the touched modules pass (145 tests).
WslMoveDialog.test.tsx's mock gained the new hook export.pnpm tc,typecheck:ci, oxlint, the anti-slop lint,ast-grep-gates.mjs,check:code-quality:changedandcheck:process-host-importspass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Risk: low.
Agent skill upstream boundary
Notes
acceptsNewWorkis an optional field on a desktop-local IPC reply, not a paired-wire contract.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)