Skip to content

fix(browser): tighten bridge diagnostics - #83382

Merged
vincentkoc merged 2 commits into
mainfrom
impact/browser-bridge-followup
May 18, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
impact/browser-bridge-followup

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Summary

  • Problem: browser bridge diagnostics could leave CDP loopback proxy bypass stale across NO_PROXY casing variants and could expose home-relative Chrome MCP profile paths in attach-failure output.
  • Why it matters: local browser-control failures should preserve operator diagnostics without leaking private workstation paths or losing localhost proxy bypass coverage.
  • What changed: tightened both NO_PROXY casings, made restore avoid clobbering concurrent env changes, and redacted home-relative Chrome MCP profile/user-data diagnostics.
  • What did NOT change (scope boundary): no browser auth boundary, local binding behavior, access policy, command permissions, or network capability changes.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Related #
  • This PR fixes a bug or regression

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: Chrome/CDP localhost proxy bypass handling and Chrome MCP attach diagnostics.
  • Real environment tested: local OpenClaw checkout on macOS, branch impact/browser-bridge-followup.
  • Exact steps or command run after this patch:
    • OPENCLAW_LOCAL_CHECK_MODE=throttled node scripts/run-vitest.mjs extensions/browser/src/browser/cdp-proxy-bypass.test.ts extensions/browser/src/browser/chrome-mcp.test.ts
    • OPENCLAW_LOCAL_CHECK_MODE=throttled pnpm --config.verify-deps-before-run=false check:changed --timed
  • Evidence after fix: targeted regression tests now cover mixed NO_PROXY casing, concurrent no_proxy deletion, home-relative user data dir redaction, and home-relative timeout profile label redaction.
  • Observed result after fix: targeted browser tests passed, 2 files / 51 tests; changed gate passed.
  • What was not tested: live Chrome MCP process attach against a real browser profile.
  • Before evidence: existing tests did not cover mixed casing or home-relative timeout profile labels.

Root Cause (if applicable)

  • Root cause: loopback coverage checked only the preferred NO_PROXY || no_proxy value, and Chrome MCP timeout/attach diagnostics reused raw profile labels or user-data paths.
  • Missing detection / guardrail: no regression coverage for mixed NO_PROXY casing, concurrent lowercase env mutation, or home-relative Chrome MCP diagnostic labels.
  • Contributing context: prior browser bridge review had already landed; this follow-up stays behavior-preserving and diagnostic-focused.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file:
    • extensions/browser/src/browser/cdp-proxy-bypass.test.ts
    • extensions/browser/src/browser/chrome-mcp.test.ts
  • Scenario the test should lock in: keep loopback bypass across both NO_PROXY casings and redact home-relative Chrome MCP diagnostic paths/labels.
  • Why this is the smallest reliable guardrail: these are pure env/diagnostic behaviors with deterministic unit-level seams.
  • Existing test that already covers this (if any): adjacent CDP proxy bypass and Chrome MCP redaction tests existed, but did not cover these edge cases.
  • If no new test is added, why not: N/A.

User-visible / Behavior Changes

Browser/CDP attach diagnostics now redact home-relative Chrome profile paths, and localhost proxy bypass is more robust when both uppercase and lowercase proxy env vars exist.

Diagram (if applicable)

N/A.

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local OpenClaw checkout
  • Model/provider: N/A
  • Integration/channel (if any): browser / Chrome MCP
  • Relevant config (redacted): N/A

Steps

  1. Run the targeted browser tests.
  2. Run changed-scope validation.
  3. Inspect the diff for private absolute paths or token leaks.

Expected

  • Loopback bypass covers both NO_PROXY casings and restores only untouched env state.
  • Chrome MCP attach/timeout diagnostics do not expose home-relative paths.

Actual

  • Targeted tests passed.
  • Changed-scope validation passed.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: targeted browser tests and check:changed on the rebased branch.
  • Edge cases checked: mixed NO_PROXY casing, concurrent lowercase env deletion, CDP URL secret redaction, home-relative Chrome profile/user data diagnostics.
  • What you did not verify: live Chrome browser attach on this machine.

Review Conversations

N/A.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels May 18, 2026
@clawsweeper

clawsweeper Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
The branch updates the bundled browser plugin to manage uppercase/lowercase NO_PROXY leases independently, redact home-relative Chrome MCP diagnostics, add regression tests, and add a changelog entry.

Reproducibility: yes. Current main source shows the single-casing NO_PROXY || no_proxy check and raw Chrome MCP profile/user-data diagnostics, while the PR adds focused tests for those edge cases.

