Skip to content

fix(preview): freeze render host selection at tab admission - #836

Merged
Mjones13 merged 3 commits into
mainfrom
fix/browser-host-bind-2d8c70e7-20261103
Nov 3, 2026
Merged

Mjones13 merged 3 commits into
mainfrom
fix/browser-host-bind-2d8c70e7-20261103

Conversation

@Mjones13

@Mjones13 Mjones13 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Client and agent tabs could choose their render host only when asynchronous placement ran, allowing a later default change to move an already opened tab. Popup adoption could also pair the opener's page with another companion attachment.

Freeze render-host selection synchronously before Manager publishes opened. Agent admission composes after reservation/adoption hooks; popups inherit only the opener's recorded host or explicit server. Conflicting prebindings and unsupported companion popup adoption are refused before another attachment. Placement retains typed companion not_started failures without fallback.

Failed initial admissions become inert before releasing bindings and closing sessions, including client opens and refused human popups already queued in the serial Manager mirror. Logical admission state survives runtime detach: an established companion tab keeps its Manager session, original binding and assignment through offline viewer retries. Reconnecting the companion and using Try again recreates the same logical tab on that host. Logical close waits for pending creation to settle before release and retires its lifecycle state; pending finalizers check their own instance. Existing capacity reservations, adopted page/context/CDP consistency and outcome fences remain covered.

Jones behavior uses the existing companion modules and narrow WS integration. The lifecycle correction stays in ServerBrowser because that owner controls runtime establishment, pending creation and ordered Manager-event consumption. Integration tests require its existing harness; the existing boundary coverage records that exception.

Refs PBH-COR-001.

Validation:

  • 99 focused tests pass: the preserved 94-test placement/WS/ServerBrowser/client/compatibility baseline and five deterministic cleanup regressions. Tests run serially with gated fakes and production Manager subscription ordering.
  • All five cleanup regressions fail against reviewed production source 0320dc682c43b71746befb115af5f9dcbaa75521: client and human-popup replay enter placement twice; offline reconnect destroys the established session; close during pending reconnect releases too early.
  • Removing the failed-admission fence, establishment guard or pending-settlement release guard causes the corresponding regressions to fail. Exact candidate bytes are restored after every negative control. Earlier admission/WS/popup controls remain recorded in the prior implementation receipt.
  • Scoped server package native-wrapper typecheck, format/lint, strict boundary, server unused-code and generated GraphQL checks pass.
  • Composed with canonical main 72485ec85cd00fc604ee5a2e708fd03a183d2c34; incoming input-isolation source matches main exactly and both lanes' boundary records are retained. All 99 tests and scoped checks pass on composed head 313f3b12d1a92b960b250c58f877abf7b5c8005e (typecheck used its valid cache).

Source qualification uses real application services, real companion registry/transport disconnect and reconnection, and synthetic Playwright/CDP attachment seams. Installed apps, native Electron/Apple Silicon behavior, socket authentication and interactive UI evidence remain unverified. ROOT owns independent re-review, current-head CI and merge. No runtime installation, update or restart is part of this change.

Implemented by GPT-6.1 Sol (xhigh repair), Codex harness in Jones Code.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@Mjones13
Mjones13 merged commit 15242e5 into main Nov 3, 2026
30 checks passed
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