Skip to content

feat(browser): support Lightpanda connection-scoped CDP replies - #154342

Merged
vincentkoc merged 1 commit into
mainfrom
feat/lightweight-browser-01-capabilities
Sep 22, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
feat/lightweight-browser-01-capabilities

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Related: #154341

What Problem This Solves

Lightpanda 0.4.1's partial CDP session routing is incompatible with OpenClaw's tab identity reads, preventing it from serving as a lightweight semantic browser.

User Impact

Stack 1/8 adds an opt-in transport adapter; Chromium defaults and existing profiles are unchanged. The following PR provides the selectable browser profile, and the deployment PR provides portable deployment and comparative benchmarks.

Why This Change Was Made

The browser plugin already owns CDP transport. For explicit Lightpanda connections only, normalize three observed Target reply omissions and suppress its synthetic startup page. Connection-local correlation is bounded and cleared on disconnect. No action replay, dependency patch, new tool, or engine auto-detection is introduced.

This intentionally does not fix Lightpanda's secondary-session Runtime defect. The profile PR exposes only the verified AI snapshot/ARIA-ref path and rejects native/scoped snapshots.

Evidence

  • Lightpanda 0.4.1 Linux x86_64 release SHA256 verified against official release metadata.
  • Actual OpenClaw transport: create/list, document identity, DOM/AX reads, navigation, ref-based fill/click and request interception exercised against synthetic fixtures.
  • Six focused protocol tests pass; test bodies 37ms (30.94s cold runner wall time).
  • Scoped formatting/lint and git diff --check pass.
  • Independent source/protocol review completed; no actionable findings remain.

Experimental opt-in capability, not production parity. No merge or live default-browser change is requested.

Premerge preparation — 2026-09-21

Current source head: 2e79415c49dabb77c8ccb2854ade24a600afe58b. Ready for review/CI, not merged or deployed.

Transport implementation unchanged; inherited canonical tooling fixes by rebasing onto current main.

The stack is rebased onto 72c2cf7c2faaa8994cb207e0ef4797d0a8bd834b to incorporate canonical fixes for the two observed tooling timeouts (not an unrelated retry): #154627, #154509, #154335, #154345 and #154567. The actual affected tooling tests now pass 32/32 in 129.99s. Runtime-proved combined source b9085a3475f2af46a9990e5986e87978719bb9fe passes extension types, Madge and config-doc checks; 47,508 tracked entries match the remote proof snapshot with zero mismatches.

Before rebasing, the scoped CI repairs passed 156 Docker tests, 56 Chrome/boundary tests, and the 30 affected navigation tests, plus Knip, line-cap, import boundaries, temporary-path/raw-fetch guards, Madge, config docs and formatting. Independent final scoped review is clean. Rebased checks continue on the exact heads; older results remain bound to their measured sources.

A real final-source native-spawn benchmark smoke passes startup, temporary-root handling, the public import path, navigation, snapshot, typing/click, wait/text and exactly-once submission (cold task plus one warm task, Chromium headless shell 153.0.8010.12, Linux amd64/Node24.19.0). This is a behavior smoke, not a replacement performance benchmark.

The earlier complete application image at 07cce573cdf01b1146e677e6ea865ef3eb954955 passed its build, unchanged default Playwright upgrade script, full-Chromium channel sibling, and packaged Gateway/browser start → navigate → snapshot → stop with Gateway exit0. That image is explicitly bound to its earlier source. The rebased complete application image at b9085a3475f2af46a9990e5986e87978719bb9fe also passed: full unmodified image build244.381s; unchanged default Playwright script11.483s; full-Chromium channel sibling1.953s; packaged Gateway/browser lifecycle18.971s. Image ID sha256:a50fa9eb0e34302e54b2ee2f51ae34b083d608c8160278430df6dde424ba97ad. All47,508 tracked entries matched before and after. The task-only daemon stopped cleanly with zero containers.

The final combined head c6198e521533e350d0222c884922e5935e803b1c differs from this measured image source only by two truthful SAFETY comments documenting existing non-null-object guards (PR02 route boundary and PR03 benchmark). Diff inspection and TypeScript transpilation with comments removed prove identical emitted JavaScript. The image is not relabeled as built from the later comment-only SHA. Full assertion/max-lines ratchets and plugin inventory pass without baseline changes.

Normal hosted CI is active on the corrected heads. Scanner input qualification is separate from approval: the inherited synthetic status-redaction fixture still needs trusted ClawSweeper policy-owner qualification; the literal is preserved and no gate is bypassed. No skipped, blocked, pending, failed, or canceled run is counted as passing. Experimental opt-in Lightpanda/config-contract maintainer acceptance and prerequisite-first landing remain review decisions.

Review order

  1. CDP transport compatibility — #154342
  2. Lightpanda profiles and capabilities — #154359
  3. Portable deployment and benchmarks — #154360
  4. Licenses and non-AGPL alternatives — #154382
  5. Headless-shell benchmark verification — #154396
  6. Browser engine adapters — #154508
  7. Managed Chromium efficiency and lifecycle — #154607
  8. Docker browser modes and Lightpanda sidecar — #154608

Land prerequisites first; each upper PR targets the preceding branch. No merge or deployment has been performed.

@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@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 Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 11:43 PM ET / September 22, 2026, 03:43 UTC (Revision 4).

ClawSweeper review

What this changes

Adds an opt-in browser transport adapter that restores missing Lightpanda reply routing and page identity, hides its synthetic startup tab, and tests connection-local cleanup.

Merge readiness

✅ Ready for maintainer review

Keep open as useful, accepted work. The recorded maintainer acceptance resolves the previous scope blocker, and this review found no actionable correctness or security defects. Neither current main nor the latest release contains the adapter.

Priority: P2
Reviewed head: 2e79415c49dabb77c8ccb2854ade24a600afe58b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable transport change with useful protocol coverage, reported runtime validation, and no remaining review findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored PR, and no material authority change triggers an exception. The captured body reports actual Linux Lightpanda transport behavior; this review verified the relevant source contracts without rerunning that setup.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored PR, and no material authority change triggers an exception. The captured body reports actual Linux Lightpanda transport behavior; this review verified the relevant source contracts without rerunning that setup.
Evidence reviewed 11 items Pinned introduced patch: Reviewed the merge-base-to-head patch, including both complete added files and the transport integration. Endpoint drift and the stale test merge were not used to attribute changes.
Previous blocker resolved: The supplied September 22 maintainer decision explicitly accepts this experimental transport prerequisite on the unchanged reviewed head. Activation and semantic-only restrictions remain with the companion profile layer; Chromium-default changes and unsupported secondary-session Runtime behavior are outside that acceptance.
Current-main necessity: The transport, connection owner, and page-target consumer are unchanged between the pinned merge base and fetched main. The consumer still requests Target.getTargetInfo on a temporary page session, and main has no Lightpanda normalization.
Findings None None.
Security None None.

How this fits together

The browser plugin connects OpenClaw’s browser operations to an engine through Playwright and the Chrome DevTools Protocol. This adapter translates Lightpanda-specific messages before Playwright uses them to identify and control pages.

flowchart LR
  A[Browser operations] --> B[Playwright transport]
  B --> C{Explicit Lightpanda selection}
  C -->|Yes| D[Connection-local adapter]
  C -->|No| E[Unmodified protocol messages]
  D --> F[Browser engine]
  E --> F
  F --> D
  D --> G[Correlated replies and real page targets]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +95, Tests +142. Total +237 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 98 3 +95
Tests 1 142 0 +142
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 240 3 +237

Review metrics

Metric Value Why it matters
Production versus test growth Production net +95 lines; tests net +142 lines Production growth implements the accepted, bounded protocol adapter within the existing transport owner.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #154341
Summary: This transport prerequisite addresses one part of the broader experimental-browser request; subsequent stack layers own activation and deployment.

Members:

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

Technical review

Best possible solution:

Keep protocol normalization in the existing browser transport, with activation and capability restrictions owned by the companion profile layer.

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

Not applicable as an existing supported-feature bug: this adds experimental engine compatibility. The underlying mismatch is independently supported by the pinned Lightpanda and Playwright sources; no runtime reproduction was executed here.

Is this the best way to solve the issue?

Yes. A narrowly selected adapter at the existing transport boundary addresses the verified protocol mismatch without duplicating browser tools, changing Chromium defaults, or patching dependencies.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 25c6dd5e3f7e.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded experimental browser integration prerequisite with unchanged existing profile defaults.
  • 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: The external-contributor proof gate does not apply to this MEMBER-authored PR, and no material authority change triggers an exception. The captured body reports actual Linux Lightpanda transport behavior; this review verified the relevant source contracts without rerunning that setup.

Evidence

What I checked:

  • Pinned introduced patch: Reviewed the merge-base-to-head patch, including both complete added files and the transport integration. Endpoint drift and the stale test merge were not used to attribute changes. (extensions/browser/src/browser/lightpanda-cdp.ts:12, 2e79415c49da)
  • Previous blocker resolved: The supplied September 22 maintainer decision explicitly accepts this experimental transport prerequisite on the unchanged reviewed head. Activation and semantic-only restrictions remain with the companion profile layer; Chromium-default changes and unsupported secondary-session Runtime behavior are outside that acceptance. (2e79415c49da)
  • Current-main necessity: The transport, connection owner, and page-target consumer are unchanged between the pinned merge base and fetched main. The consumer still requests Target.getTargetInfo on a temporary page session, and main has no Lightpanda normalization. (extensions/browser/src/browser/pw-session-page-target.ts:38, 25c6dd5e3f7e)
  • Latest-release check: Read the transport at the supplied v2026.9.5 release commit through GitHub. It forwards messages without the Lightpanda adapter or engine selector. (extensions/browser/src/browser/pw-session-cdp-transport.ts:35, ec9c1a13db89)
  • Opt-in and lifecycle boundary: The full transport module creates the normalizer only for explicit Lightpanda selection and clears it on requested closure, observed closure, and failed connection. Existing production callers omit the selector. No public SDK export, persisted setting, dependency installation, or endpoint-policy change is introduced. (extensions/browser/src/browser/pw-session-cdp-transport.ts:104, 2e79415c49da)
  • Dependency contract signal: The changed transport directly implements Playwright’s ConnectOverCDPTransport contract and passes it to chromium.connectOverCDP; the browser package pins playwright-core 1.63.0. The adapter explicitly targets Lightpanda 0.4.1 protocol omissions. These are the relevant dependency contracts; no Codex dependency signal exists in this patch. (extensions/browser/src/browser/pw-session-cdp-transport.ts:259, 2e79415c49da)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • pgondhi987: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-21T03:14:05.148Z sha d56601f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T10:19:42.387Z sha d56601f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T11:10:58.037Z sha 2e79415 :: blocked before merge. :: none

@vincentkoc
vincentkoc force-pushed the feat/lightweight-browser-01-capabilities branch from d56601f to 2e79415 Compare September 21, 2026 10:53
@vincentkoc vincentkoc self-assigned this Sep 21, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Maintainer decision: I accept this opt-in experimental Lightpanda transport prerequisite as part of the explicitly requested eight-PR browser stack. The companion profile layer owns activation and its deliberately limited semantic-only capabilities; this does not authorize Chromium-default changes or unsupported secondary-session Runtime behavior.

The current exact head is 2e79415c49dabb77c8ccb2854ade24a600afe58b. The owning transport, page-target consumer, connection lifecycle, regression tests, and pinned Playwright 1.63 session-routing contract have been inspected again. Current main 43ed8cee3fd retains the same unadapted owner/caller bytes as the original base. Required CI remains successful. Fresh independent AutoReview is in progress; landing will use the repository-native review, prepare, and merge gates.

Please refresh the completed review for this unchanged head. No autofix, rebase, or automerge is requested.

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc merged commit 44cb9bd into main Sep 22, 2026
102 checks passed
@vincentkoc
vincentkoc deleted the feat/lightweight-browser-01-capabilities branch September 22, 2026 09:34
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 22, 2026
* commit '80b9608a25e191a17e1466d750c2f76a38a38507':
  fix(tooling): declare tsx CLI shim exports
  test(gateway): reuse session PR access state fixtures (#155626)
  test(heartbeat): await wake registration before advancing coalescing time
  refactor(status): share plugin health section assembly (#155390)
  fix: CLI and MCP tool completions skip plugin hooks (#155206)
  fix(update): preserve failures and retain running worker code (#153764)
  fix(sqlite): drain idle coordinators at lifecycle teardown
  fix(test): prepare SQLite compile-cache probes before launch
  fix(test): preserve owned compiler caches in Vitest workers
  fix(ios): assistant files are not downloadable in chat (#155195)
  fix(heartbeat): avoid timeouts for busy scheduled polls (#148333)
  test(gateway): hold SSH approval until pending assertions finish
  test(update): cover launcher permission rollback on Linux (#155615)
  fix(edit): avoid duplicate replacements from legacy arguments (#155513)
  feat(browser): support Lightpanda connection-scoped CDP replies (#154342)
  improve(ci): speed up compatible Control UI tests with Bun (#154585)
  test(gateway): prepare remaining approval fixtures before requests (#155589)
  fix(doctor): exclude retained agents from automatic session import
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 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: M 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