Skip to content

test(browser): repair AI E2E CDP fixture - #133029

Merged
steipete merged 1 commit into
mainfrom
codex/frv-browser-cdp-fixture
Aug 30, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/frv-browser-cdp-fixture

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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/version endpoint 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.ts is removed. Existing assertions and timeouts remain unchanged. No production behavior or runtime fallback paths change, and no new mocks are added.

Validation:

  • Original frozen release commit bee48f7f56808eff2f7aaa035509b8a39b3988e2: all 7 cases fail with CDP endpoint did not expose a usable WebSocket URL.
  • Repaired file: all 7 cases pass, including real HTTP discovery, WebSocket connection reuse, and transport cleanup.
  • Six transport/session/snapshot sibling files: 76 tests pass, including contextless worker filtering, malformed JSON, redirect handling, protocol errors, target selection, SSRF, and connection retirement.
  • Full changed-file gate passes: both extension typechecks, full extension lint, all three dead-export scans, doctor-contract tests, and all remaining repository guards.
  • Isolated Codex autoreview passes with no actionable findings at the configured P0 threshold.
  • Focused E2E runs use the existing OPENCLAW_E2E_SKIP_BUILD=1 contract 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).

@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 10:40 PM ET / August 30, 2026, 02:40 UTC.

ClawSweeper review

What this changes

The 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 provenance

Possible regression — probable (reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep 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
Reviewed head: 2af4f1509b219a9b44be006db05675d6bee35090

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused, production-neutral fixture repair that follows the current managed-transport boundary.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable to this maintainer-authored test-only PR; the supplied body records focused before/after fixture validation, while the review itself remained read-only.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable to this maintainer-authored test-only PR; the supplied body records focused before/after fixture validation, while the review itself remained read-only.
Evidence reviewed 6 items Introduced fixture exercises the new boundary: The PR starts a loopback /json/version server, returns a WebSocket debugger URL, and asserts discovery, one reused socket connection, and socket cleanup.
Production owner uses managed discovery and transport: The browser connection owner resolves the endpoint before invoking the managed transport, so a null discovery mock no longer represents the HTTP CDP path.
Playwright transport contract checked: The declared Playwright 1.62.1 transport interface accepts send, close, onmessage, and onclose; the fixture’s mock consumes the same close callback used by the production transport.
Findings None None.
Security None None.

How this fits together

Browser 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]
Loading

Before merge

  • Complete next step (P2) - No repair dispatch is appropriate because this PR already contains the narrow fixture repair and carries the protected maintainer label.
Agent review details

Security

None.

PR surface

Source -27, Tests +53. Total +26 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 0 27 -27
Tests 1 86 33 +53
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 86 60 +26

Review metrics

Metric Value Why it matters
Production vs test LOC production +0/-0; tests/test support +86/-60 The patch is confined to an E2E fixture and deletes the obsolete single-consumer mock helper.

Technical review

Best 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.

Labels

Label changes:

  • add P2: The broken fixture prevents the browser AI release-test cases from exercising their intended existing behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable to this maintainer-authored test-only PR; the supplied body records focused before/after fixture validation, while the review itself remained read-only.

Label justifications:

  • P2: The broken fixture prevents the browser AI release-test cases from exercising their intended existing behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable to this maintainer-authored test-only PR; the supplied body records focused before/after fixture validation, while the review itself remained read-only.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let exact-head required CI complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 3322b95 into main Aug 30, 2026
171 checks passed
@steipete
steipete deleted the codex/frv-browser-cdp-fixture branch August 30, 2026 02:48
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: browser maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant