Skip to content

fix(browser): recover browser host admission fairly - #14747

Closed
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-tunnel-retired-frame-isolationfrom
sta-4150-browser-host-admission-fairness
Closed

Jinwoo-H wants to merge 1 commit into
sta-4150-browser-tunnel-retired-frame-isolationfrom
sta-4150-browser-host-admission-fairness

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​294 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​294
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​293 $\color{#cf222e}{\Huge{\mathbf{−}}}$​65 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​228

Summary

  • reserve browser-host long-poll capacity across authenticated paired devices: 8 global slots, 4 per device
  • cap asks plus browser hosts at 12 of 16 slots so ordinary waits retain one quarter of the budget
  • retry explicit runtime_busy admission pressure with deterministic client-specific jitter inside the existing initial attach timeout and negotiated reconnect grace

Causal evidence

Before this stage, one paired device's four hosts filled the global browser-host cap and prevented a second device from attaching. Initial and reconnect runtime_busy responses were terminal. Raising only the host cap reproduced a second failure: asks plus hosts could consume every long-poll slot and starve ordinary waits.

The focused oracle proves per-device admission, fifth-host rejection, exact device/global/class counter release, second-device survival, wait reservation, initial retry success/expiry/close cleanup, and reconnect authority preservation.

Compatibility

No exchanged field, opcode, capability, payload, placement, publication, or server-hosted browser behavior changes.

  • new client + old server: retries the old runtime_busy response
  • old client + new server: keeps terminal client behavior but benefits from fairer server admission
  • new client + new server: recovers automatically while capacity returns
  • SSH, WSL, headed/headless/browserless hosts, folder workspaces, worktrees, and server placement are unchanged

The remaining fairness cost is explicit: the global budget guarantees two saturated four-host devices, not an arbitrary number of devices. Later devices retry until capacity returns.

Validation

  • 2 focused files / 16 tests
  • 15 broader attach/reconnect/authority files / 159 tests
  • Node, CLI, and web typecheck
  • root lint, native audit, changed-code quality, 87 reliability gates, max-lines ratchet, localization, formatting, and diff checks
  • 32-patch latest-main range-diff: every patch identical

Current origin/main@5b7f44278a has one unrelated type-aware warning at config/scripts/pr-test-loc-summary.test.mjs:88, introduced by #14738; this branch does not modify that file.

Linear: STA-4150

Stacked on #14694. Draft only; do not merge or mark ready.

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-admission-fairness branch from e89bf6a to dc85d15 Compare August 15, 2026 08:56
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-admission-fairness branch from dc85d15 to 4d40036 Compare August 15, 2026 10:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-tunnel-retired-frame-isolation branch 2 times, most recently from 4b52893 to ec6690b Compare August 15, 2026 11:34
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-admission-fairness branch from 4d40036 to 2b289c6 Compare August 15, 2026 11:34
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-tunnel-retired-frame-isolation branch from ec6690b to e9aa426 Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-admission-fairness branch from 2b289c6 to e93ede0 Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-admission-fairness branch from e93ede0 to ad2334b Compare August 16, 2026 09:09
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing because this browser authority/admission stage is already implemented on current main (ad2156c3584). I compared the complete production patch, body/discussion, and regression intent with the current extracted modules.

Main retains the exact admission policy in the extracted runtime-rpc state/request-admission/long-poll modules: browser hosts use 50% of the total long-poll budget, half of that per paired device, and asks plus browser hosts use at most 75%, leaving ordinary waits capacity. Device/class/global counters release on the paired path. The admission-recovery helper differs only by its moved import: initial runtime_busy retries remain bounded by the original deadline with client-specific jitter and cancellation; negotiated reconnect treats capacity pressure as recoverable without replacing authority. All eight introduced regression names remain.

Validation: current composition, executor-fencing and command-admission suites passed 37 tests; browser-host runtime admission passed 4 tests. Tests ran with ORCA_BACKGROUND_LAUNCH=1 and two workers. This is supersession of this stage, without asserting every broader STA-4150 activation criterion.

@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