Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 4:11 PM ET / 20:11 UTC. ClawSweeper reviewWhat this changesThe PR makes attached Browser workers close their own Playwright CDP client after bridge shutdown so one-shot workers can exit without stopping caller-owned Chrome. Merge readinessKeep open: current main still leaves the attached worker’s CDP client alive, while this PR adds the narrow scoped cleanup. No blocking patch defect found; exact-head CI remains the merge gate. Priority: P1 Review scores
Verification
How this fits togetherThe Browser plugin gives a one-shot worker an authenticated local bridge to caller-owned Chrome through CDP. Worker teardown must drain bridge work, release only that worker’s CDP client, and then allow the Node process to exit. flowchart LR
A[One-shot worker] --> B[Attached Browser runtime]
B --> C[Authenticated Browser bridge]
C --> D[Browser action over CDP]
D --> E[Scoped CDP client]
B --> F[Worker disposal]
F --> G[Drain bridge work]
G --> H[Close exact CDP client]
H --> I[Natural worker exit]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +37. Total +45 across 2 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the local disposal helper that drains the bridge and closes only the exact CDP client, then land after exact-head CI is green. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s disposer stops only the bridge, while worker terminal cleanup awaits that disposer; the PR body also records an after-fix real worker/CDP run. Is this the best way to solve the issue? Yes. The existing exact URL-scoped retirement primitive fixes the owner boundary without changing generic bridge behavior or sweeping other adapters. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 09c39e0ec528. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
|
@clawsweeper re-review The current head now includes a stateless exact-retirement simplification and real fresh-PR AWS Browser proof. The PR body records the run, adapter disconnect, fresh reconnect, caller Chrome survival, natural Node exit, isolation checks, and lease cleanup. Exact-head CI is still running. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
a2d21b2 to
9fc22f3
Compare
|
Land-ready verification for
|
|
Merged via squash.
|
…-prep * commit 'edb7a1692e58d78ff7e196db39ea8eff297b2e19': (1351 commits) fix(telegram): expose live location updates to hooks (openclaw#122185) fix(ui): remove the pre-creation session row (openclaw#122259) fix(openai): surface failed realtime response outcomes (openclaw#121177) fix(logging): publish diagnostics ZIP through staged atomic overwrite (openclaw#122130) test(cli): trim duplicate MCP probe process cases (openclaw#122260) feat(agents): replay persisted native video (openclaw#122257) fix(test): serialize default e2e runner (openclaw#122203) fix(ui): always show full assistant responses (openclaw#122207) feat(mcp): per-requester OAuth for MCP servers (openclaw#122166) fix(ui): preserve focus on composer accessory clicks (openclaw#122243) fix(backup): exclude state temp files (openclaw#122250) fix(browser): let attached workers exit after CDP use (openclaw#122103) test(cli): trim duplicate Claw authoring process cases (openclaw#122248) refactor(outbound): inline delivery diagnostics (openclaw#122219) refactor: eliminate final wrapper-shadowing hazards (openclaw#122157) fix(ui): keep new-session identity anchored (openclaw#122242) test(cli): trim duplicate gateway process cases (openclaw#122240) fix(media): decode local file URLs safely (openclaw#122192) refactor(agents): centralize typed activity event emission (openclaw#122188) fix(ui): effort slider matches selected level after model switches (openclaw#122125) ...
* fix(browser): retire attached runtime Playwright CDP adapter on disposal (openclaw#122065) * fix(browser): use optional chaining on refresh in CDP adapter retirement * refactor(browser): simplify attached adapter disposal --------- Co-authored-by: Peter Steinberger <[email protected]>
Closes #122065
What Problem This Solves
Fixes an issue where a completed one-shot worker could remain alive after Browser/CDP use because attached-runtime disposal stopped the HTTP bridge but retained the Playwright WebSocket adapter in process-global state.
Why This Change Was Made
The attached Browser runtime owns one exact CDP adapter but does not own caller Chrome. Its disposer now stops bridge ingress and drains admitted work first, then uses the existing exact scoped close facade for that canonical
cdpUrl.Every disposal attempt creates a fresh exact retirement. If disconnect fails, the existing retained-closing map keeps the handle available and a later
dispose()retries it. Generic bridge shutdown continues preserving shared adapters, and no global cleanup or forced process exit is added.User Impact
One-shot workers can finish naturally after Browser actions without leaking a Playwright transport, while caller-owned Chrome remains running and reusable.
Evidence
stopBrowserBridgeServer; generic bridge shutdown deliberately usescloseSharedAdapters: false, while worker terminal cleanup awaits that disposer and relies on natural event-loop exit.1.62.0types document thatbrowser.close()for a connected browser clears client-created contexts and disconnects from the browser server rather than terminating the existing browser.9fc22f34663f9576147dfe612b52a5954e9161b6removes retained local retirement state and changes the runtime retry test to fail once, then succeed on the next disposal.git diff --check, direct Playwright source/type inspection, mandatory Codex autoreview, and TruffleHog are clean on the combined branch.aws, leasecbx_6b415a755e55, run https://crabbox.openclaw.ai/portal/runs/run_5adbef33943b. A fresh checkout of patch-identical pre-rebase heada2d21b2c1a34faca7aba512d1e9aa6ff3ffa88fdused a disposable Chrome and the actual attached Browser tool. Observed:tabActionCompleted, original adapter disconnected, fresh adapter created, caller Chrome alive, andNATURAL_NODE_EXIT=1. The public/no-Tailscale/no-instance-profile lease was stopped after proof; rebased head9fc22f34663f9576147dfe612b52a5954e9161b6preserves the same two-file patch.AI-assisted maintainer follow-up; no agent transcript attached.