Repository navigation
fix(browser): deep doctor hangs on stalled page snapshots - #119280
zhangguiping-xydt wants to merge 4 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 11:58 PM ET / August 12, 2026, 03:58 UTC. ClawSweeper reviewWhat this changesThe PR adds a bounded deep browser-doctor snapshot across extension relay, Playwright, and direct CDP paths, while keeping browser CLI imports lightweight. Merge readinessKeep open: current main still lacks a bounded extension-relay live snapshot, while this PR repairs that path and resolves the prior relay-lifecycle findings; its current merge conflict must be reconciled before landing. Priority: P2 Review scores
Verification
How this fits togetherBrowser doctor runs through the browser plugin’s Gateway route, selects a shared tab, and probes it through direct CDP or the extension relay’s Playwright connection. Its report tells an operator whether a tab can actually be inspected rather than merely whether the relay is connected. flowchart LR
CLI[Browser doctor CLI] --> Route[Gateway doctor route]
Route --> Select[Select shared tab]
Select --> Probe[Bounded live snapshot]
Probe --> Direct[Direct CDP]
Probe --> Relay[Extension relay and Playwright]
Direct --> Report[Actionable doctor report]
Relay --> Report
Before merge
Agent review detailsSecurityNone. PR surfaceSource +351, Tests +1220, Generated 0. Total +1571 across 34 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. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase onto current main, preserve the isolated auxiliary-session cancellation and existing candidate-hello/heartbeat lifecycle, then rerun the focused browser suites and the recorded real relay scenario on the rebased head. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main’s deep doctor has no bounded extension-relay page-snapshot path, and the PR supplies a concrete real Chrome/MV3 withheld-response scenario. Is this the best way to solve the issue? Yes: a route-owned deadline propagated into the exact direct-CDP or auxiliary Playwright session is preferable to a global timeout that could disturb shared tabs or the active relay. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2a1eba771342. LabelsLabel 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 (10 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
44e2717 to
b8b190a
Compare
b8b190a to
f1b65eb
Compare
f1b65eb to
1d40c2e
Compare
Related: #116747
What Problem This Solves
Fixes an issue where users running
openclaw browser --browser-profile chrome doctor --deepcould wait beyond the diagnostic deadline when an extension-backed page accessibility command stalled, even though the relay remained connected and shared tabs were visible.Why This Change Was Made
The canonical
/doctorroute owns one bounded live-snapshot request and carries its cancellation through tab selection, Playwright/CDP connection setup, and the auxiliary page session that owns the snapshot command. Cancellation retires only that auxiliary session and reports the affected tab and CDP method; it does not detach shared tabs or replace the active extension relay.This update ports the repair onto current main so its candidate-hello validation and missed-pong retirement stay intact. The browser CLI now imports URL redaction from the narrow
openclaw/plugin-sdk/browser-configsubpath, with a cold-import regression check to prevent loading the CDP runtime graph for that helper.User Impact
Deep browser doctor returns an actionable bounded failure for a stalled extension or direct-CDP snapshot. Normal browser actions, sibling tabs, and successor connections remain usable.
Evidence
The reporter path was exercised with a real development Gateway, real Headless Chrome 138, the unpacked production MV3 extension, and two shared tabs. A transparent relay proxy forwarded worker traffic unchanged except for withholding one real
Accessibility.enableresult after attach and tab enumeration succeeded.The direct-CDP owner was separately exercised against a real Chrome page WebSocket while one real accessibility-tree response was withheld: cancellation preserved the exact deadline reason, closed only the cancelled socket, and a successor connection completed successfully.
Current-main regression checks passed:
pnpm exec vitest run --config test/vitest/vitest.extension-browser.config.ts extensions/browser/src/cli/browser-cli.cold-imports.test.ts extensions/browser/src/browser/extension-relay/relay-bridge.test.ts— 28/28.pnpm exec vitest run --config test/vitest/vitest.extension-browser.config.ts extensions/browser/src/browser/routes/basic.existing-session.test.ts— 24/24.