Skip to content

fix(browser): connect managed CDP through the correct proxy endpoint - #114546

Merged
steipete merged 1 commit into
mainfrom
codex/fix-browser-managed-cdp-proxy
Jul 27, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-browser-managed-cdp-proxy

Conversation

@steipete

@steipete steipete commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Managed browser sessions can route the local Chrome DevTools Protocol handshake through an HTTP forward proxy, causing real page snapshot requests to fail.

Why This Change Was Made

Keep the existing exact managed-CDP proxy bypass active throughout Playwright's asynchronous handshake. Ordinary HTTP remains proxied and unrelated loopback requests remain blocked.

User Impact

A managed browser behind an enabled proxy can open a real page and return an interactive snapshot without relaxing global network or proxy policy.

Evidence

Real end-to-end proof

Exact commit ec3e8ca7292fbb85296667b2a58c4803aa626c12; trusted 16-vCPU Blacksmith runner, production pnpm build, actual Chrome 149, actual OpenClaw gateway, and an instrumented real HTTP forward proxy.

proxy validate --json --allowed-url http://proxy-proof.openclaw.invalid/ordinary
=> ok: true; external proxy request: HTTP 200
browser --browser-profile proof-local open http://127.0.0.1:29972/
=> managed Chrome started; CDP 127.0.0.1:29974
browser --browser-profile proof-local snapshot --interactive --urls
=> button "Save"
=> link "Docs"
=> Docs -> https://docs.openclaw.ai/browser-cdp-live
ordinaryProxyHits=1; blockedCdpHits=0; blockedOtherLoopbackHits=1
browser stop => running: false
scenario runStatus=succeeded; exitCode=0; duration=34.790s

The actual forward proxy observed ordinary outbound traffic, never observed a CDP request, and continued blocking a separate loopback canary. The isolated browser and Testbox were stopped. The Actions runner may finish its cleanup asynchronously; the authoritative scenario result is the successful delegated-run timing JSON.

AI-assisted. Source, dependency contract, regression proof, exact CI, and actual managed-browser behavior were independently reviewed.

Fixes #105306

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 27, 2026
@steipete
steipete marked this pull request as ready for review July 27, 2026 11:44
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 7:49 AM ET / 11:49 UTC.

ClawSweeper review

What this changes

The branch wraps Playwright’s managed-browser CDP connection in the existing exact managed-proxy bypass and adds regression tests for discovered and direct CDP endpoints.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

Keep this PR open for maintainer handling: the patch is a focused, plausible repair that reuses the existing exact-URL managed-proxy bypass during Playwright’s CDP handshake, but the external-PR gate still needs redacted after-fix evidence from a real managed browser session with the proxy enabled. Likely related people: widingmarcus-cyber (high confidence for the earlier CDP proxy-bypass work) and vincentkoc (medium confidence for adjacent browser/CDP maintenance).

Priority: P1
Reviewed head: ec3e8ca7292fbb85296667b2a58c4803aa626c12

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and targeted regression coverage look solid, but the required real after-fix browser/proxy proof is still missing.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body supplies targeted regression-test and CI claims, but not inspectable after-fix evidence from a real managed browser session with the proxy enabled; add a redacted terminal transcript, runtime log, or recording showing the successful snapshot path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body supplies targeted regression-test and CI claims, but not inspectable after-fix evidence from a real managed browser session with the proxy enabled; add a redacted terminal transcript, runtime log, or recording showing the successful snapshot path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Existing proxy-bypass contract: Current main already provides a scoped managed-proxy bypass that registers the exact CDP URL and releases it when a synchronous result or promise settles; the branch applies that existing contract to the Playwright handshake rather than adding a new proxy policy.
Targeted branch change: The branch nests the exact managed-proxy bypass around the existing loopback NO_PROXY scope for chromium.connectOverCDP, preserving both guards until the connection promise settles.
Regression coverage: The branch adds connection-scoping tests that assert the managed bypass remains active through a discovered WebSocket CDP handshake and is released afterwards.
Findings None None.
Security None None.

How this fits together

