Skip to content

feat(browser): compose paired client host lifecycle - #14558

Draft
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-host-command-transportfrom
sta-4150-browser-client-host-lifecycle
Draft

feat(browser): compose paired client host lifecycle#14558
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-host-command-transportfrom
sta-4150-browser-client-host-lifecycle

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 +418 −2 +416
Prod 6 +348 −39 +309

Summary

  • Compose the authenticated paired-runtime browser-host lease with the bounded per-page command dispatcher.
  • Install exact lease authority synchronously before the first page command can run.
  • Keep command-result settlement at a hard maximum of 16 concurrent and 256 unsettled, beneath the same-socket 32-request transport ceiling.
  • Close result transport before aborting owned handlers, while preserving cleanup failures and exact page-generation retirement fences.

Why this stage

Draft PR #14557 proves command results can settle on the exact authenticated attach socket, but intentionally leaves desktop lifecycle ownership and the 32-request versus 256-command capacity policy unresolved. This stage closes those two inert composition gaps before any Electron page handler, capability advertisement, or placement activation exists.

The pinned T3Code reference also keeps logical preview metadata on the server while Electron main owns per-tab WebContents registration and queues navigation until the guest exists. Orca follows that lifecycle shape, but retains stricter execution-host proxy partitions, authenticated authority generations, and fail-closed remote DNS.

Causal evidence

On parent 31f812a, the deterministic oracle failed because the composed host module did not exist, eight completed results immediately exceeded a configured four-request ceiling, and excess unsettled results did not fence the lease. The candidate passes synchronous ready-plus-command delivery, bounded settlement, overflow teardown, transport-close-before-abort ordering, throwing and falsy cleanup failures, exact retirement, and late non-cooperative handler settlement.

Compatibility

This remains production-inert. No RPC registration, runtime capability advertisement, client-placement selection, Electron renderer IPC, BrowserPane behavior, server/offscreen placement, SSH or WSL routing, folder/worktree behavior, or browser.screencast.v1 behavior changes. Old and non-v1 peers keep the existing ready/revoked path; future activation must capability-gate this v1-only facade and preserve server placement for older or browserless clients.

Validation

  • 50 focused lifecycle, lease, and dispatcher tests passed.
  • 810 runtime/browser/shared test files passed: 9,711 tests, with 24 existing skips.
  • Full node, CLI, and web typecheck passed.
  • Native/type-aware zero-warning audits and changed-code quality passed.
  • Reliability-gate, max-lines, formatting, and diff checks passed.
  • Cross-version wire compatibility passed 5/5.
  • CLI build and executable artifact verification passed.
  • Three fresh correctness, lifecycle/compatibility, and security/performance rereviews are clean.

One initial unbounded parallel run had an unrelated shared-client socket test fail to connect; that file passed 19/19 in isolation and the full four-worker rerun passed cleanly.

Remaining activation blockers

  • Compose the exact execution-host route, route-scoped Electron session, quarantined WebContents generation, and renderer registration into the command handler.
  • Add capability-qualified production registration without changing legacy or server placement.
  • Prove headed, headless, and browserless paired-runtime behavior, renderer crash/reload reconciliation, reconnect inventory, and physical macOS/Linux/Windows, SSH, and WSL coverage.
  • Keep default client placement and all live migration disabled until those gates pass.

STA-4150

Stacked on #14557. Do not merge.

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-lifecycle branch 2 times, most recently from 42f2ae3 to 7835ff5 Compare August 14, 2026 20:14
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-lifecycle branch 2 times, most recently from 6ef455c to e9dc3e0 Compare August 14, 2026 23:17
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-lifecycle branch 2 times, most recently from 2c514ee to ac4461f Compare August 15, 2026 00:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-lifecycle branch from ac4461f to 2899d2b Compare August 15, 2026 02:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-lifecycle branch from 2899d2b to ee39875 Compare August 15, 2026 03:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-lifecycle branch from ee39875 to 62dfcf7 Compare August 15, 2026 08:53
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-lifecycle branch from 62dfcf7 to d30e941 Compare August 15, 2026 10:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-lifecycle branch from d30e941 to 2958f5a Compare August 15, 2026 11:34
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-lifecycle branch from 2958f5a to d2d6d47 Compare August 15, 2026 12:30
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.

1 participant