Repository navigation
fix(wsl-host): a terminal that meets its stopped distro shows Start, and comes back with it - #35732
Conversation
…and comes back with it After an external `wsl --terminate`, the first keystroke's runtime call found the distro stopped and parked the host, but only liveness ever published a stopped status, and here liveness saw a quick reboot instead. So no Start card appeared: the pane kept its old prompt, typing did nothing, and a red toast showed Electron's raw "Error invoking remote method 'runtimeEnvironments:call'" text that stayed after the distro ran again. - The runtime-call gate (moved to wsl-host-runtime-call.ts) publishes distro-stopped when it parks a host, as liveness does, so every pane on it shows the Start card and its error gives way. - The park lifts once a running list confirms the distro runs again (never booting it), and a host with open work reconnects. - Panes that gave up on the stop retry when their host is ready again, not only after Start. - A host refusal's toast drops Electron's IPC wrapper. Co-Authored-By: Claude <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
No actionable comments were generated in the recent review.
|
[Medium impact] The latest changes appear safe to merge. SummaryThe PR shows Start when a runtime call finds a stopped WSL host and reconnects open panes after the distro returns.
Reviews (3) · Last reviewed commit: "perf(wsl-host): no new store listener pe..." · Reviewed by Greptile |
Its panes keep their bindings for Start, so the card dot stayed green over dead terminals. Co-Authored-By: Claude <[email protected]>
…pped host The activity status folds the stopped-host check into its existing pty selector, and the pane recovery portals derive both the Start card and the return retry from one host-status subscription. The live-capture listener budget (8,000) is back under, with no budget change. Co-Authored-By: Claude <[email protected]>
ELI5
If a WSL distro that runs an Orca host is stopped from outside Orca (for example
wsl --terminate), the terminal on that host used to sit there looking alive. It had a green dot and its old prompt, typing did nothing, and a red error showed raw internal text that never went away. Now the terminal shows the existing "{distro} is stopped" card with a Start button. When the distro runs again, by Start or any other way, the terminal reconnects by itself and the error clears.What Changed
distro-stopped, and only liveness published that. A keystroke's runtime call that found the distro stopped parked the host and threw, but published nothing. In this run liveness most likely saw a quick reboot (Orca's own backgroundgit statuson the\\wsl.localhostpath started the distro again, which another fix addresses), so the stop was never shown.ensureForRuntimeCall, nowensureWslHostForRuntimeCallinwsl-host-runtime-call.ts(moved out of the service for size), publishesdistro-stoppedwhen it parks a host.noBoot.useRetryPanesWhenWslHostReturnsretries the host's panes when its status goes from stopped to ready. The card's Start already did this; now the host returning on its own does too.useWorktreeActivityStatuscounts no live terminals for a workspace whose WSL host isdistro-stopped, so its card dot isn't green over dead panes. The panes keep their bindings for Start, which is why the dot stayed green. A cheap "any host stopped" check runs first, so other cards pay nothing.humanizeTerminalErrorstrips theruntimeEnvironments:*IPC wrapper from those lines only. Local spawn errors keep the wrapper their existing copy matches.Why
Linked Issue
Internal: WSL hosts, verify-7 part 2, item 1. Item 2 (worktree rows) is with wsl-e9-git; item 3 is pending a separate check.
Visual Proof
N/A here. This reuses the existing stopped card, and a device re-check is planned in verify-7 part 3.
Testing
wsl-host-service-runtime-call-stop.test.ts:distro-stopped, once;noBoot;use-wsl-host-return-retry.test.ts: the host's panes retry once on stopped → ready, panes on other servers are untouched, and a stop already showing at mount counts.TerminalErrorToast.test.ts: aruntimeEnvironments:callwrapper is dropped, and other lines are kept as they are.use-worktree-activity-status.test.tsx: a workspace on a stopped host reads inactive; another distro's stop leaves it active. This fails without the fix.Errorwith the same text (wsl-host-service.test.ts, "keeps a parked host's refusal final"). Sowsl-move-host-connectandwsl-host-automation-enablesee exactly what they saw before.pnpm tc, thesrc/main/wsland WSL IPC suites, the terminal-pane portal and toast suites (988 tests), oxlint on the touched files,check:code-quality:changed, and the max-lines and flaky-pattern ratchets pass.User risk: WSL hosts only, apart from one SSH-visible text change below.
AI Disclosure
Review
Two reviewers requested (terminal restore).
Agent skill upstream boundary
Notes
runtimeEnvironments:*refusal line, including SSH hosts': it removes only Electron's wrapper text.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)