OpenClaw’s browser plugin discovers a managed Chrome DevTools Protocol endpoint and connects Playwright to it for snapshot and page operations. The connection must bypass the operator-configured forward proxy only for the local CDP target, while ordinary browser traffic retains its existing routing policy.

flowchart LR
  A[Browser snapshot request] --> B[Managed Chrome endpoint]
  B --> C[CDP endpoint validation]
  C --> D[Scoped proxy bypasses]
  D --> E[Playwright CDP handshake]
  E --> F[Browser session and snapshot]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body supplies targeted regression-test and CI claims, but not inspectable after-fix evidence from a real managed browser session with the proxy enabled; add a redacted terminal transcript, runtime log, or recording showing the successful snapshot path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The PR body reports regression tests and CI runs, but it does not yet contain inspectable after-fix evidence from a real managed browser with proxy.enabled enabled; merge should wait for a redacted terminal transcript, runtime log, or equivalent live proof.
  • Resolve merge risk (P1) - The maintainer label is protected review context, so this PR requires explicit maintainer handling even if the remaining proof is supplied.
  • Complete next step (P2) - A protected maintainer label requires explicit handling, and only the contributor can supply the missing real-session proof for their claimed environment.
Agent review details

Security

None.

PR surface

Source +2, Tests +93. Total +95 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 6 4 +2
Tests 1 93 0 +93
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 99 4 +95

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the shared scoped-bypass design, then attach redacted proof that browser snapshot succeeds against a managed loopback Chrome session while the configured forward proxy remains enabled.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the shared scoped-bypass design, then attach redacted proof that browser snapshot succeeds against a managed loopback Chrome session while the configured forward proxy remains enabled.

Do we have a high-confidence way to reproduce the issue?

No live current-main reproduction was independently run in this read-only review, but the source path is high-confidence: the discovered loopback WebSocket reaches Playwright without the exact managed-proxy registration that sibling CDP operations use.

Is this the best way to solve the issue?

Yes. Reusing the existing exact-target managed-proxy scope around the existing loopback NO_PROXY scope is the narrowest maintainable repair; it avoids adding a setting, fallback, or parallel proxy policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 91f04499f53f.

Labels

Label changes:

  • add P1: The linked report describes a broken managed-browser snapshot workflow for users who enable the supported global proxy path.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body supplies targeted regression-test and CI claims, but not inspectable after-fix evidence from a real managed browser session with the proxy enabled; add a redacted terminal transcript, runtime log, or recording showing the successful snapshot path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: The linked report describes a broken managed-browser snapshot workflow for users who enable the supported global proxy path.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body supplies targeted regression-test and CI claims, but not inspectable after-fix evidence from a real managed browser session with the proxy enabled; add a redacted terminal transcript, runtime log, or recording showing the successful snapshot path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • widingmarcus-cyber: The v2026.3.2 release attributes the prior loopback CDP proxy-bypass fix, PR 31469, to this contributor; this PR deliberately extends that same shared pattern to Playwright. (role: original proxy-bypass contributor; confidence: high; files: extensions/browser/src/browser/cdp-proxy-bypass.ts)
  • vincentkoc: Release history credits this contributor on several browser/CDP reliability fixes, including CDP status accuracy and relay behavior, making them a reasonable adjacent routing contact. (role: adjacent browser/CDP contributor; confidence: medium; files: extensions/browser/src/browser/pw-session-connection.ts, extensions/browser/src/browser/cdp-proxy-bypass.ts)

Rank-up moves

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

  • Add redacted live evidence showing a managed loopback browser snapshot succeeds with the configured HTTP proxy enabled.
  • After updating the PR body with that evidence, allow the automatic review refresh or ask a maintainer to comment @clawsweeper re-review.

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 44bcaa2 into main Jul 27, 2026
183 of 189 checks passed
@steipete
steipete deleted the codex/fix-browser-managed-cdp-proxy branch July 27, 2026 12:32
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: browser snapshot fails with connectOverCDP socket hang up when proxy.enabled is true (WSL/Linux)

1 participant