fix(desktop): reload the main renderer after it is killed #20300
main fromrefs/pull/20300/head·merged by juliusmarminge View on GitHubProblem#
On Linux, a killed Electron main renderer leaves a white window. render-process-gone reports reason: killed, but the existing recovery branch ignores that reason even though it already handles crashes.
Change#
Include killed renderers in the existing bounded reload path. Keep the original window, delay reload, cap rapid retries, and reset the cap after the existing recovery window. Normal exits and destroyed windows remain quiet.
Scope and approval#
This is a focused exception for an obvious bug: one production condition changes. No new recovery policy or setting is introduced.
Verification#
Run vp test run apps/desktop/src/window/DesktopWindow.test.ts -t "recovers killed renderers". The single regression exercises killed reload, retry exhaustion, time-window reset, normal exit, window identity, and close-before-reload. It fails with the upstream condition and passes with this change. The test uses controlled Electron events and TestClock; it is not a new live OS-kill benchmark.
The requester stopped the remaining heavy checks. Completed focused results are recorded in the attached log; no repo-wide check was run.
Reproduction and focused verification log
Prepared with GPT-6.1-Sol through the Codex harness.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
9cec0aaMacroscope's review found this PR approvable — This is a focused production bug fix that reuses the existing delayed and bounded renderer-recovery mechanism for Electron's
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).killedreason. The accompanying regression test covers retry limits, recovery-window reset, normal exits, and closed-window behavior.No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
6759900a-7f08-4353-ad8e-f68fd114715c
📥 Commits
-
Reviewing files that changed from the base of the PR and between cfafb4bb54d244e4612f5681aad3832ea64cb0fb and 9cec0aa61c4bd641d1a057c9608606bd2ca8345d.
📒 Files selected for processing: 2
-
apps/desktop/src/window/DesktopWindow.test.tsapps/desktop/src/window/DesktopWindow.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
The renderer recovery handler now treats
"killed"process exits as recoverable. Tests cover reload limits, recovery after 60 seconds, clean exits, and destroyed windows.Changes: Renderer Recovery
Layer / File(s) Summary Killed exit recovery
apps/desktop/src/window/DesktopWindow.ts,apps/desktop/src/window/DesktopWindow.test.tsThe handler now classifies killed renderer exits as recoverable. Tests cover reload limits, recovery after 60 seconds, clean exits, and destroyed windows. Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
### Architecture SummaryMerge Risk: ⚪ Minimal · up to
9cec0-
Killed renderer exits can now use the existing reload recovery path. No actionable merge-blocking risk is identified beyond normal checks.
Architecture risk: 🔵 Low · up to
9cec0The change affects 1 system.
Changed systems:
apps/desktopArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — apps/desktop (service) was modified; 2 changed files map to changed impact.
Before / after behavior
- observed — Modified behavior in apps/desktop/src/window/DesktopWindow.test.ts: Added a renderer recovery test that verifies clean exits do not reload, killed events reload up to the tested limit, recovery can occur again after 60 seconds, and no reload occurs after the window is destroyed.
- observed — Modified behavior in apps/desktop/src/window/DesktopWindow.ts: Renderer process exits with reason
"killed"are now classified as recoverable, alongside crashes, out-of-memory exits, and abnormal exits; they are subject to the existing recovery limit and reload flow.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the main change: reloading the desktop renderer after a killed process. Description check The description includes all required sections. It explains the problem, the bounded recovery change, the scope exception, focused verification, limitations, supporting log, and the agent model and ha… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Description check
-
Explanation
The description includes all required sections. It explains the problem, the bounded recovery change, the scope exception, focused verification, limitations, supporting log, and the agent model and harness.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge merged this15ca727
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes