Skip to content

fix(browser): diagnose empty WSL2 Chrome replies#100590

Merged
steipete merged 5 commits into
mainfrom
codex/fix-wsl2-cdp-portproxy
Jul 6, 2026
Merged

fix(browser): diagnose empty WSL2 Chrome replies#100590
steipete merged 5 commits into
mainfrom
codex/fix-wsl2-cdp-portproxy

Conversation

@steipete

@steipete steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Closes #54669

What Problem This Solves

Fixes an issue where users connecting from a WSL2 Gateway to Windows Chrome could receive an empty CDP reply and be told only about a stale self-loop, even when Chromium had fallen back to the IPv6 loopback listener. Existing guidance also attributed that fallback universally to Chrome 136+, while Chromium actually prefers 127.0.0.1 and uses [::1] only after the IPv4 bind fails.

Why This Change Was Made

This takes #93481 as the base, preserves its useful listener-family diagnosis, and corrects it against current Chromium source. The diagnostic and docs now tell operators to inspect both Windows loopback listeners and the actual portproxy table before choosing v4tov4 or v4tov6; they do not attempt a misleading WSL-side [::1] probe because that address belongs to WSL, not Windows.

The docs also add Chrome 136+'s real command-line contract: remote debugging needs a non-default data directory. CDP remains bound only to the Windows adapter WSL2 needs; the guide explicitly warns against 0.0.0.0, LAN, or tailnet exposure.

User Impact

Operators can distinguish a self-loop from Chromium's IPv6 fallback, repair the proxy without disabling browser automation, and keep the browser-control boundary scoped to the intended host path. Existing IPv4 setups keep working; v4tov6 is recommended only after Windows proves Chrome is listening on [::1].

Evidence

  • Dependency contract: current Chromium chrome/browser/devtools/remote_debugging_server.cc tries 127.0.0.1 first and [::1] second; Chrome's official security note says version 136 changed default-data-directory handling, not listener-family order.
  • Real Windows proof: AWS Crabbox cbx_c077cdda0444 (aws, Windows Server 2022, Edge/Chromium 150). Baseline was ipv4_exit=0 ipv6_exit=7 with Chrome on 127.0.0.1; an occupied IPv4 listener produced ipv4_exit=56 ipv6_exit=0 with Chromium on [::1]; replacing the mismatch with v4tov6 connectaddress=::1 produced ipv4_exit=0 ipv6_exit=0.
  • Real agent proof: Dev Gateway on this branch, OpenAI gpt-5.5, Browser as the only callable tool, Windows Chromium reached through a loopback-only SSH tunnel. Run d0f4b2cc-eb43-477c-bea2-81dcf7abb47f made 4 Browser calls with 0 failures and returned REMOTE_BROWSER_OK title=Example Domain url=https://example.com/; the remote CDP target independently reported the same title and URL.
  • Final exact-head CI: run 28772329460 passed at 73bb8bacb7245d9513e2213ec0d91a236954dc55 with no failed jobs.
  • Final Testbox: Blacksmith run 28771241151, lease tbx_01kwv0c2nqfddttj09jw5fweke: extensions/browser/src/browser/chrome.test.ts 57/57; pnpm check:changed green across production/test typechecks, lint, docs, and repository guards after adding connection-reset coverage.
  • Docs checks: pnpm format:docs:check and pnpm docs:map:check passed after refreshing the generated docs map.
  • Fresh structured autoreview: clean, no accepted/actionable findings.
  • Final head 73bb8bacb7245d9513e2213ec0d91a236954dc55 retained the tested patch across the main rebase.

AI-assisted. I reviewed the Chromium contract, the OpenClaw caller path, the tests, and the live behavior. No transcript is attached because the live proof used credential-injected infrastructure; secret values were never printed.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels Jul 6, 2026
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for 73bb8bacb7245d9513e2213ec0d91a236954dc55:

  • Chromium contract checked directly: TCPServerSocketFactory::CreateLocalHostServerSocket binds 127.0.0.1 first and tries [::1] only after the IPv4 bind fails. Chrome's version 136 security change applies to the default data directory, not listener-family order.
  • Real Windows behavior on AWS Crabbox lease cbx_c077cdda0444 (aws, Windows Server 2022, Edge/Chromium 150): baseline ipv4_exit=0 ipv6_exit=7; after an IPv4 proxy occupied the endpoint, ipv4_exit=56 ipv6_exit=0 with Chromium listening on [::1]; after v4tov6 connectaddress=::1, both exits were 0.
  • Real Dev Gateway + agent proof: OpenAI gpt-5.5, Browser as the only callable tool, Windows Chromium attached through a loopback-only SSH tunnel. Run d0f4b2cc-eb43-477c-bea2-81dcf7abb47f made 4 Browser calls with 0 failures and returned REMOTE_BROWSER_OK title=Example Domain url=https://example.com/; /json/list independently showed the same title and URL.
  • Blacksmith Testbox lease tbx_01kwv0c2nqfddttj09jw5fweke, run 28771241151: pnpm test extensions/browser/src/browser/chrome.test.ts passed 57/57; pnpm check:changed passed production/test typechecks, lint, docs lane selection, and repository guards after adding connection-reset coverage.
  • Final docs checks: pnpm format:docs:check and pnpm docs:map:check passed after refreshing the generated map.
  • Fresh structured Codex autoreview: clean, no accepted/actionable findings.
  • Exact-head hosted CI: run 28772329460, completed successfully with no failed jobs.

Known proof gap: the AWS WSL2 provider image failed its own bootstrap, so the live Gateway ran locally through a loopback-only tunnel rather than inside WSL. That does not replace or hide the two product proofs above: the Windows listener/proxy transition was exercised natively, and the full Gateway/OpenAI/Browser path controlled that same Windows browser. No broad CDP bind, policy relaxation, or signed-in default Chrome profile was used.

@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 6, 2026, 12:32 AM ET / 04:32 UTC.

Summary
The PR updates browser CDP diagnostics, WSL2 Windows troubleshooting docs, docs map output, and focused browser tests to distinguish portproxy self-loops from Chromium IPv6 fallback.

PR surface: Source +10, Tests +29, Docs +45. Total +84 across 5 files.

Reproducibility: yes. Current main still has only the self-loop hint and no IPv4-vs-IPv6 WSL2 guidance, while the PR adds a focused empty-reply TCP probe test and real Windows/Gateway proof in the discussion.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #54669
Summary: This PR is the candidate fix for the canonical Windows/WSL2 Chrome CDP IPv4-vs-IPv6 portproxy diagnostic issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Remove the direct CHANGELOG.md edit and keep the release-note context in the PR body for release generation.

Next step before merge

  • [P2] A narrow repair can remove the release-owned CHANGELOG.md entry without changing the proven browser diagnostics/docs/test fix.

Security
Cleared: The diff does not broaden CDP binding, secrets, CI, dependencies, or package resolution, and the docs explicitly warn against exposing CDP beyond the intended WSL2 host path.

Review findings

  • [P3] Remove the direct changelog entry — CHANGELOG.md:23
Review details

Best possible solution:

Land the scoped diagnostics, docs, and test fix after dropping the direct CHANGELOG.md edit so release generation can derive the final entry from the PR body.

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

Yes. Current main still has only the self-loop hint and no IPv4-vs-IPv6 WSL2 guidance, while the PR adds a focused empty-reply TCP probe test and real Windows/Gateway proof in the discussion.

Is this the best way to solve the issue?

Yes for the browser fix: docs plus diagnostic wording is the narrow maintainable surface because WSL cannot directly prove the Windows [::1] listener. The only safer adjustment is to leave CHANGELOG.md to the release-owned generation flow.

