A fatal WSL preflight failure (no node, wrong version, missing build tools)
used to reschedule the backend forever with no cap and no UI, so in wsl-only
mode the app sat invisible (no onReady, no window) retrying a setup that can't
fix itself.
Classify preflight failures as fatal vs transient. Transient ones (WSL cold-
starting, wslpath while the VM boots) keep retrying so the backend self-heals.
Fatal ones stop after MAX_PREFLIGHT_FAILURE_ATTEMPTS and fire onPreflightFailed.
On the primary the pool wires that to show an error dialog and persist Windows
mode, so the manager's next restart re-resolves the primary as Windows and a
window opens instead of hanging.
The WSL preflight ran probes via 'bash -l -s' and the backend launched bare
'node' via 'wsl.exe -- node'. Both miss version-manager-installed node: nvm/
fnm/asdf/volta hook in below the interactive guard at the bottom of .bashrc,
which a non-interactive login shell returns before reaching, and a bare
'wsl.exe -- node' uses the non-login PATH. So wsl-only mode failed preflight
(or launched the wrong node) for the common nvm setup.
Source the managers explicitly via a preamble prepended to every WSL probe,
resolve the absolute node path the preflight validated, and launch with that
exact path so preflight and launch agree on one node.
Align the four list/path/IP/home probe fallbacks with the convention
upstream adopted in #2968: replace Effect.catch(() => Effect.succeed(x))
with the more direct Effect.orElseSucceed(() => x). Behavior is
identical (recover from the error channel with a default); silences the
new catchToOrElseSucceed lint.
Upstream #2964 migrated the workspace test imports from "vitest" to
"vite-plus/test" and dropped vitest as a resolvable module. Our WSL
test files predate that migration and still imported from "vitest",
which broke typecheck (TS2307) after merging main. Repoint them.
mergeWslEnv split the user's WSLENV on every colon and re-serialized it,
collapsing empty :: segments, trimming, and de-duplicating entries. That
diverged the forwarded value from what the user configured on Windows.
Keep the existing WSLENV byte-for-byte and only append the secret names
we forward that aren't already declared. Empty segments are WSL no-ops,
so nothing stopped forwarding, but verbatim preservation matches intent
(and the test name) and removes the surprise.
isLocalHostIpv4 matched interface family against the string IPv4 only.
Some Node builds report family as the numeric 4 (Electron 41 / Node 22
reports the string, but the representation has varied across versions),
which would make mirrored-mode detection silently miss and leave the
renderer pointed at the distro IP instead of loopback. Normalize via
String() and accept either form.
The merge combined our handleBackendReady(httpBaseUrl) signature change
with an upstream-added test that still yielded it as a bare Effect.
Pass the resolved URL like the other call site so the merged test
typechecks against the function form.
Resolve conflicts from the upstream bun->pnpm+Vite migration (#2899),
relay tunnels (#2837), and proof-key bootstrap auth:
- apps/web/src/environments/primary/auth.ts: upstream switched the
contracts import to `import type` and added ServerAuthSessionMethod;
keep that and re-add PRIMARY_LOCAL_ENVIRONMENT_ID as a value import
(still used at runtime to find the primary bootstrap entry).
- apps/web/src/environments/runtime/catalog.ts: keep both new optional
fields on SavedEnvironmentRecord (our desktopLocal marker and
upstream's relayManaged).
- apps/server/src/auth/PairingGrantStore.test.ts: keep upstream's new
proof-key thumbprint test and our reusable-bootstrap-grant test
(the desktop bootstrap credential is reusable: remainingUses
unbounded, 24h TTL).
- apps/web/src/components/settings/ConnectionsSettings.tsx: render both
the WSL row and upstream's CloudLinkRow in the connected section.