Skip to content

feat(browser): retire route pages on process loss - #14519

Closed
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-page-release-barrierfrom
sta-4150-browser-webcontents-crash-fencing
Closed

Jinwoo-H wants to merge 1 commit into
sta-4150-browser-page-release-barrierfrom
sta-4150-browser-webcontents-crash-fencing

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​94 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​91
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​240 $\color{#cf222e}{\Huge{\mathbf{−}}}$​128 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​112

Summary

Adds the next inert STA-4150 lifecycle layer on top of #14518:

  • routes exact guest process loss and natural destruction through the existing page-authority retirement barrier
  • retires every registered or unregistered route guest owned by a crashed main renderer while leaving unrelated renderer guests alone
  • revokes navigation before downstream retirement work and prevents authority resurrection when retirement throws or cannot start
  • keeps close, route-policy retention, tuple fencing, and bounded capacity on the same exact destroyed-acknowledgement path

Causal evidence

The parent safely retired pages only when its logical owner explicitly released them. Deterministic tests were red because BrowserRouteSessionRegistry had no exact lifecycle retirement entry point, guest render-process-gone did not end logical authority or close the guest, and main renderer process loss did not retire its route guests. The candidate makes those same tests green through the existing opaque-authority barrier rather than adding a parallel crash cleanup path.

Validation

  • 3 focused files / 122 tests
  • 56 main-browser files / 763 tests
  • full typecheck plus a post-format node typecheck
  • native and type-aware code-quality audits
  • changed-code, reliability-manifest, max-lines, formatting, and diff checks
  • two fresh correctness and security/performance reviews: no publication blockers
  • parent feat(browser): hold route policy through page retirement #14518 CI fully green

Compatibility and rollout

No exchanged field, RPC, capability advertisement, persisted schema, renderer IPC, or production page-preparation/registration/grant caller changes in this PR. Existing local/server/offscreen browsers, old clients, SSH/WSL routes, folder workspaces, git worktrees, and headed/headless/browserless placement retain current behavior.

This remains deliberately inert and is not activation-ready. Prepared-but-unregistered pages do not yet have trusted renderer ownership. Real Electron crash/reload and ordinary process-swap ordering are unproven; service workers, downloads, active requests, connections, storage, and network-service settlement remain outside this barrier; and a close or retirement that never settles reserves policy and capacity indefinitely.

ELI5

If the future client-hosted browser tab or the Orca window containing it crashes, this makes the exact tab lose its permission immediately and enter the same locked cleanup lane as an ordinary close. It does not turn the feature on.

Visual Proof

N/A — this is an inert main-process lifecycle contract with no rendered UI or production caller.

Linear: https://linear.app/stably/issue/STA-4150/refactor-remote-browser-to-client-hosted-electron-webviews

Stack: #14471
Parent: #14518

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch 2 times, most recently from fd133c1 to f56fc16 Compare August 14, 2026 20:14
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch from f56fc16 to 247697e Compare August 14, 2026 21:01
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch from 247697e to 141d628 Compare August 14, 2026 23:17
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch from 141d628 to 5fb180a Compare August 15, 2026 00:44
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch from 5fb180a to 099a6a6 Compare August 15, 2026 00:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch from 099a6a6 to 5c24dab Compare August 15, 2026 02:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch 2 times, most recently from 8cfdf16 to daadc84 Compare August 15, 2026 08:53
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch from daadc84 to ccb5eb3 Compare August 15, 2026 10:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch from ccb5eb3 to c47d341 Compare August 15, 2026 11:34
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch from c47d341 to dbace0f Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-crash-fencing branch from dbace0f to dd5158f Compare August 16, 2026 09:09
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing because this guest and owning-renderer process-loss retirement stage is already implemented on main (a93e31a9339). I reviewed the proposed production patch, body, discussion, and added regression intent against the current modules.

The route guest lifecycle now routes render-process-gone and natural destruction into exact logical-page retirement. retireRenderer revokes registered and unregistered guests owned by that renderer and retires prepared pages; unrelated renderer guests remain isolated. Main-window process-loss wiring is preserved in window/main-window-focus-lifecycle.ts. All five introduced test cases remain.

Opaque authority matching, synchronous navigation revocation, fail-closed retirement exceptions, and destroyed-acknowledgment policy/capacity retention continue through the shared barrier.

Validation: the six current partition/session/WebContents/main-window suites passed 106 tests with ORCA_BACKGROUND_LAUNCH=1 and two workers. This establishes supersession of this stage; it does not assert all of STA-4150’s original cross-platform activation criteria are complete.

@OrcaWin OrcaWin closed this Oct 26, 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