Full review comments:

  • [P3] Remove the direct changelog entry — CHANGELOG.md:23
    CHANGELOG.md is release-owned for normal PRs, and this PR already carries the needed release-note context in its body. Please drop this line so release generation derives the entry instead of landing manual changelog churn.
    Confidence: 0.86

Overall correctness: patch is correct
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4b7661e9a0c4.

Label changes

Label changes:

  • add P1: This PR addresses a broken Windows/WSL2 remote-browser workflow where users can receive empty CDP replies and incomplete diagnostic guidance.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body and follow-up comment include after-fix Windows listener/proxy proof plus a real Dev Gateway and Browser-tool agent run, with the WSL2-provider bootstrap gap explicitly disclosed.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and follow-up comment include after-fix Windows listener/proxy proof plus a real Dev Gateway and Browser-tool agent run, with the WSL2-provider bootstrap gap explicitly disclosed.

Label justifications:

  • P1: This PR addresses a broken Windows/WSL2 remote-browser workflow where users can receive empty CDP replies and incomplete diagnostic guidance.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and follow-up comment include after-fix Windows listener/proxy proof plus a real Dev Gateway and Browser-tool agent run, with the WSL2-provider bootstrap gap explicitly disclosed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and follow-up comment include after-fix Windows listener/proxy proof plus a real Dev Gateway and Browser-tool agent run, with the WSL2-provider bootstrap gap explicitly disclosed.
Evidence reviewed

PR surface:

Source +10, Tests +29, Docs +45. Total +84 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 11 1 +10
Tests 1 30 1 +29
Docs 3 50 5 +45
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 91 7 +84

Acceptance criteria:

  • [P1] git diff --check.

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the WSL2 troubleshooting doc and self-loop CDP diagnostic hint to this author, and the original WSL2 guide was landed through their merge commit. (role: recent browser diagnostics and docs contributor; confidence: high; commits: 797bca251e88, 9d467d1620d2; files: docs/tools/browser-wsl2-windows-remote-cdp-troubleshooting.md, extensions/browser/src/browser/chrome.diagnostics.ts, extensions/browser/src/browser/chrome.test.ts)
  • vincentkoc: The v2026.6.11 release commit carries the current diagnostic file, and this reviewer closed the prior attempted fix with the Chromium listener-order constraint that this PR addresses. (role: recent reviewer and adjacent area contributor; confidence: medium; commits: e085fa1a3ffd; files: extensions/browser/src/browser/chrome.diagnostics.ts, extensions/browser/src/browser/chrome.test.ts)
  • Owlock: Authored the merged WSL2 remote-CDP troubleshooting guide PR and supplied the canonical field report that this PR closes. (role: original guide contributor and field reporter; confidence: high; commits: 9d467d1620d2; files: docs/tools/browser-wsl2-windows-remote-cdp-troubleshooting.md)
  • ZengWen-DT: Authored the earlier closed PR that targeted the same docs, diagnostic, and test surfaces and is co-authored on the current patch history. (role: prior fix proposer; confidence: medium; commits: d6073ada8803, 00fb84622eee; files: docs/tools/browser-wsl2-windows-remote-cdp-troubleshooting.md, extensions/browser/src/browser/chrome.diagnostics.ts, extensions/browser/src/browser/chrome.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 6, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: signal Channel integration: signal app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: qa-lab extensions: codex extensions: tencent plugin: workboard size: XL and removed size: XS labels Jul 6, 2026
@steipete
steipete force-pushed the codex/fix-wsl2-cdp-portproxy branch from 2fdb715 to d7b05bc Compare July 6, 2026 06:22
@openclaw-barnacle openclaw-barnacle Bot removed channel: discord Channel integration: discord channel: signal Channel integration: signal app: android App: android labels Jul 6, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: qa-lab extensions: codex extensions: tencent plugin: workboard size: XL labels Jul 6, 2026
@steipete
steipete force-pushed the codex/fix-wsl2-cdp-portproxy branch from d7b05bc to 73bb8ba Compare July 6, 2026 06:27
@steipete
steipete merged commit 2830b3e into main Jul 6, 2026
94 of 95 checks passed
@steipete
steipete deleted the codex/fix-wsl2-cdp-portproxy branch July 6, 2026 06:42
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Landed as 2830b3ef38786ee5799778ec7bfbab77dbf445bc.

The final version preserves the contributor's useful listener-family diagnosis while correcting the Chromium invariant, covers clean-close and ECONNRESET CDP failures, keeps recovery conditional on Windows listener proof, and documents the Chrome 136+ profile and CDP exposure boundaries.

Final proof: exact-head CI 28772329460 passed with 45 successful jobs and no failures; Testbox 28771241151 passed the focused Browser suite 57/57 plus changed-surface checks; the native Windows + real Dev Gateway/OpenAI/Browser proof is recorded in the land-ready comment above.

vincentkoc added a commit to zhangqueping/openclaw that referenced this pull request Jul 6, 2026
* origin/main: (1287 commits)
  fix(android): block loopback canvas navigation (openclaw#99874)
  fix(hooks): suppress unhandled stdout/stderr stream errors in gmail watcher (openclaw#100519)
  fix(memory-core): guard qmd mcporter JSON.parse against non-JSON stdout (openclaw#98381)
  fix(build): fall back to tsx for build TypeScript scripts (openclaw#91262)
  feat(skills): suggest saving detected reusable workflows by default (openclaw#95477) (openclaw#100692)
  docs(changelog): remove generated release-note entries
  feat(telegram): offer BotFather web app flow in setup help and docs (openclaw#100540)
  fix(ios): unify Talk and Settings row typography on one branded detail row (openclaw#100515)
  feat(gateway): add persisted crash-loop breaker and fatal-config exit contract
  refactor(macos): lock and unify PortGuardian tunnel record persistence so concurrent app instances cannot lose orphan records (openclaw#100601)
  fix: stop reconnecting on protocol mismatch (openclaw#98414)
  fix(maint): reuse recent hosted gates after rebase (openclaw#100663)
  fix(ui): reopen web terminals without stale content (openclaw#100665)
  fix(browser): diagnose empty WSL2 Chrome replies (openclaw#100590)
  fix(ios): chat snaps back to bottom when scrolling to top via status-bar tap (openclaw#100502)
  Treat already-compacted CLI compaction as no-op (openclaw#99136)
  docs(changelog): remove direct main fix entry
  fix(feishu): strip internal tool-trace banners from outbound text (openclaw#98705)
  fix(message): thread --limit through to CLI formatter and surface provider pagination hints (openclaw#99089)
  fix(voyage): close response body stream when batch output JSONL parsing throws (openclaw#98840)
  ...

# Conflicts:
#	extensions/memory-wiki/package.json
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
* fix(browser): diagnose Windows CDP listener mismatch

Base the repair on openclaw#93481 while matching Chromium's IPv4-first, IPv6-fallback listener contract and keeping CDP exposure loopback-scoped.

Co-authored-by: ZengWen-DT <[email protected]>

* style(docs): format browser troubleshooting table

* docs: refresh browser troubleshooting map

* fix(browser): diagnose reset CDP replies

* docs: refresh browser troubleshooting map

---------

Co-authored-by: ZengWen-DT <[email protected]>
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
* fix(browser): diagnose Windows CDP listener mismatch

Base the repair on openclaw#93481 while matching Chromium's IPv4-first, IPv6-fallback listener contract and keeping CDP exposure loopback-scoped.

Co-authored-by: ZengWen-DT <[email protected]>

* style(docs): format browser troubleshooting table

* docs: refresh browser troubleshooting map

* fix(browser): diagnose reset CDP replies

* docs: refresh browser troubleshooting map

---------

Co-authored-by: ZengWen-DT <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

[Field Report] Chrome 136+ binds CDP to [::1] (IPv6) on Windows — portproxy v4tov4 breaks silently

1 participant