Repository navigation
fix(browser): report crashed tabs explicitly instead of a generic timeout - #194690
xiaopan-xydt wants to merge 5 commits into
Conversation
…eout Every action on a tab whose renderer died now fails fast with "tab crashed (renderer exited); open the URL in a new tab": a page-scoped crash mark from the Playwright crash event refuses the target before any action, mid-action "Target crashed" failures translate at the shared action boundary, and tabs mark crashed entries.
|
🦞👀 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. |
|
Independent live Page.crash run for #194667, comparing both open PRs against Setup:
For this PR (#194690): all three page actions on the crashed tab (snapshot, screenshot and navigate) now fail fast with the explicit tab-scoped error, and the browser stays usable for new tabs. The human-readable |
|
Codex review: needs real behavior proof before merge. What this changesThis PR tracks crashed browser pages, returns tab-specific recovery errors, and adds crash markers to tab listings. Example: Chrome target T crashes while another tab remains healthy.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 5 items remain This PR addresses a real browser diagnostic bug, but crashed-tab closure and crash-marker delivery remain incomplete, and the error matcher can misclassify ordinary locator timeouts. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe browser plugin resolves browser targets, executes Playwright operations, and projects tab metadata and errors into HTTP responses, CLI output, and agent tool results. flowchart LR
A[CLI or agent] --> B[Browser routes]
B --> C[Target resolution]
C --> D[Playwright page]
D --> E[Crash observation]
E --> F[Tab metadata and errors]
F --> A
Technical reviewBest possible solution: Complete crash handling in the existing page lifecycle and action owners, preserve closure, and carry the same crash fact through raw listings and agent output. Do we have a high-confidence way to reproduce the issue? The official-release report provides a deterministic CDP Page.crash sequence, independent live evidence confirms the mechanism, and current-main source still lacks crash admission; this review did not execute the reproduction. Is this the best way to solve the issue? The lifecycle-based approach is appropriate, but the close exception and crash-state projections must cover all existing consumers, and crash classification must distinguish Playwright failure headlines from locator call-log content. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b27440329b4c. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +87, Tests +69. Total +156 across 10 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
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 (1 earlier review cycle)
Reviewed November 14, 2026, 9:37 AM ET / 14:37 UTC (Revision 2). |
…raw listings Per review: closeTab keeps working via allowCrashed admission; crash facts learned on the Playwright side now flow into raw /json/list listings and the CLI renders the crashed marker; the crash test fixture is correctly typed with action-boundary regressions added.
|
Per review, pushed 0fe12ba:
Body updated with the new evidence matrix. @clawsweeper re-review |
|
Friendly ping — the fresh review requested on Nov 8 appears not to have been queued (no ack received). The current head |
|
Synced the branch with current main and restored the oxfmt import order in |
|
Merged current |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks for the work here. We're closing this: it doesn't show a real user-facing problem (no report from an affected user and no natural reproduction), and it follows a pattern of small, speculative or duplicate changes split across many PRs. Please open an issue with a reproduction of real harm first; a fix can follow once the problem is confirmed. |

Closes #194667
What Problem This Solves
When a tab's renderer process dies (kernel OOM kill or crash), the managed browser keeps running, but every action on that tab reports misleading failures:
snapshothangs ~20 s and fails with the generic transient hint ("the browser is currently unavailable"),screenshot/navigatefail with raw Playwright text ("Target crashed"), andtabsstill lists the dead tab as a normal entry. An agent retries the dead tab, then tells the user the whole browser is down — when only one tab died.Plain language: the browser did not go down; one tab's rendering process was killed. The tool had no way to tell the two apart, so it gave a wrong diagnosis. Now every action on a dead tab says exactly that: the tab crashed, open the URL in a new tab — and
tabsmarks the dead tab.Why This Change Was Made
The browser tool had no notion of a crashed renderer. Playwright emits a
crashevent on the Page object, but nothing listened, so crash-shaped failures fell through to the generic timeout classifier. The fix records crashed pages (a page-scopedWeakSetwired into the existing per-page state bootstrap), refuses a known-crashed target during resolution before any action runs, translates mid-action "Target crashed" failures at the sharedawaitActionWithAbortboundary, and marks crashed entries in tab listings.Per review, three adjustments:
closeremains available for crashed targets (target resolution takes anallowCrashedadmission flag, so the cleanup operation keeps its ownership checks); crash facts learned on the Playwright side (getPageForTargetIdrefusal and Playwright target enumeration) flow into a target-keyed registry that raw/json/listlistings also consume, and the CLI renders the marker; the crash test fixture keeps a correctly typed emitter, with action-boundary regressions replacing translator-only tests.User Impact
Agents see one explicit error for every action on a crashed tab — fast, without the "browser is unavailable" retry hint — and can recover by opening the URL in a new tab. Tab listings (JSON and CLI output) distinguish a dead tab from a live one, and closing a crashed tab still works.
Evidence
Real runtime runs on the main tree this change is based on (every changed file byte-compared as
main/head + exactly this delta before push):pw-session-crashed-target.test.ts: crash-event marking; "Target crashed" translation incl. non-Error form; no false translation for locator timeout or genuine close; action-boundary: crashed rejection → explicit error, timeout and close-shaped failures unchangedpw-session.connections.test.ts(incl. connection scoping with the new admission flag),pw-session-navigation-fence.test.tstsc --noEmit -p tsconfig.extensions.json: zero errors underextensions/browserAI Assistance
This PR is AI-assisted. Used grep and git diff to analyze issue #194667, locate the missing crash handling in the browser tool's session layer, and implement the fix. The implementer understands the code: Playwright's per-page
crashevent marks the dead page, target resolution refuses it (close opts out viaallowCrashed), and the shared action boundary translates "Target crashed" failures. All evidence above is from real local runtime execution.