Skip to content

fix(desktop): retry a failed netstat before Windows recovery gives up (0.11.0 backport of #25792) - #26474

Closed
bolichen97 wants to merge 1 commit into
release/0.11.0from
backport/0.11.0-pr25792
Closed

bolichen97 wants to merge 1 commit into
release/0.11.0from
backport/0.11.0-pr25792

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Ship #25792 on the 0.11.0 release line, so Windows recovery retries a failed netstat instead of giving up.

#25792 merged to main after release/0.11.0 was cut, so no 0.11.0 build has it.

Why it matters

On Windows a single failed netstat made the desktop app's port recovery stop early and leave the gateway down. Users install the release line, so a fix only on main reaches them one release late.

Not a goal

What changed (motivation → approach → change)

One commit: git cherry-pick -x of 043dd9f, the #25792 squash commit on main. It applied with no conflict. The desktop port probe (website/electron/windows-port.js, website/electron/runtime/gateway/port-holders.js) lets wedge recovery check the port up to 3 times, 10 s each, half a second apart, before it stops at "restart required"; the last failure's log says whether netstat timed out or exited with a code.

Backwards compatibility

Compatible: same change as #25792 on main; only the recovery path changes, and a check that fails every try still stops at "restart required" as before.

Removes nothing: same change as on main; no API, key, row or path is removed.

Tests

website/electron/test/windows-recovery-port-probe.test.js (from #25792), run on this branch as part of the gate below.

  • npm --prefix website run test:electron on this branch: 2816 tests, 2781 passed, 30 failed, 5 skipped. A clean release/0.11.0 on the same host fails the same 30 (identical list): they are host-dependent, not this change.
  • scripts/local-gate.py --base origin/release/0.11.0: the backend cross-surface set ran 26842 tests, 26783 passed; the 59 that failed (test_file_explorer_app.py, test_design_tweak_backend.py and three others) fail the same on a clean release/0.11.0 on this host (it reads /local/home as a sensitive path).
  • Local GPT and Opus review on this head: PASS, no findings.

Proof: not provable -- frontend test (prove.py runs Python only)

Determinism: the tests are the main PR's own, unchanged; their repeat and shuffled-order runs are recorded on #25792.

Manual verification

N/A - verified on #25792 itself; this is the same change on the release branch.

Screenshots / video

Why no screenshot: byte-identical cherry-pick of #25792; the visible change and its evidence are on that PR.

Related Issues

Part of #25790

Backport of #25792.

Sibling sweep

Siblings: none -- a backport of main fixes; the sibling sweep is on #25792

Pattern harvest

Not generalizable: backport of #25792; its harvest is recorded on that PR.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

…#25792)

Co-authored-by: w <w@k.local>
(cherry picked from commit 043dd9f)
@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 30, 2026 23:23
@bolichen97
bolichen97 requested review from CrysisDeu and removed request for a team October 30, 2026 23:23
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 83ec0758fe2d38bdc4a7530ab2c63f817c7af01a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing to check. The diff only touches the Electron main process (the netstat retry and its log lines), so it adds or changes no control, label or string a user would see.

[UX-REVIEWED] 83ec075

Description read

[DESCRIPTION-READ] f596eee0cfd3f73134f9851317a49d68f8222c6dc03c9b51be36df8035642274

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 83ec0758fe2d38bdc4a7530ab2c63f817c7af01a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: this is a straight cherry-pick of #25792 that adds a bounded retry and keeps recovery failing closed.

Notes

  • If netstat fails every time, the recovery path now waits up to about 31 s (3 × 10 s plus two 0.5 s pauses) before it reports "restart required", where it used to fail after one call bounded at 5 s. That is fine for a recovery path, but the user waits longer before seeing the message.

[DESIGN-REVIEWED] 83ec075

Description read

[DESCRIPTION-READ] 5f2d3560ce423fdfb94ca9f88df0451c0715abb94b66f213cf5285d1c3892cf8

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 83ec0758fe2d38bdc4a7530ab2c63f817c7af01a — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

This cherry-picks #25792 unchanged and fixes the failure where it happens. The non-retrying Windows snapshot probe in the same file is left alone, and that belongs on main, not in a backport.

Notes

  • Item 1 — symptom-level, 1 unfixed sibling: I searched website/electron (tests excluded) for windowsListenPids\b. Besides the call this PR changes, one production call is left: winListenPids (port-holders.js:107), used by snapshotGatewayPortPids. When that call fails, snapshotPortPids returns null (gateway-recovery.js:166), and on Windows a null snapshot blocks respawn, so one slow netstat can still stop recovery. Subtraction: make winListenPids call windowsListenPidsRetrying, so only one Windows probe spelling is left. Do it on main; the Goal says "No change beyond what fix(desktop): retry a failed netstat before Windows recovery gives up #25792 ships on main."

What this change ships

Inventory (4 items) — 3 justified

Intent: on the 0.11.0 release line, keep Windows desktop recovery from getting stuck at "restart required" when netstat fails once. This is a FIX (backport).

  1. Wedge recovery on Windows checks the port up to 3 times, half a second apart, before it stops at "restart required" — symptom-level; the snapshot probe still has no retry
  2. During recovery, each netstat attempt may run 10 s instead of 5 s — justified
  3. The last failure's log says whether netstat timed out or exited with a code — justified
  4. New exported helper windowsListenPidsRetrying, with one production caller — justified

[FIRST-PRINCIPLES-REVIEWED] 83ec075

Description read

[DESCRIPTION-READ] 5056051d914ca0f616f744ea19f4bfec512d4c702aaff2df0bb0252b92b615bb

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 83ec0758fe2d38bdc4a7530ab2c63f817c7af01a and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 83ec075

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 83ec0758fe2d38bdc4a7530ab2c63f817c7af01a false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 83ec0758fe2d38bdc4a7530ab2c63f817c7af01a — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 83ec075

Verdict parsed from the review's SHA-scoped output markers for commit 83ec0758fe2d38bdc4a7530ab2c63f817c7af01a.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 83ec0758fe2d38bdc4a7530ab2c63f817c7af01a false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 30, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved on behalf of the watch holder (bolichen). Design and First Principles pass on this head, UX skipped or pass, no conflict, no open change request.

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Folded into the combined 0.11.1 hotfix backport #26487, which carries the same cherry-pick of #25792 as its own commit. Closing this one so the release branch gets a single backport PR.

@bolichen97 bolichen97 closed this Oct 31, 2026
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants