Repository navigation
feat(browser): add pure-CDP browser code mode for edge cases - #126255
MagMueller wants to merge 7 commits into
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: needs real behavior proof before merge. What this changesThe browser plugin adds a Browser Harness code-mode backend, selects it for eligible local agent sessions, installs its runtime on first use, and adds host-exec checks, documentation, and tests. Review scores
Merge readiness⛔ Blocked before merge - 11 items remain This remains a distinct browser capability absent from current main. The current head retains blocking upgrade, installation, authority, and fallback concerns from the prior review; its latest commits update wrapper inventory and a generated baseline without changing those paths. Priority: P1 Decision needed
Before merge
Findings
Agent review detailsHow this fits togetherThe browser plugin turns an agent's browser tool call into browser actions. Tool policy selects the available backend, which then launches a local process or uses OpenClaw's native browser control. flowchart LR
A[Agent browser request] --> B[Tool and host policy]
B --> C{Backend selection}
C --> D[Native browser control]
C --> E[Browser Harness tool]
E --> F[Managed install and process]
D --> G[Browser result]
F --> G
Technical reviewBest possible solution: Keep the native browser as the upgrade default, offer Browser Harness through an explicit backend choice, prepare dependencies through an approved install or Doctor lifecycle, and enforce live authority before installer network I/O. Do we have a high-confidence way to reproduce the issue? Not applicable to the feature request. Source inspection gives a clear path to the reported upgrade, fallback, and authority concerns; no current-head runtime reproduction was run. Is this the best way to solve the issue? No. The code-mode backend is useful, but an explicit backend choice and lifecycle-owned installation are safer than changing existing users' default during an agent call. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5a5a0e7e8a64. Merge-risk optionsMaintainer options:
SecurityNeeds attention: The new authority fence covers child launches but does not cover the installer's earlier network request; the current head also requires its recorded maintainer security review. EvidenceSecurity concerns:
What I checked:
PR surfaceSource +1234, Tests +482, Docs +48, Generated 0, Other +1. Total +1765 across 18 files. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (51 earlier review cycles; latest 8 shown)
Reviewed September 27, 2026, 8:21 PM ET / September 28, 2026, 00:21 UTC (Revision 52). |
|
@clawsweeper re-review Redacted real-behavior proof for exact head {
"openclawStatus": "timeout",
"openclawReturnCode": 2,
"agentDurationSeconds": 1701.824,
"assistantTurns": 98,
"toolCalls": 97,
"toolFailures": 1,
"modelToolSurfaceIncludesBrowser": true,
"browserHarnessLog": {
"attachedEvents": 2,
"stoppedRemoteBrowserEvents": 1,
"errorEvents": 0,
"tracebackEvents": 0
}
}This exact-head repetition reached the OpenClaw model deadline; it was not a Browser Harness transport or cleanup failure. The immediately preceding after-policy-fix source build produced a semantic pass at The two review P2s are addressed at the current head:
Validation on the current head: 15 focused files, 468 passed and 1 skipped; the complete changed-code/type/lint/database-first/boundary gate passes. The exact-head 106-task private evaluation is running at 32258116188; only aggregate results will be published. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Addressed the remaining Windows fallback P2 at exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Exact head: e269678 Addressed the two latest findings:
Validation: focused Vitest 3 files / 33 tests, pnpm check:changed, git diff --check, and independent P0/P1/P2 review all pass. |
|
🦞👀 Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Final exact all-fixes 106-task source-build eval: run 32398056065. Privacy-safe aggregate result:
Interpretation: Browser Harness transport, screenshot retention, and lifecycle are at parity or slightly better operationally. Agent semantic accuracy is not at parity in this single final run. Private prompts, task identifiers, page content, and answers were not inspected or published. |
|
Scope reset for reviewability: this draft was intentionally rewritten from the earlier 95-file browser-default experiment to the current 15-file orchestrator-only Browser Use CLI integration. Prior comments that discuss onboarding defaults, local/profile daemon leases, Cloud self-provisioning, or broad browser configuration refer to the superseded branch and are not present in the current diff. Current head: |
|
@clawsweeper re-review Resolved both exact findings at |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Final exact-head full evaluation: https://github.com/browser-use/new-eval-platform/actions/runs/32565869559
No merge action was taken. |
|
@clawsweeper re-review The PR is now rebased at |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Exact-head follow-up:
|
|
|
Final benchmark and split-PR update:
No OpenClaw or Browser Harness merge was performed. This PR still needs the maintainer security-sensitive approval for the current SHA. The two red test jobs are the documented extension-shard flake (its exact file passes locally 5/5) and a Windows native heap-corruption exit, not Browser Harness test failures. |
|
Thanks for the PR. We're closing older pull requests that have gone stale against current This large PR still lacks current-head behavior proof, has failing CI and open security-boundary review items, and the author mentioned splitting it up. Smaller, focused PRs against current main are the better path. If this change is still needed, please open a fresh PR against current |
Related: #19289
What this changes
This keeps OpenClaw’s native browser implementation and makes Browser Harness the preferred agent browser only when the final runtime policy proves all of the following:
browserandexecremain availablefull/off)browser.*configuration or explicitly selected the native backendThat authority is rechecked immediately before every Harness child launch. Sandboxed, remote, approval-gated, tab-bound, explicitly native, and authored-browser sessions stay on the existing native browser;
browser.enabled=falseexposes no browser tool. The native CLI, Gateway API, profiles, Chrome extension, and sandbox browser are not removed.On first allowed use, OpenClaw installs checksum-pinned
uv0.12.7, managed Python 3.12, Browser Harness 0.1.10, and its pinned 12-package resolution into OpenClaw-owned state, then starts the normal Harness daemon. A transient installation failure falls back to native for that call and can retry later. Product-side telemetry and recording are disabled withBH_TELEMETRY=0,BROWSER_HARNESS_TELEMETRY=0,ANONYMIZED_TELEMETRY=0, recording off, and live-view opening off.Structured
action="open"runs OpenClaw’s canonical navigation guard before installation, daemon, browser, or network I/O. Browser Harnessaction="exec"is arbitrary Python, so it is deliberately restricted to the same unrestricted host authority as approval-free hostexec; it is not presented as a sandbox.Maintainer decision: first-use installation is intentional behavior for this bundled default, but it is an exception to the extension guideline that runtime should not install dependencies. If that exception is not acceptable, this needs a separate install/update/doctor lifecycle before it can be the default.
User experience
On a fresh default local unrestricted installation, “go to Hacker News and click the first story” exposes one agent browser tool and routes it to Browser Harness automatically. No Browser Use Cloud key or separate browser allowlist is required. Sessions with tighter permissions or authored browser settings keep working through the native implementation.
Security boundary
The switch happens only after the final effective tool policy is known, and the authority is revalidated at the actual child-process boundary. Removing exec, enabling approvals, entering a sandbox, moving execution remote, or disabling browser access prevents Harness execution. This is why Browser Harness is not also the default inside sandbox sessions: its Python runs on the Gateway host, outside that sandbox.
The security-sensitive guard correctly requires a maintainer to review the current SHA and post
/allow-security-sensitive-change; no contributor-side approval has been posted.Verification
Current head:
7e7b3aff7dd85d188d47d5b7051a0064e0f4d42c. The benchmarked runtime component is849869d331; the only later current-head change is the static process-wrapper inventory declaration required by CI.git diff --check: passingpnpm check:changed,pnpm build, 149/149 focused regressions, and 1,111/1,111 plugin contract tests passingCurrent hosted CI has two test-job failures, not a Browser Harness assertion: one Codex extension shard whose exact test file passes locally 5/5 on this head, and one Windows shard that exits with native heap corruption
0xC0000374. The aggregate gate is consequently red and many later shards were cancelled by fail-fast. Security/static checks are green.Exact benchmark
106-task Internal Bench Hard run: 81/106 (76.42%), 25 fails, 0 judge errors. This is one task below Laith’s 82/106 reference and six below the historical 87/106 run, so it does not claim a new best score.
Exact inputs:
4a1081fbeda9182f8c99710bafe7706715e0237f= this PR runtime component849869d331+ generic malformed-tool continuationcfc43047d3(rebased as fix(agents): continue after rejected malformed tool calls #158568)e3e8069c0ca40befb1a8a0a74da547270767a8be9d126c8799912a4d0ee267fe124cb9fdf999bde6The generic recovery activated in 21 tasks; 18 reached clean final envelopes and 16 passed the judge. It is intentionally isolated in the three-file #158568 rather than folded into this integration PR. An exact two-task follow-up passed 2/2, but neither rerun reproduced the malformed provider response, so it demonstrates stochasticity rather than independently validating recovery.
The remaining score difference is mostly task/site variance: this run had 11 site-blocked failures versus 5 in the historical 87/106 run. A controlled old-versus-current Browser Harness comparison on the same three anti-bot tasks scored 1/3 in both cohorts, and the relevant Cloud browser/proxy/stealth creation code did not change. Anti-bot was present before (including CAPTCHA failures); it did not previously dominate the sampled outcome to the same degree. No anti-bot bypass is claimed here.