Repository navigation
feat(wsl): WSL distro hosts, main-process wiring and persistence (WSL-via-orcad C7a, experimental) - #27933
Conversation
9ac0ba7 to
2b419a3
Compare
dd1f760 to
e03eef2
Compare
2b419a3 to
caf2132
Compare
678f9e4 to
82b4a9c
Compare
caf2132 to
7d5d2c4
Compare
7d5d2c4 to
4e4aa55
Compare
…rcad deployment links by kind
…mental flag (WSL-via-orcad C7a) Main-process wiring for WSL hosts: list registered WSL 2 distros, add one (C4 deploy and launch through C6 liveness, then persist the paired environment and its C2 record), keep a relaunch's new device token, connect a host only for the user or an open project or terminal, adopt holders at startup, and remove a host (release its holder, drop both records). Refuses a distro whose orcad this desktop already reaches as another server (R25).
…he canonical unbraced GUID C4's registry reader returned the braced GUID while the C2 record only accepts it unbraced, and C7 parsed the same output a second time. The one reader now yields lowercase unbraced ids and each registration's WSL version; the host distro list uses it.
Adding, connecting and background connects all stop while Experimental → WSL distros as hosts is off; removing still works. The pre-deploy refusals move to their own module.
Remove ended the bridge and released the distro's holder but left orcad to exit with the distro. A connected server is now ended right away, only in a distro already running.
… say so up front A build shipped without the orcad deployment template let the add dialog run and fail after seconds with a raw internal error. Main now checks the template as SSH hosts do, refuses add and connect (and skips lazy connects and holder adoption) before any deploy work, and exposes the capability so the UI can show it.
…ts when the experiment is off Remove now ends the host's terminals through orcad's terminal RPC, waits for the terminal census to prove none remain, closes the bridge, and runs the managed decommission SSH hosts use, which stops orcad and retires its idle terminal daemon. What it could not end is reported back. Turning Experimental → WSL distros as hosts off closes every connection and liveness watch, releases the holders so distros can idle-stop, and keeps liveness from relaunching for visible work; turning it on resumes only the hosts open work needs.
…his desktop They are this desktop's own distros, connected only for work open here; a phone listing or routing to one would wake it behind the user's back.
…ever respawn it Removal reached orcad with the bridge's raw pairing offer rather than the routed environment and saved pairing the app already uses for the host; on a real orcad ending terminals failed fast and left them, the daemon and orcad running. It now calls by environment id through the same transport as every other call to the host, and the e2e fake runs these real steps against a headless server. Removal also stops tracking the host first (open work, connects, runtime calls), so nothing reconnects it while it stops, and a spawn guard in the connector refuses any holder, deploy or bridge for a distro whose host is gone (the respawn loop after removal). A WSL host that isn't connected answers runtime calls with why, instead of failing as an unreachable network server.
…'t be reached Unreachable-server hints are chosen by the owner host's kind: a WSL host is a distro on this computer, so it points at its reconnect instead of the Tailscale advice for network servers.
…e's connects to a file
…ed only on proof Removal stopped terminals per workspace, so one orphan whose project was gone threw selector_not_found and aborted before orcad was stopped. It now closes each terminal by handle, keeps going past failures and names them, and still asks orcad to stop. It reports stopped only when the census shows no session left, the daemon retired, and the orcad the distro records as active is the one this computer was connected to; a re-add that adopted an orcad the record does not name is reported instead of claimed stopped.
WSL distros as hosts must not be reachable by users until moving a project between hosts is lossless and the feature matches today's WSL support. ORCA_INTERNAL_WSL_HOSTS=1 opens the gate; otherwise main creates no WSL host service (no holder adoption, wsl.exe spawn or reconnect), refuses add, connect, remove and every runtime call to a WSL host, keeps persisted WSL hosts out of the server list, startup status probes and AI vault scans while leaving them on disk, and the preload exposes no WSL host API.
…ent file holds An unreadable WSL record no longer hides an SSH-linked server, and with the internal gate closed a corrupt WSL file is warned about instead of failing the whole registry.
A WSL host always pairs over a loopback endpoint, so a stale record can no longer remove a remote paired server from the list.
…ate is closed A newer or stale record could otherwise hide a re-paired loopback server for users who never open the gate.
cec0e91 to
84d5cc7
Compare
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
69b5a96d-6bed-4baa-b15a-ca81df208be7
📒 Files selected for processing (67)
src/main/ai-vault/runtime-session-scanner.tssrc/main/ephemeral-vm-runtime-environment-release.tssrc/main/ipc/managed-orcad-actions.tssrc/main/ipc/register-core-handlers/register-core-handlers.test.tssrc/main/ipc/register-core-handlers/register-core-handlers.tssrc/main/ipc/runtime-environment-connectivity-handlers.tssrc/main/ipc/runtime-environment-managed-tunnel.tssrc/main/ipc/runtime-environment-mobile-relay-hosts.test.tssrc/main/ipc/runtime-environment-mobile-relay-hosts.tssrc/main/ipc/runtime-environment-status-probe.tssrc/main/ipc/runtime-environment-support-routing.tssrc/main/ipc/runtime-environment-tailscale-response.tssrc/main/ipc/runtime-environment-transport-routing.tssrc/main/ipc/runtime-environment-unreachable-hint.test.tssrc/main/ipc/runtime-environment-unreachable-hint.tssrc/main/ipc/runtime-environments.tssrc/main/ipc/wsl-host-gate-off.test.tssrc/main/ipc/wsl-host-handlers.tssrc/main/runtime/mobile-desktop-relay/mobile-desktop-relay-hosts.tssrc/main/ssh/orcad-managed-migration-status.tssrc/main/ssh/orcad-managed-runtime-context.tssrc/main/ssh/orcad-retained-source.tssrc/main/ssh/orcad-runtime-conversion.tssrc/main/ssh/orcad-runtime-decommission.tssrc/main/ssh/orcad-runtime-deployment.tssrc/main/ssh/orcad-ssh-provisioning.tssrc/main/wsl/wsl-distro-registry-id.test.tssrc/main/wsl/wsl-distro-registry-id.tssrc/main/wsl/wsl-host-add-admission.tssrc/main/wsl/wsl-host-connection-record.tssrc/main/wsl/wsl-host-connector.tssrc/main/wsl/wsl-host-distro-list.test.tssrc/main/wsl/wsl-host-distro-list.tssrc/main/wsl/wsl-host-e2e-fake-connector.tssrc/main/wsl/wsl-host-gate.tssrc/main/wsl/wsl-host-server-stop.test.tssrc/main/wsl/wsl-host-server-stop.tssrc/main/wsl/wsl-host-service-instance.tssrc/main/wsl/wsl-host-service.test.tssrc/main/wsl/wsl-host-service.tssrc/main/wsl/wsl-host-ssh-orcad-conflict.tssrc/main/wsl/wsl-orcad-deploy.test.tssrc/preload/api/runtime-api.tssrc/preload/api/runtime-environments-bridge.tssrc/preload/api/wsl-hosts-api.test.tssrc/preload/api/wsl-hosts-api.tssrc/renderer/src/components/settings/ManagedServersSection.tsxsrc/renderer/src/lib/recipe-vm-managed-host.tssrc/renderer/src/lib/ssh-workspace-browser-route-eligibility.test.tssrc/renderer/src/lib/ssh-workspace-browser-route-eligibility.tssrc/renderer/src/store/slices/runtime-environment-peer-replacement.tssrc/shared/default-global-settings.tssrc/shared/execution-host-registry.tssrc/shared/global-settings-types.tssrc/shared/managed-orcad-execution-host.test.tssrc/shared/managed-orcad-execution-host.tssrc/shared/runtime-environment-managed-orcad-store.tssrc/shared/runtime-environment-sidecar.tssrc/shared/runtime-environment-store-file.tssrc/shared/runtime-environment-wsl-host-store.test.tssrc/shared/runtime-environment-wsl-host-store.tssrc/shared/runtime-environments.tssrc/shared/wsl-host-deployment-link.tssrc/shared/wsl-host-deployment-store.test.tssrc/shared/wsl-host-deployment-store.tssrc/shared/wsl-host-internal-gate.tssrc/shared/wsl-host-types.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| this.removing.add(environmentId) | ||
| this.visible.delete(environmentId) | ||
| const connector = this.connector | ||
| let serverStop: WslHostServerStop = { stopped: true } | ||
| if (connector) { | ||
| serverStop = await connector | ||
| .stopServer(record.distro, environmentId) | ||
| .catch((error: unknown) => ({ stopped: false, reason: errorMessage(error) })) | ||
| await connector.disconnect(record.distro) | ||
| // Without its holder the distro idles out. | ||
| await connector.releaseHolder(record.distro) | ||
| } | ||
| removeWslHostEnvironment(this.deps.userDataPath(), environmentId) | ||
| this.removing.delete(environmentId) | ||
| this.statuses.delete(environmentId) | ||
| await this.deps.removed(environmentId) | ||
| return serverStop |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Clear removing in a finally block.
remove adds the id to this.removing at Line 141 and deletes it only at Line 154. removeWslHostEnvironment can throw at Line 153. For example, writeWslHostDeployment throws WslHostDeploymentStoreInvalidError for an unreadable record, and writeEnvironmentStore can fail. If either throws, the id stays in removing until restart. connect and ensureForRuntimeCall then refuse the host with "This WSL host is being removed." The record is still on disk, so the host looks present but cannot be used.
🐛 Proposed fix
- removeWslHostEnvironment(this.deps.userDataPath(), environmentId)
- this.removing.delete(environmentId)
+ try {
+ removeWslHostEnvironment(this.deps.userDataPath(), environmentId)
+ } finally {
+ this.removing.delete(environmentId)
+ }
this.statuses.delete(environmentId)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| this.removing.add(environmentId) | |
| this.visible.delete(environmentId) | |
| const connector = this.connector | |
| let serverStop: WslHostServerStop = { stopped: true } | |
| if (connector) { | |
| serverStop = await connector | |
| .stopServer(record.distro, environmentId) | |
| .catch((error: unknown) => ({ stopped: false, reason: errorMessage(error) })) | |
| await connector.disconnect(record.distro) | |
| // Without its holder the distro idles out. | |
| await connector.releaseHolder(record.distro) | |
| } | |
| removeWslHostEnvironment(this.deps.userDataPath(), environmentId) | |
| this.removing.delete(environmentId) | |
| this.statuses.delete(environmentId) | |
| await this.deps.removed(environmentId) | |
| return serverStop | |
| this.removing.add(environmentId) | |
| this.visible.delete(environmentId) | |
| const connector = this.connector | |
| let serverStop: WslHostServerStop = { stopped: true } | |
| if (connector) { | |
| serverStop = await connector | |
| .stopServer(record.distro, environmentId) | |
| .catch((error: unknown) => ({ stopped: false, reason: errorMessage(error) })) | |
| await connector.disconnect(record.distro) | |
| // Without its holder the distro idles out. | |
| await connector.releaseHolder(record.distro) | |
| } | |
| try { | |
| removeWslHostEnvironment(this.deps.userDataPath(), environmentId) | |
| } finally { | |
| this.removing.delete(environmentId) | |
| } | |
| this.statuses.delete(environmentId) | |
| await this.deps.removed(environmentId) | |
| return serverStop |
| // Why: a host that already runs, or is moving to, a managed server can't take another. | ||
| const busyTargetIds = new Set([ | ||
| ...managed.map((environment) => environment.orcadDeployment?.sshTargetId), | ||
| ...managed.map((environment) => getOrcadSshDeployment(environment)?.sshTargetId), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Exclude WSL hosts from the SSH managed-server list.
Line 67 now treats orcadDeployment as possibly WSL. The managed filter at Line 63 still keeps every environment whose orcadDeployment is truthy. When the internal gate is open, runtimeEnvironments:list returns WSL hosts with orcadDeployment.kind === 'wsl'. Each WSL host then renders as a ManagedServerRow with SSH managed-orcad actions. Those actions go through requireManagedOrcadEnvironment, which throws "This server is not managed through an orcad SSH deployment." Line 64 also drops WSL hosts from paired, which is correct. Filter managed with getOrcadSshDeployment so the two lists agree.
🐛 Proposed fix (outside the changed range, Line 63)
- const managed = environments.filter((environment) => environment.orcadDeployment)
+ const managed = environments.filter((environment) => getOrcadSshDeployment(environment))| assertPairingUsesBridge(environment, args.record.localPort) | ||
| writeWslHostDeployment(userDataPath, args.id, { | ||
| ...args.record, | ||
| environmentId: args.id, | ||
| createdAt: now | ||
| }) | ||
| const persisted = PersistedRuntimeEnvironmentSchema.parse(environment) | ||
| writeEnvironmentStore(userDataPath, { | ||
| version: 1, | ||
| environments: [...readPersistedEnvironmentStore(userDataPath).environments, persisted].sort( | ||
| (a, b) => a.name.localeCompare(b.name) | ||
| ) | ||
| }) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Roll back the WSL record when the environment write fails.
addWslHostEnvironment writes the deployment record first and the environment second. Line 56 treats a leftover ownerless record as harmless. WslHostService disagrees: records(), recordForDistro and isKnownDistro read orca-wsl-host-deployments.json directly and do not check that an environment exists. So writeEnvironmentStore can fail at Line 97, for example on the byte-limit error or on the unreadable-id conflict. A crash between the two writes has the same effect. After either event, these things happen:
admitWslHostDistroreturnsalready-addedfor that distro on every later add.listDistrosreports anenvironmentIdthatruntimeEnvironments:listnever returns. The UI then has no environment it can remove.addOnce(wsl-host-service.ts Lines 314-318) disconnects and releases the holder but leaves the record in place.
The user cannot recover through the UI. Remove the record in a catch around the environment write. Separately, make the service ignore records whose environment is missing.
🐛 Proposed fix
const persisted = PersistedRuntimeEnvironmentSchema.parse(environment)
- writeEnvironmentStore(userDataPath, {
- version: 1,
- environments: [...readPersistedEnvironmentStore(userDataPath).environments, persisted].sort(
- (a, b) => a.name.localeCompare(b.name)
- )
- })
+ try {
+ writeEnvironmentStore(userDataPath, {
+ version: 1,
+ environments: [...readPersistedEnvironmentStore(userDataPath).environments, persisted].sort(
+ (a, b) => a.name.localeCompare(b.name)
+ )
+ })
+ } catch (error) {
+ try {
+ writeWslHostDeployment(userDataPath, args.id, null)
+ } catch {
+ /* keep the original error */
+ }
+ throw error
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| assertPairingUsesBridge(environment, args.record.localPort) | |
| writeWslHostDeployment(userDataPath, args.id, { | |
| ...args.record, | |
| environmentId: args.id, | |
| createdAt: now | |
| }) | |
| const persisted = PersistedRuntimeEnvironmentSchema.parse(environment) | |
| writeEnvironmentStore(userDataPath, { | |
| version: 1, | |
| environments: [...readPersistedEnvironmentStore(userDataPath).environments, persisted].sort( | |
| (a, b) => a.name.localeCompare(b.name) | |
| ) | |
| }) | |
| assertPairingUsesBridge(environment, args.record.localPort) | |
| writeWslHostDeployment(userDataPath, args.id, { | |
| ...args.record, | |
| environmentId: args.id, | |
| createdAt: now | |
| }) | |
| const persisted = PersistedRuntimeEnvironmentSchema.parse(environment) | |
| try { | |
| writeEnvironmentStore(userDataPath, { | |
| version: 1, | |
| environments: [...readPersistedEnvironmentStore(userDataPath).environments, persisted].sort( | |
| (a, b) => a.name.localeCompare(b.name) | |
| ) | |
| }) | |
| } catch (error) { | |
| try { | |
| writeWslHostDeployment(userDataPath, args.id, null) | |
| } catch { | |
| /* keep the original error */ | |
| } | |
| throw error | |
| } |
…ht back (stablyai#28402) * fix(ssh): a cancelled sign-in stays cancelled until the user reconnects Co-Authored-By: Claude <[email protected]> * test(ssh): drive the credential cancel through the IPC harness Co-Authored-By: Claude <[email protected]> * fix(ssh): an explicit server connect lifts the cancelled sign-in of its SSH host Co-Authored-By: Claude <[email protected]> * fix(ssh): the cancelled attempt may still offer a password; a successful sign-in lifts the decline Co-Authored-By: Claude <[email protected]> * test(ssh): build the managed-server link without the newer kind field Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: m4air <[email protected]> Co-authored-by: Claude <[email protected]> (cherry picked from commit ed18c2c) Release pick note: runtime-environment-connectivity-handlers.ts conflicted with main's WSL host series (stablyai#27874/stablyai#27940/stablyai#27933), which is not on this release. Kept only this PR's two lines there (the clearSshCredentialDeclinedForEnvironment import and call).
Stacked on #27916; folds in #27789 (C2, cherry-picked unchanged; #27789 can be closed once this lands). Part 1 of 2: the UI is in the stacked draft on top of this one.
ELI5
Windows users can (behind an Experimental switch) turn a WSL distro into a host, just like an SSH machine. This part is the plumbing: list the distros, set the distro up as a host, remember it, keep it connected, and forget it again.
What Changed
Before: the WSL pieces from C1–C6 (transport, distro holder, deploy and launch, bridge connection, liveness) existed but nothing used them; there was no way to add a distro as a host.
After (main process, nothing visible yet without part 2):
wsl-host-distro-list.ts): registered distros from theLxssregistry key (name, registration GUID, WSL 1 vs 2) plus running/stopped fromwsl --list --running, which never boots anything. Docker Desktop's distros are dropped.WslHostService.add): refuses WSL 1 (with thewsl --set-versionfix), an already-added distro, and a stopped distro unless the user explicitly asked to start it. Then it runs C4 deploy and launch through the C6 supervisor's user-initiatedconnect, and saves the result: a plain paired runtime environment (runtime:<envId>, named<distro> (WSL)) plus its C2 record inorca-wsl-host-deployments.json(distro, unbraced registry GUID, bridge and orcad ports). The environment id is C5's ownwsl:<distro>id, so liveness, the account shim (C9) and the record agree.onChangefeeds the service; a relaunch's new device token (or a moved bridge port) is written to the environment and record, and the old transport is retired so clients re-authenticate.hasUserVisibleWork. Runtime calls to a WSL host go through the same seam SSH-managed servers use (resolveManagedRuntimeEnvironment), which skips all SSH tunnel logic for WSL.release), drops the environment and the WSL record, and retires client-side state. The generic server remove routes WSL hosts here too.wsl-host-ssh-orcad-conflict.ts): before deploying, the distro's orcad identity (the public half of~/.orca/orca-e2ee-keypair.json; the private key never leaves the distro) is compared with every server this desktop already pairs with. A match means the distro already runs the orcad of, e.g., an SSH target at127.0.0.1:2222, and the add is refused with a message naming that server. Limits: an orcad deployed by another desktop is not ours to see (C4's activation admission still guards it), and a data dir moved off~/.orcais not checked. Conversion is later work.wslHosts:*) and a preload API that exists only on Windows (or under the e2e fake), plus theexperimentalWslHostssetting (default off; add is refused while off, and no lazy connect or holder adoption runs).ORCA_E2E_FAKE_WSL_HOSTS: an e2e-only connector that stands in for wsl.exe and points a "distro" at a headless Orca server, so CI on any OS drives the real add-host flow.Why
Reusing the paired runtime-environment store (rather than a new host kind) makes the WSL host a normal
runtime:<envId>everywhere: pickers, routing, terminals, the folder browser. The C2 record stays in its own file so builds older than #27685 never see a record they would reject; to such a build the host reads as a server it cannot reach, and nothing is lost. Lazy, user-driven connects follow the background-distro rule (awsl.exeinto a stopped distro boots it and, before WSL 3.0.1, can break interop in other distros). Refusing R25 now is safer than two desktop-side owners of one orcad install; converting reuses D0 later.Linked Issue
Track C of WSL via orcad (C7).
Visual Proof
N/A in this part: main-process only. Screenshots of the UI that uses it are on the stacked UI draft.
Testing
New unit tests:
wsl-host-service.test.ts(add, WSL 1 / added / stopped refusals, R25 refusal, deferred activation, flag off, token persistence fromonChange, lazy connect only for open work, remove, startup adoption),wsl-host-distro-list.test.ts(registry parse, Docker filter, running state),runtime-environment-wsl-host-store.test.ts(add, bridge-port check, refresh, remove).Gates run locally:
pnpm tc, affected main and renderer suites (1,098 files), oxlint,check:code-quality:changed(incl. React Doctor and design system), focus-read, layout-writer, max-lines, ts-nocheck, runtime-electron, reliability, dead-classes, zustand fan-out, anti-slop, process-host and compat-boundary imports, rpc-params and ACP catalogs, localization catalogs/extraction/coverage, node pin,pnpm format.Not run: a packaged build on a real Windows host. This isolated agent could not send commands to
win-lowspec, so real-host evidence is C4–C6's harness runs; C7's own wsl.exe paths are C4/C5/C6 code plus onereg.exequery and onesedread.AI Disclosure
Review
Agent skill upstream boundary
Notes
orcadDeployment.kind === 'wsl'before any SSH logic.\\wsl.localhostprojects are untouched.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Follow-up commits (review decisions)
78f9b911576One registry reader: C4'sreadWslDistroRegistryIdand the host distro list now sharereadWslDistroRegistrations, which returns the canonical lowercase unbraced GUID (what C2's schema accepts) plus each distro's WSL version. C7's private parser is gone. Tests cover braced registry output.6617ceefc3cWith the experiment off, main refuses to connect a WSL host (explicit or background); removal still works. The pre-deploy refusals moved towsl-host-add-admission.ts.dd1f76076f5Removing a connected WSL host now ends its orcad right away (only in a distro already running; never boots one), then releases the holder.Follow-up commits (win-lowspec smoke)
757393ca4d8(B2) A build without the orcad template now refuses WSL host add and connect before any deploy work, and skips lazy connects and holder adoption. The message is "This build of Orca can’t run WSL hosts (server files missing)." It uses the samehasOrcadTemplate()check SSH hosts use, exposed aswslHosts:getCapability, an optional preload call (older preloads leave it unknown).bd8af001c83Test support: the e2e WSL fake can re-read its distro list from a file, so a test can register a distro mid-run.Follow-up commits (win-lowspec smoke 2)
4162831657d(B1) Remove ends what Orca runs in the distro: terminals through orcad's terminal RPC (terminal.listthenterminal.stopper worktree), the terminal census until it proves zero sessions, then the managed decommission SSH hosts use (--complete-managed-stopwithretireIdleDaemon), which stops orcad and retires the now idle daemon. Anything left running (terminals, an unanswered census, a daemon that did not retire) is returned to the UI; the host is removed regardless. A host that isn't connected but whose distro is running is connected first (no boot) so the same path runs; a stopped distro runs nothing.4162831657d(B3) Turning the experiment off closes every connection and liveness watch, releases the holders so distros can idle-stop, and stops liveness relaunching for visible work; turning it on reconnects only hosts that open work needs.3182141e74b(B2, main half) WSL hosts are left out of the servers a phone lists or routes to through this desktop.Follow-up commits (awin smoke)
72d623a4a60Remove ends terminals through the host's routed environment (by environment id, with the saved pairing every other call uses) instead of the bridge's raw pairing offer, which failed fast against a real orcad. Removal first stops tracking the host (open work, connects, runtime calls), and a spawn guard in the connector refuses any holder, deploy or bridge for a distro whose host is gone, which ends the respawn loop seen after removal. A WSL host that isn't connected answers runtime calls with the reason instead of failing as an unreachable network server.20fd1a791d2Unreachable-server hints are chosen by the owner host's kind: WSL hosts get a reconnect hint, never Tailscale.7f94d922012The terminal list is parsed with a schema; the e2e fake logs its connects to a file and runs the real terminal steps against the headless server.Follow-up commit (awin re-smoke)
678f9e4ed26Remove closes each terminal by handle (terminal.close), so a terminal whose project is already gone no longer throwsselector_not_foundand aborts the removal; failures are named and the server is still asked to stop. "Stopped" is reported only when the census shows no session left, the daemon retired, and the orcad the distro records as active is the one this computer was connected to (by runtime id). A re-add that adopted an orcad the record does not name is reported, not claimed stopped.