feat(reliability): isolated gauntlet, warm Runtime replay, and lifecycle fixes - #98
Merged
Merged
Conversation
Make the client pool the sole requester-retirement source, fold replay state into Runtime waiters, and drop redundant cache invalidation and navigation eviction. Collapse handoff completion into one wait object, share session resolution and page unbinding, and look up redaction refs directly. Also fix two races: same-ID identity changes now check and claim atomically, and a tab detached before its root commits clears relay tab state.
Decode relay and receipt payloads with shared schemas, validate case selection before building, share owned-process spawning and deadlines, report cleanup failures once, reuse withSession in snapshot cases, and share build output preparation.
Move Effect imports off the removed unstable paths, adopt PascalCase Config and CLI constructors, and update Playwright, ws, Vitest, Knip, and related tooling to their latest releases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Browser Control's hostile-page gauntlet could only run against the user's live browser and relay, so regressions were hard to reproduce and timing evidence was not trustworthy. Behind it sat real reliability bugs. Adopting a busy tab could hang. Reconnecting a canonical CDP client always paid a ~3 s Runtime reset. Rotated credentials and OAuth fragments leaked into captures. Concurrent same-ID session lifecycle calls could acknowledge uncommitted state.
What Changes
Isolated regression loop.
pnpm gauntlet:isolatedbuilds this checkout outside the source tree. It launches a disposable Chromium profile with the real MV3 extension and a private relay/HOME/ports, and owns every process group. Leaks, cleanup failures and budget overruns can never be relabelled as expected failures. Correctness failures are never retried into green. A PR lane runs six real-extension cases; a nightly lane repeats the full suite three times.Faster warm reconnect. After its frame-tree response, a canonical client that reconnects to a live target receives validated cached execution contexts. It no longer waits for a native event and then resets Runtime.
Correctness fixes
session-page/adopted-initialization-timeoutwithout running user code or dropping the tabsession-page/context-read-timeout; operation=page.titlewithout page replacement#access_token=fragments could appear in artifacts${BC_SECRET_N}refs; profiles store only current valuesstartBROWSER_CONTROL_AUTOSTART=falselets a supervisor make calls fail instead of spawning a replacement relay.Runtime Context Replay
The client pool is the only thing that retires requester state, for announced and silent detaches alike. Cache eviction relies on Chrome's destroyed/cleared events rather than
Page.frameNavigated, matching Playwright's Chromium path.Dependencies
4.0.0-rc.112 → rc.118:effect/unstable/*imports becomeeffect/*, and theConfigand CLI constructors are renamed to PascalCase.--helpoutput is byte-identical across all 39 commands.Scope
This PR owns the isolated harness, the fixes above, the Runtime replay and the dependency update. Follow-ups are tracked separately:
Verification
cleanupVerified: true, 143 s total; runtime replay connect + evaluate took 10.4 ms.