Conversation
After three consecutive pre-ready crashes or readiness timeouts, stop the restart loop and use the Windows backend for this launch. Restarts stay suppressed while that recovery is pending, and the dialog only reports a bounded failure category. Co-authored-by: maco <macodev00@users.noreply.github.com>
Owner
Author
|
Opened upstream. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes pingdotgg#14393. Supersedes pingdotgg#14740.
Problem
WSL-only mode can sit on "Connecting to WSL..." forever when the backend keeps crashing, or stays up but never answers, after preflight has already passed. The splash has no controls. Exits before ready restart without a cap, and a live unreachable process is probed again every minute.
pingdotgg#14393
Change
After three consecutive pre-ready failures, the primary stops scheduling restarts and asks the pool to recover. That covers both loops: a child that exits before it is ready, and a live child whose readiness budget expires three times (the process is killed so the same exit path owns recovery).
The pool shows a fixed error box and applies the existing in-memory Windows fallback, so the next
configResolvestarts Windows for this launch and the next app start tries WSL again. A Windows primary has no distro and keeps the normal restart loop.Restarts are suppressed for the whole time a startup-failure hook is pending, including inside
scheduleRestartand in the restart fiber.stop()interrupts the hook and a recoverystart()no-ops if quit already moved the stop generation. Dialogs and log annotations only carry a bounded category (exitedorunreachable), an optional exit code 0–255, and the distro name. The raw cause stays on the log cause.Scope and approval
Accepted bug: pingdotgg#14393 (apps/desktop). Triage asked for the same in-memory Windows fallback used for a non-fatal preflight failure, for both the crash loop and the live-but-unreachable loop.
This replaces pingdotgg#14740. Recovery is one hook after a fixed cap, not a concurrent replace-by-run-id lifecycle. A process exit does not schedule a restart while that hook is pending.
Verification
Platform: Linux 6.12.94+, Node v24.13.1, Cursor cloud VM. No Windows host and no WSL distro were available, so this was not exercised in a live Electron session. The new UI is a native error box with fixed copy, not a layout change, so there is no before/after screenshot.
Observed:
Observed: exit 0, no findings.
Observed: exit 0. One pre-existing suggestion in
src/app/DesktopClerk.test.ts(preferSucceedSomeOrNone). No errors in the changed files.The new tests check: the hook runs after three pre-ready exits and a 30s clock advance does not spawn again; a declined hook resumes the restart loop once; exits after ready do not count;
stop()during the hook does not apply recovery; three readiness budgets kill the live child and fall back without an early restart; the pool dialog text is the fixed template (no URL, noMODULE_NOT_FOUND) and the in-memory settings switch to Windows while keeping the distro.Limitations
wslOnlyand the distro stay on disk, so the next launch tries WSL again.libatomic.so.1andffi-rsMODULE_NOT_FOUNDare separate and not handled here.Model: Grok 4.7. Harness: Cursor cloud agent.