Repository navigation
refactor(browser): simplify requests and page-state ownership - #149651
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. ClawSweeper will not retry this unchanged revision. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
|
@clawsweeper re-review The scanner false positive is fixed on ClawSweeper main by openclaw/clawsweeper#1596. The PR body now links the repair and native admission proof. Browser head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 12:58 AM ET / 04:58 UTC. ClawSweeper reviewWhat this changesConsolidates browser request construction, profile copying, result formatting, and Playwright page bookkeeping while preserving existing behavior. Merge readiness✅ Ready for maintainer review This remains useful, explicitly requested cleanup for the linked open issue. No actionable introduced defect was found; the scanner repair is merged and CI passed for the reviewed head. Priority: P3 Review scores
Verification
How this fits togetherThe browser plugin translates agent and CLI requests into browser-control operations. Its profile lifecycle and page-state owners manage browser availability, interactions, snapshots, and returned results. flowchart TD
A[Agent and CLI requests] --> B[Browser request construction]
B --> C[Profile and tab routing]
C --> D[Browser lifecycle]
C --> E[Playwright page operations]
E --> F[Page state and snapshot references]
F --> G[Browser tool results]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -410, Tests +19, Other -2. Total -393 across 22 files. View PR surface stats
Review metricsNone. 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 request construction and page bookkeeping in their existing browser owners while retaining the established payload, cancellation, profile, and reference-invalidation contracts. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR removes internal duplication rather than claiming a new bug fix; no introduced failing path was identified. Is this the best way to solve the issue? Yes: the consolidation reuses existing owners, removes redundant wrappers, and preserves the inspected behavior contracts without expanding public APIs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 335e80dc8fc1. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Closes #149628
What Problem This Solves
Maintainer-requested follow-up to #149354 to reduce duplicated browser logic after the readiness and lifecycle fixes.
User Impact
No intended user-visible behavior change. Browser startup allowances, cancellation, profile ownership, navigation guards, and response shapes are preserved; no configuration changes or migrations are required.
Why This Change Was Made
Consolidate JSON POST construction, profile-map copying, action result handling, and Playwright page-state bookkeeping in their existing owners. Remove redundant wrappers and casts, including an entire CDP send wrapper, and avoid serializing tool results twice. This removes 410 net production lines without moving production logic into test code. Type-assertion exceptions shrink with the deleted assertions.
Evidence
Full browser suite: 4,309 passed, 46 skipped; final client/tool follow-up: all 312 passed. This includes startup/lifecycle, local and node tool routing, HTTP payloads and cancellation, storage/emulation, evaluation, and stale-ref coverage. A frozen-input config test checks that default resolution preserves caller-owned profiles and prototype-like names. No behavior tests were deleted.
Full build and complete changed-file checks passed, including production/test typechecks, lint, dead-export scans, plugin boundaries, and import-cycle guards.
Independent Codex review: no actionable P0–P2 findings. Local validation uses isolated fixtures; live remote-provider and Windows desktop behavior was not exercised.
Exact-head CI passed for
9d62ad36a0739e5e471b57928642e83f1ede19b2. The scanner refusal on unchanged synthetic config fixtures was repaired in ClawSweeper #1596. The repaired production scanner admits this same complete committed browser range with native verification enabled; scanner and source-binding checks remain active.