Repository navigation
test(browser): repair AI E2E CDP fixture - #133029
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 10:40 PM ET / August 30, 2026, 02:40 UTC. ClawSweeper reviewWhat this changesThe PR replaces obsolete Chrome DevTools Protocol (CDP) discovery mocks in the browser AI E2E fixture with a loopback HTTP/WebSocket endpoint and removes the unused shared mock helper. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer review: this maintainer-labeled PR repairs a release-test fixture after the managed CDP transport change, and no introduced correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherBrowser AI commands discover a Chrome CDP endpoint, open a managed WebSocket transport, and pass it to Playwright before collecting snapshots or interacting with pages. The fixture now exercises discovery, reuse, and teardown at that boundary while retaining fake pages for the AI assertions. flowchart LR
A[Browser AI test] --> B[Loopback CDP discovery]
B --> C[Managed WebSocket transport]
C --> D[Playwright connection]
D --> E[Snapshot and click assertions]
D --> F[Connection cleanup]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -27, Tests +53. Total +26 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land a deterministic fixture that covers managed HTTP discovery, WebSocket reuse, and cleanup without expanding the browser runtime or adding a parallel mock path. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the prior fixture forced HTTP discovery to return no endpoint, while the current connection owner requires a discovered WebSocket URL before handing its managed transport to Playwright. Is this the best way to solve the issue? Yes: exercising the local HTTP-discovery and WebSocket lifecycle is the narrowest maintainable repair, while the existing fake pages continue to isolate AI snapshot and interaction assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2646feaaf553. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
The full release Repo E2E run failed all seven Playwright AI tests before reaching their snapshot or interaction assertions. The tests still mocked Chrome discovery to return no endpoint, although #132419 moved every connection through the managed WebSocket transport before Playwright connects.
This replaces the obsolete discovery mock with a real loopback HTTP
/json/versionendpoint and WebSocket upgrade on an ephemeral port. The existing fake Playwright pages remain responsible for their snapshot and click cases. Their fake browser now closes and awaits the actual managed transport, and teardown waits for both socket ends before shutting down the server.All seven original cases remain. The connection-reuse case additionally checks one discovery request and one WebSocket connection, and every case verifies socket cleanup. The single-consumer
pw-session.mock-setup.tsis removed. Existing assertions and timeouts remain unchanged. No production behavior or runtime fallback paths change, and no new mocks are added.Validation:
bee48f7f56808eff2f7aaa035509b8a39b3988e2: all 7 cases fail withCDP endpoint did not expose a usable WebSocket URL.OPENCLAW_E2E_SKIP_BUILD=1contract because these tests import source and own their complete fixture; no generated runtime artifact is consumed.Production LOC: +0/-0. Tests and test support: +86/-60 (net +26).