Repository navigation
fix(browser): report a crashed tab instead of a timeout - #195094
mushuiyu886 wants to merge 15 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: blocked before merge. What this changesTrack crashed browser tabs and return tab-specific recovery guidance while allowing their closure. Example: Chrome's renderer for target T crashes before a browser snapshot request.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains This PR addresses a current browser defect and fixes the previous operator-input regression; no blocking code findings remain. Reviewed head: Before merge
FindingsNone. Agent review detailsHow this fits togetherBrowser routes resolve Chrome targets through the Playwright session owner, execute page operations, and translate failures into responses consumed by the CLI and agent tools. flowchart TD
A[CLI or agent tool] --> B[Browser routes]
B --> C[Playwright target resolution]
D[Page crash event] --> E[Page and target crash state]
E --> C
C --> F[Page operation or close]
F --> G[Browser error response]
Technical reviewBest possible solution: Land the focused crash-reporting repair once required CI passes, leaving tab-list markers to the broader tracked work. Do we have a high-confidence way to reproduce the issue? The affected-release report supplies a concrete Page.crash reproduction, and current main lacks the corresponding crash listener and refusal path; this review did not execute it. Is this the best way to solve the issue? The patch uses existing page-state, target-resolution, close, and error-mapping owners without introducing a competing execution path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8f8e2d5aadd8. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +107, Tests +299, Other +4. Total +410 across 17 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. LabelsLabel 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 (5 earlier review cycles)
Reviewed November 27, 2026, 3:18 AM ET / 08:18 UTC (Revision 6). |
cf4dcf1 to
4a569b8
Compare
643521f to
435a484
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…ution Added a test for running a healthy actionless operator burst with default crash refusal in pw-tools-core interactions.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Related: #194667
What Problem This Solves
Fixes: a tab whose renderer process dies keeps being treated as a normal page, so
snapshotwaits for its full timeout and fails with a generic timeout plus the "browser is currently unavailable" retry hint, whilescreenshot/navigatesurface raw Playwright text (page.screenshot: Target crashed). The agent is told the whole browser is unavailable even though only that tab is dead, and retries the dead target instead of opening a new tab.User Impact
User impact: every action on a crashed tab now fails at once with
tab crashed (renderer exited); open the URL in a new tab and retry(HTTP 409, no retry hint), and the dead tab can still be removed withbrowser close.Why This Change Was Made
crashevent, and page resolution refuses a target whose renderer already died instead of letting the operation run against it.cdpUrl + targetId, so a replacementPageobject for the same target remains refused after reconnect or re-enumeration.stopOnError=false.The follow-up regression uses the real
getPageForTargetIdand realclosePageViaPlaywright, rather than copying crash admission into a mock resolver.Relatedis intentional: tab-list crash markers remain a separate follow-up.Evidence
Real managed Chrome 138 profile, renderer killed with CDP
Page.crashonhttp://127.0.0.1:18080/:browser snapshotpage.ariaSnapshot: Target crashedbrowser navigateTarget crashedbrowser screenshotTarget crashedbrowser close{"ok": true}, tab removedThe after timings include ~6.5 s of CLI startup; the crashed-tab request itself returns as fast as a healthy one.
Regression coverage:
BrowserTabCrashedError; the click regression records[false]instead of[true, undefined]. Production was restored after the red proof.[true, true]: the parent and close helper both retain the exemption.BrowserTabCrashedErrorwithout clicking and records[true, undefined], proving that the child performs its own refusal after the parent admits the batch.stopOnError=false.BrowserTabCrashedError. The existing synthetic-password control still proves that ordinary Playwright insertion failures expose neither the text nor its original error cause.Target crashedand ordinary target-close errors retain their existing classification.pw-session-state.crash.test.tsalso covers crash identity after navigation clears role refs and replacementPageobjects for the same target.pnpm test:extension browserin the qualified Node 24 container with Docker init: 2994 passed, 116 skipped in the browser config and 158 passed in the database-workers config; exit 0.oxfmt --check: clean. Focused production syntax lint and type-aware lint for the changed suppression inventory: 0 warnings/errors. Mock-export ratchet: 6359 grandfathered factories after exactly two retired entries were removed. Test-line ratchet: 6579642, ceiling 6579643, slack 1, with exact net regression allocation 276 and no shared-scalar increase.1cba5e993through the working tree later committed as77f79a52f0fe192cabd74323aac11da40ea2b0a4: one complete pass, machine statusscoped-clean, with no accepted/actionable findings. The reviewer did not execute tests; the focused and full-lane results above are separate local proof.Type validation: the repository's exact
node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfocommand passed in anode:24-bookwormcontainer after the final edits. The host could not execute the pinnedtsrsbinary because its GLIBC is too old; the container supplied the required runtime without changing dependencies or bypassing the check. Directtscwithout built SDK declarations was not used as a substitute. No second managed Chrome run is claimed for the final targeted in-flight batch/insertText fixes; their added proof is through the production owners and existing route mapper.Known boundaries
action=tabsstill lists a crashed tab as a normal page; marking it is a follow-up that needs a target-scoped crash registry outside the live connection.existing-session) profiles never resolve a PlaywrightPage, so they get the message mapping only.Real Behavior Proof (Batch & Native Insertion on Managed Chromium 156)
Executed against a real headless Chromium (
Chrome/156.0.8078.73) over a local loopback CDP endpoint through shippedexecuteActViaPlaywright+toBrowserErrorResponse:batchwithstopOnError: falsecontainingclick->insertText("healthy-input")->click): succeeded (results=[true,true,true],boxValue="healthy-input",clickCount=1).batchwithstopOnError: false,Page.crashtriggered mid-step 1 before step 2click #b2): stopped before step 2, threwpage.waitForTimeout: Page crashed, classified byisBrowserTabCrashedError=true, mapped to HTTP 409"tab crashed (renderer exited); open the URL in a new tab and retry".insertText) on crashed tab: threwBrowserTabCrashedError(instanceof=true), mapped to HTTP 409"tab crashed (renderer exited); open the URL in a new tab and retry", withleaksText=false(inserted token not echoed in error message).