Repository navigation
feat(browser): add opt-in Lightpanda semantic profiles - #154359
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 23, 2026, 9:10 AM ET / 13:10 UTC (Revision 8). ClawSweeper reviewWhat this changesAdds opt-in Lightpanda browser profiles with semantic-only operations, capability-aware tool schemas, and connection-scoped tab identities while preserving Chromium defaults. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: the selectable semantic profile remains absent from main, and the accepted experimental scope has useful runtime evidence. No blocking correctness finding remains; the earlier generic compatibility concern is addressed by the documented disposition and additive configuration behavior. Priority: P3 Review scores
Verification
How this fits togetherThe Browser plugin translates agent and CLI requests into browser operations through configured profiles. This change selects Lightpanda capabilities before dispatch and prevents disconnected tabs from being mistaken for replacement pages. flowchart TD
A[Agent or CLI request] --> B[Browser profile]
B --> C{Selected engine}
C --> D[Chromium capabilities]
C --> E[Lightpanda semantic admission]
E --> F[Reject unsupported operation]
E --> G[Connection-scoped browser session]
D --> H[Browser results]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +510, Tests +496, Generated 0. Total +1006 across 28 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep Lightpanda experimental and explicitly selected within the Browser plugin, with Chromium defaults preserved and connection loss invalidating semantic targets. Do we have a high-confidence way to reproduce the issue? Not applicable to an existing-behavior bug: this adds an engine mode, with source-bound real browser-route observations supplied for the new behavior. Is this the best way to solve the issue? Yes: extending the existing Browser plugin addresses capability and connection-identity differences that generic remote CDP configuration alone does not express. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d17bc2129b60. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
d56601f to
2e79415
Compare
8274b40 to
c98a712
Compare
|
@clawsweeper re-review Please review the current exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
eaa617d to
1bc5148
Compare
|
@clawsweeper re-review Please review the current exact head |
|
🦞👀 Re-review progress:
|
1bc5148 to
bc3ab95
Compare
|
Merged via squash.
|
* feat(browser): add opt-in Lightpanda semantic profiles * fix(browser): reject direct selectors for Lightpanda profiles
Related: #154341
Current landing verification — 2026-09-23
Current PR head:
bc3ab95fe7ac2264061cbdc4514d7a4a1c80748f. Vincent authorized prerequisite-first landing of the experimental opt-in Lightpanda stack and its additive engine/config/status contract. No merge or deployment is claimed here; exact-head hosted checks and native landing gates remain required.The prerequisite #154342 is merged. The confirmed generated-metadata conflict against current main is resolved through the config-doc owner; the optional engine/default contract and selector-admission source patches remain unchanged. Current base:
904f9c03a317804a2670fc8ff48c0d5dcb61bdc3; pinned dependency installation and metadata generation passed. Retained focused proof at the earlier resolved head1bc514876475eda5819d98758c76d1d72a8cd09apassed 20/20 and 146/147 (one platform skip), 93.39s total wrapper wall; those checks were not rerun or relabeled as current-head execution. Current-head hosted CI and a fresh completed ClawSweeper review remain required.Proof scope: dated evidence below retains its original source identity. The new combined image/profile-preservation run at
dd25d85031ab090b4b4ad9cba0ad4beeff9debb8is pending in #154607 and #154608; no earlier image is relabeled as that repair proof.The shared route admission owner now rejects nonempty normalized
/actselectors for Lightpanda before any adapter call. The same coercion as action normalization is used; ref clicks, timer waits and Chromium selectors remain admitted. Four added real-route regression rows fail on the original owner (500 instead of 501) and pass with the repair; three positive rows preserve those supported paths. Route + schema suites pass 53/53 (7.74s green wrapper, 6.23s test run; the added rows each take about 1ms).Fresh isolated native AutoReview found no remaining actionable P0–P2 defects after the accepted PR02/03/06 repairs and adjudication of the metadata/external-profile false positives. Exact reviewed file hashes and unchanged boundary patch IDs bind those reviews through the prerequisite-driven restack; patch-identical head changes are not relabeled as new review runs.
Final combined proof at
71e4fb2b164423175c6b0324365cc18e5c7808ef: all 47,508 tracked files/symlinks and modes match the tested source. Route/schema tests 53/53, five-file formatting and scoped type-aware lint pass; a real pinned Lightpanda 0.4.1 workflow passes ref actions, exactly-once submission, capability/single-page checks and the repaired stale-target validator.A fresh complete application image built in 238.447s, image
sha256:ac252a09fd89aa2f041a37078d13fc7c8f6107835923cab2644fa9ed76084fbd. Its build-info matches the exact combined commit. The unchanged default Playwright script passes (16.754s). Packaged Gateway/browser smoke passes (22.336s): Chromium start/open/snapshot/stop, same-route Chromium selector-wait success, and four Lightpanda selector rejections with exactBROWSER_CAPABILITY_UNSUPPORTED/engine: lightpandastructured errors before adapter contact. This isolated Linux amd64 proof uses synthetic pages and no provider/account actions. Source inventory is unchanged after build/runtime; owned containers are removed and the task daemon is stopped.Historical evidence below retains its original source and scope. In particular, the old broad
staleTargetRejectedassertion is superseded by the new positive-control/exact-error proof, and historical memory sampled across full validation is not a measurement of the repaired validator. No new three-run performance matrix, native macOS/Windows runtime proof, whole-Gateway memory saving, or broad website compatibility is claimed. The full image’s Lightpanda negative probes cover pre-adapter admission; actual Lightpanda ref actions are covered separately by the current source-controller workflow.ClawSweeper’s synthetic-fixture qualification landed in openclaw/clawsweeper#1646. Qualification is not review approval or proof of deployment: the fresh full-input browser review must still demonstrate admission on its actual trusted policy and exact head/body. No gate is bypassed.
What Problem This Solves
Users cannot select a lightweight semantic browser without OpenClaw assuming Chromium capabilities and persistent tab identity.
User Impact
Stack 2/8 adds an explicit
engine: "lightpanda"attach-only browser profile behind the existing browser tool. Existing profiles still use Chromium. Users start the external engine and select the profile; the following PR provides pinned native/Docker examples and a reproducible benchmark.Lightpanda is experimental: one page per connection, no reconnectable profile, screenshots, PDFs, downloads, uploads, native/scoped snapshots, or visual interaction. Unsupported operations fail before dispatch. There is no automatic fallback or action replay.
Why This Change Was Made
The implementation builds on the existing browser plugin and the opt-in transport in #154342. Explicit engine capabilities control both profile-bound tool descriptions and route admission. Connection-qualified target IDs cannot silently become a newly created page after disconnection. Closing an old page cannot retire a successor connection, and engine-only profile changes invalidate the old runtime.
The one new configuration field,
browser.profiles.*.engine, is intentional: connection URLs and CDP handshakes do not identify feature support reliably. The core configuration-surface budget increases by exactly one (2453 → 2454); channel/plugin budgets are unchanged. Lightpanda requires an explicit WebSocket URL andattachOnly: true, rejects incompatible Chrome launch options, and rejects shared endpoint ownership.Evidence
pnpm tsgo:core,pnpm tsgo:extensions, scoped core/extension lint, formatting,git diff --check, andpnpm config:docs:checkpass.No UI change, production-browser parity claim, live configuration change, or merge is requested. This is an experimental opt-in stack, based on #154342 rather than main.
Premerge preparation — 2026-09-21
Source head recorded on 2026-09-21:
c98a712976f691d7c72fe488f7e6780aaeb7e01e. Ready for review/CI, not merged or deployed.Browser labels moved verbatim to a leaf module to meet the existing line cap. The shared Playwright page fixture now provides the real API's stable context identity. Config surface increases by exactly one field (current main2453→2454).
The stack is rebased onto
72c2cf7c2faaa8994cb207e0ef4797d0a8bd834bto 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 sourceb9085a3475f2af46a9990e5986e87978719bb9fepasses 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
07cce573cdf01b1146e677e6ea865ef3eb954955passed 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 atb9085a3475f2af46a9990e5986e87978719bb9fealso passed: full unmodified image build244.381s; unchanged default Playwright script11.483s; full-Chromium channel sibling1.953s; packaged Gateway/browser lifecycle18.971s. Image IDsha256:a50fa9eb0e34302e54b2ee2f51ae34b083d608c8160278430df6dde424ba97ad. All47,508 tracked entries matched before and after. The task-only daemon stopped cleanly with zero containers.The final combined head
c6198e521533e350d0222c884922e5935e803b1cdiffers from this measured image source only by two truthfulSAFETYcomments 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.
Compatibility checklist disposition
The
schema.labels.browser.ts/schema.labels.tsdata-model detector hit is presentation metadata, not a stored-data migration. Direct consumers attach FIELD_LABELS to schema/UI documentation. The extraction preserves the 33 browser label entries from the pre-extraction stack (including this feature's intended engine label); no storage format, migration runner, backfill, or persisted-config rewrite is added by that refactor.The intentional config contract is optional
browser.profiles.*.engine. Existing profiles without it retain implicit Chromium; managed, remote, existing-session and extension profile objects remain accepted unchanged. Exact-head compatibility validation atc6198e521533e350d0222c884922e5935e803b1cpassed 113 tests with 1 skip across existing schema/browser-config suites, including parse identity, implicit-engine resolution, caller-owned-object preservation, supported Lightpanda endpoints, dedicated endpoint checks and incompatible-option rejection. The existing suites ran throughnode --import ./scripts/tsx.mjs scripts/test-projects.mts src/config/config.browser-engines.test.ts extensions/browser/src/browser/config.test.ts -- --maxWorkers=1(41.01s). No existing-binary downgrade rehearsal is claimed.Upgrade needs no data migration for existing configs. Opt-in activation requires the new engine field, explicit ws/wss endpoint and attachOnly=true; the existing Chromium profile should be retained. To undo selection on a supporting build, restore the prior defaultProfile/select Chromium. Before downgrading to a build predating this field, remove the Lightpanda profile/new engine keys and restore a supported defaultProfile: the pre-feature profile schema is a strictObject and does not promise to accept new keys. No old-version binary downgrade rehearsal is claimed. Experimental product acceptance remains an owner decision, not an inferred approval from passing tests.
Review order
Land prerequisites first; each upper PR targets the preceding branch. No merge or deployment has been performed.