Repository navigation
fix(runtime): keep WSL workspaces open after host recovery - #29106
brennanb2025 wants to merge 12 commits into
Conversation
29b0af3 to
4f91493
Compare
|
Stopping a WSL distribution could clear the selected workspace and tabs because recovery treated a changed connection pairing as a replacement machine. This change retains open work only when the current Windows registration and authenticated guest key identify the same installation, and retires old ownership after a same-name re-import even with a copied guest key. Independent review led to fixes for observed-registration loss and status notices replaying unknown identity; final source verification found no open proven blocking issue. The full PR workflow passed on This remains a draft. Windows restart/re-import/removal QA and screenshots are pending, including the pre-existing folder tab/selection concern; the separate WSL CI lane failed before Orca tests during the systemd distro's first boot. Unknown-registration retirement remains the agreed conservative behavior, and failed final port publication can require explicit Connect. Racing Send remains separate. This is not ready to merge. |
|
Windows QA for head 7f2c19b (Windows high spec, real signed-in Claude Code 2.1.302 inside a throwaway WSL2 distro, Codex driving the UI over CDP)
Selection and tabs kept after the desktop restart: |



Stacked on #29042.
ELI5
Stopping a WSL distro while its chat was open cleared the selected workspace and tabs when the host recovered. Orca treated a changed connection pairing as a replacement machine. This change keeps open work only when the recovering host has the same current Windows distro registration and guest key; importing a copy under the same name must retire the old host even if the copied guest still has its key.
What Changed
The connection carries the registration ID observed during deployment through the existing saved deployment record into the catalog. Registration changes trigger the existing revision and retirement machinery even when pairing credentials stay unchanged. Unknown current registration cannot reuse the enrollment ID as continuity proof. Ordinary same-registration/key pairing rotations use the existing same-host path, preserving selection and tabs.
Neil-owned modules in scope:
wsl-orcad-connection.ts,wsl-host-connection-record.ts,wsl-orcad-deploy.ts,wsl-distro-registry-id.ts,wsl-host-service.ts, andwsl-host-e2e-fake-connector.ts. No mover internals or #29042 grant-resolution behavior is changed. No new saved field, protocol operation, UI, setting or gate is introduced.Why
Workspace identity survives transport loss. Reusing host continuity fixes the destructive decision before state is deleted. Intended differences: a managed WSL installation requires current Windows registration plus guest key; if current registration cannot be verified, it cannot continue the old host. Explicit removal keeps the existing host-retirement path. Full folder tab/selection cleanup still requires Windows QA; source review found a pre-existing gap after folder catalog removal. Racing Send admission remains a separate follow-up.
Linked Issue
Live Windows QA finding F2 for #29005: terminating the disposable distro cleared the workspace on recovery in both trials.
Visual Proof
Pending coordinator Windows hidden-renderer QA: ordinary restart keeps selection/tabs, copied-key re-import retires old ownership, and explicit removal still clears; repeat with a folder workspace. No screenshots claimed yet.
Testing
The existing WSL same-host test now asserts the exact revision continuation. One real manager/service-to-catalog regression covers a changed current registration with unchanged guest key/pairing, failed identity publication and retry through the numeric request fence, and checks census completion, ready feedback and status notices separately from fresh unknown observations. The registry test covers clearing a prior deployment’s cached registration.
No local commands using pnpm, lint, typecheck, tests, install, build or apps were run on the shared Mac. Ordinary commits used no bypass flags; this worktree lacks installed dependencies and Husky wrappers. The full PR workflow passed on
7f2c19b9d36: static analysis/typecheck, all five unit shards, relay integration, and Linux/Windows package checks, including aggregatePR checks passed. All six touched test files appear in the saved execution manifest. The separate WSL lane failed before Orca tests during the systemd distro’s first boot (HCS_E_TERMINATED); live coordinator Windows QA remains required.Review
The original patch was rejected because it compared the saved enrollment registration before and after reconnect; copied guest keys could incorrectly continue a replacement registration. Fresh independent architecture and source review adopted the observed-registration design and found a further status-only publication issue. The correction marks private callbacks by their source, so only connection observations change identity; unchanged unknown observations still require verification publication. The production correction and final real-service regression passed independent source verification. No tests were executed by reviewers. The readiness-checklist skill is unavailable, so the review records a manual readiness audit instead. This draft is not ready to merge: Windows QA/screenshots and the separate WSL lane failure remain outstanding.
Agent skill upstream boundary
Notes
A failed final deployment write after a bridge endpoint move closes the connection; explicit Connect may be needed to repair that partial saved state. The files are not a power-loss transaction. SSH uses its existing registration/key mechanism. Folder workspaces share the same host retention/retirement path. Mixed-version peers keep the existing saved field and wire contracts.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)