Repository navigation
fix(wsl-host): stopped-host follow-ups — no stuck Start card, card-rule retry and dot, SSH pin - #35822
Conversation
…gain; retry the card's panes - e9-reviewer: a runtime call's stop could land after liveness had already reconnected and said ready, leaving Start on a working host. Once the distro runs, the deferred un-park re-reads the host and says ready from the live connection, or reconnects open work as before. - fix-reviewer-2: the return retry picks panes by the Start card's rule, so a pane whose create failed before it reached the host is retried too. - Pins that the refusal stays a plain, final Error with the same words for the move and automation callers. Co-Authored-By: Claude <[email protected]>
… live e9-reviewer: match the Start card's rule; only a pane with no server or on the stopped host ended. Co-Authored-By: Claude <[email protected]>
… other channels as they were 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 7 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
[Medium impact] The changes reach WSL host recovery and workspace activity displays. Fix the unstable activity snapshot before merging so split terminals cannot break sidebar rendering. Findings
SummaryThis PR repairs recovery after a WSL host stops and adds tests for pane retries, activity dots, and SSH error wording.
|
| }) | ||
| // Same array when nothing dropped, so useShallow keeps the card from re-rendering. | ||
| if (kept.length > 0) { | ||
| live[tabId] = kept.length === ptyIds.length ? ptyIds : kept |
There was a problem hiding this comment.
Split terminals break sidebar rendering
When one split tab contains both a stopped host's PTY and another server's live PTY, withoutStoppedHostPtys returns a fresh filtered array on every call—even for the same store state. useShallow compares these arrays by reference, so the store hook cannot return a stable snapshot. This can trigger repeated React updates and the sidebar's recovery screen.
Cache the filtered result by input array and stopped host. Add a mounted test with both PTYs in the same tab; the current mocked, server-rendered test cannot catch this.
ELI5
This is a follow-up to #35732, the "a terminal on a stopped WSL distro shows Start" fix. It closes three small gaps the reviewers found:
It also adds a test that pins SSH behaviour.
What Changed
distro-stopped. That publish could land after liveness had already reconnected and publishedready, leaving the Start card on a working host with no automatic recovery.resumeAfterStopinwsl-host-runtime-call.ts). If its connection already answers, it publishesreadyfrom that live connection. Otherwise it reconnects open work withnoBoot, as before.useRetryPanesWhenWslHostReturnspicks panes by the Start card's own rule (paneEnvironmentId == null || === owner). A pane whose create failed before it reached the host is retried too, and a pane on another server never is.useShallowdoesn't re-render.runtimeEnvironments:*wrapper. An SSH host's refusal words, and other IPC channels' wrappers, are left as they were.Why
readyis exactly what's stale in the original bug, right after an external terminate. So the check happens later, when the distro is known running.liveverdict also wouldn't re-publish a state it never changed, so the service publishesreadyfrom the live connection itself.Linked Issue
Internal: follow-up to #35732 (verify-7 part 2, item 1).
Visual Proof
N/A. No new UI; this corrects the existing card's and dot's states.
Testing
wsl-host-service-runtime-call-stop.test.ts: a stop published after the host was already back saysreadyagain when the distro runs, with no connect. This fails without the fix. The refusal stays a plain finalErrorwith the same words.use-wsl-host-return-retry.test.ts: a pane with no server is retried, and one on another server isn't.use-worktree-activity-status.test.tsx: a pane on another, running server keeps the workspace active while its own host is stopped. This fails without the fix.TerminalErrorToast.test.ts: SSH words and other channels' wrappers are unchanged.pnpm tc,src/main/wsl, the terminal-pane portal, toast and retry suites, the activity-status test andpane-title-update-global-scan-budget.test.tsx(1,030 tests) pass. oxlint andcheck:code-quality:changedpass.User risk: WSL hosts only.
AI Disclosure
Review
e9-reviewer and fix-reviewer-2.
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)