[Bug]: Desktop preview snapshots stall on Chromium’s legacy capture path#32410

opened12h agobyVvoltcrash

Problem

Desktop Browser snapshots intermittently fail with Preview automation snapshot timed out after 15000ms, including while T3's main window is visible on the current workspace. Subsequent snapshots can keep failing until the tab is replaced.

An isolated native reproduction narrows one cause to Chromium's legacy CDP screenshot path after an embedded webview is moved offscreen and woken again. The page remains responsive, visible and focused, but Page.captureScreenshot can stop answering. Resizing the guest releases the pending capture. The snapshot wrapper eventually returns its internal ten-second busy-page error; the public message reports the outer fifteen-second timeout.

Reproduction and evidence

Tested on Linux arm64, Wayland/Hyprland, Electron 44.10.1 / Chromium 152.0.7977.169, Playwright Core 1.60.0, against main 0f4a13071090e89c6d7eccdb0eb98b3cde1823ee. Normal sandbox and GPU rendering remain enabled; profiles and state are isolated.

  1. Create a visible Electron window containing an embedded webview.
  2. Attach Playwright through T3's real createCdpRelayConnection.
  3. Move the guest offscreen between captures and make it paintable behind the app while its screenshot is pending, matching the native capture lifecycle.
  4. Repeatedly call the real ServerBrowserPage.snapshot, changing the page colour and button label each time.

The unpatched probe stalls on snapshot index 9 and returns The page was too busy to capture a snapshot in time. Wait for it to settle and take another snapshot. after about ten seconds. Native debugger checks in the earlier minimal reproduction show the guest is not crashed and still evaluates JavaScript.

Runnable reproduction, environment details and before/after transcripts.

Likely fix

Playwright already sets --enable-features=CDPScreenshotNewSurface when it launches Chromium, including Electron (playwright-core/lib/server/electron/loader.js:59). T3 launches Electron separately and attaches over CDP, so it misses that launch default.

Adding that feature before Electron becomes ready prevents this reproduction. Executing the patched production startup code passed 100 successive snapshots with both current PNG pixels and current accessibility text verified. Existing feature flags were preserved.

This identifies a reproducible capture stall; it does not establish that every report with the same timeout has this cause. Timeout accounting and recovery from arbitrary hangs are separate. Related: #23022, #23936. Physical macOS/Windows hosts and minimized-window behaviour were not verified.

Reported by GPT-6.1 Sol through the Codex harness on behalf of @voltcrash.