PR rating
Overall: 🦐 gold shrimp
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Summary: The patch looks correct with focused test evidence, but draft status, an older base, and no live attach verification keep merge readiness limited.

Rank-up moves:

  • Undraft when the maintainer considers the branch ready for merge review.
  • Rerun the targeted browser tests and changed-scope gate after updating onto current main.
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.

Real behavior proof
Not applicable: The external-contributor proof gate does not apply to this MEMBER draft PR; the body includes targeted test and changed-gate output but no live Chrome attach proof.

Risk before merge
Why this matters: - The PR body reports targeted regression tests and changed-scope validation, but live Chrome MCP attach against a real browser profile was not verified.

  • The PR base is older than current main; rerun the targeted browser tests and changed-scope gate after updating or rebasing before merge.

Maintainer choices:

  1. (recommended) Fix the PR before merge with ClawSweeper automerge:
@clawsweeper automerge
Special instructions: Undraft or update the branch to current `main`, rerun the targeted browser tests plus changed-scope validation, then land the per-casing NO_PROXY lease and Chrome MCP home-path diagnostic redaction if CI remains green.
  1. Accept the merge risk explicitly:
Merge as-is only if maintainers intentionally accept this risk: Undraft or update the branch to current `main`, rerun the targeted browser tests plus changed-scope validation, then land the per-casing NO_PROXY lease and Chrome MCP home-path diagnostic redaction if CI remains green.
  1. Stop automation and require a human merge decision:
Do not automerge this PR. Ask a maintainer to decide whether to require changes, merge anyway, or close the PR as not worth the risk: Undraft or update the branch to current `main`, rerun the targeted browser tests plus changed-scope validation, then land the per-casing NO_PROXY lease and Chrome MCP home-path diagnostic redaction if CI remains green.

Next step before merge
No repair lane is needed; this protected draft maintainer PR needs ordinary maintainer review, branch update, and validation before merge.

Security
Cleared: No concrete security or supply-chain regression was found; the diff narrows local diagnostic path exposure and adds no dependencies, permissions, lifecycle hooks, or network capability.

Review details

Best possible solution:

Undraft or update the branch to current main, rerun the targeted browser tests plus changed-scope validation, then land the per-casing NO_PROXY lease and Chrome MCP home-path diagnostic redaction if CI remains green.

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

Yes. Current main source shows the single-casing NO_PROXY || no_proxy check and raw Chrome MCP profile/user-data diagnostics, while the PR adds focused tests for those edge cases.

Is this the best way to solve the issue?

Yes. The patch stays inside the browser plugin, fixes the implicated proxy-env and diagnostic seams directly, and avoids changing browser auth, binding, permissions, or network capability.

What I checked:

Likely related people:

  • @steipete: Peter Steinberger introduced Chrome MCP existing-session support and current blame/history also carries the central Chrome MCP and CDP proxy-bypass code paths. (role: recent area contributor; confidence: high; commits: 593964560ba7, bef3356375; files: extensions/browser/src/browser/chrome-mcp.ts, extensions/browser/src/browser/cdp-proxy-bypass.ts)
  • @widingmarcus-cyber: The merged CDP localhost proxy-bypass PR and its reentrant NO_PROXY preservation commits introduced the proxy lease behavior this PR tightens. (role: introduced NO_PROXY behavior; confidence: high; commits: 61ad021606c9, 527d91171b74, ff1174a134a9; files: extensions/browser/src/browser/cdp-proxy-bypass.ts, extensions/browser/src/browser/cdp-proxy-bypass.test.ts)
  • @vincentkoc: Vincent Koc has prior browser MCP and existing-session history beyond this PR, including headless existing-session MCP work in the same browser plugin area. (role: recent browser contributor; confidence: medium; commits: 173fe3cb548b, 067276f32e79; files: extensions/browser/src/browser/chrome-mcp.ts, extensions/browser/src/browser/cdp-proxy-bypass.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against cd15ce35a0ee.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. P2 Normal backlog priority with limited blast radius. impact:security Security boundary, credential, authz, sandbox, or sensitive-data risk. labels May 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels May 18, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review May 18, 2026 06:15
@vincentkoc
vincentkoc merged commit 61d9a6d into main May 18, 2026
107 of 111 checks passed
@vincentkoc
vincentkoc deleted the impact/browser-bridge-followup branch May 18, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:security Security boundary, credential, authz, sandbox, or sensitive-data risk. maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant