Skip to content

fix(runtime): timeout wedged snapshot after renderer crash - #22

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/high-severity-issues-f272
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/high-severity-issues-f272

Conversation

@cursor

@cursor cursor Bot commented Sep 18, 2026

Copy link
Copy Markdown

Bug and impact

After a renderer crash (e.g. navigate to chrome://crash), an immediate snapshot calls page.content() while CDP is wedged. Playwright’s own content({ timeout }) never settles, so companion POST /commands and MCP snapshot hang indefinitely. Other sessions and createSession still work (distinct from #10).

Trigger

  1. POST /sessions
  2. navigate to chrome://crash → COMMAND_FAILED quickly
  3. Immediate snapshot on the same session → hangs forever on HEAD a0fabe3

Live Chromium: delay=0 hang reproduced 3/3; delay≥50ms eventually fails with Target crashed. Companion HTTP abort after 15s confirmed hang; /health still OK.

Why distinct from #10–#21

Prior hunts misfiled chrome://crash as a #10 vector; the failure mode is an unbounded snapshot hang, not a dead browserPromise.

Fix

  • Host-side Promise.race timeout around snapshot CDP reads (page.content / aux / title).
  • page.on("crash") + session pageCrashed flag for fail-fast on later commands.
  • Unit + live companion integration coverage.

Validation

  • pnpm --filter @webchain/runtime test / test:coverage / typecheck
  • pnpm --filter @webchain/companion test:integration (includes crash→snapshot case, <8s)
  • biome check on touched files
Open in Web View Automation 

page.content() can hang indefinitely when snapshot runs immediately
after a renderer crash (e.g. chrome://crash). Playwright's own
timeouts do not fire while CDP is wedged, so companion/MCP callers
never return. Add a host-side timeout, page crash tracking, and fail
fast on subsequent commands.

Co-authored-by: esadrianno <esadrianno@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant