fix(replay): fail rasterizer startup on a non-headless-shell browser - #95849
Conversation
…nnot capture with puppeteer-capture only rejects a non-chrome-headless-shell binary once a capture attaches to a page. A PUPPETEER_EXECUTABLE_PATH pointing at another Chrome therefore launches, passes the readiness probe, and then fails every render. Check the launched process in BrowserPool.launchBrowser instead. pool.launch() runs before the worker reports ready, so a bad path now kills the pod. Classify the new BROWSER_MISCONFIGURED code as an internal error in replay vision, with a message that carries no browser path and no retry prompt, and register it in the exports failure handler. Generated-By: PostHog Desktop Task-Id: 0a4e466b-cb46-4bb5-ac77-fd241854739e
|
😎 Merged successfully - details. |
🤖 CI report✅ Trunk lane — non-backend lane (
|
| File | Comment lines | Added lines |
|---|---|---|
nodejs/src/session-replay/recording-rasterizer/capture/browser-pool.ts |
2 | 13 |
nodejs/src/session-replay/recording-rasterizer/__tests__/browser-pool.test.ts |
1 | 15 |
This check does not block merging. It updates on every push and clears when the share drops.
There was a problem hiding this comment.
Approved.
Contained rasterizer/workflow error-classification fix, not in risky territory (no auth, billing, migrations, public API, dependency, or CI changes); code follows the repo's required workflow-versioning pattern correctly and is covered by new tests, so no showstopper.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 47L, 4F substantive, 106L/6F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (106L, 6F, two-areas, fix) |
| stamphog 2.0.0b4 | .stamphog/policy.yml @ 2622685 · reviewed head 2622685 |
👀 Auto-assigned reviewersThese soft owners were skipped because they only have minor changes here. Nothing blocks merge, so self-assign if you'd like a look:
Soft owners come from each directory's |
…-the-rasterizer-at-c41b05
New commits were pushed — dismissing the stamphog approval from an earlier head. This PR no longer qualifies for automatic review.
|
/trunk merge |

Problem
A replay vision scan can fail with a reason that names a container path and tells the user to retry, when no retry can succeed.
The rasterizer launches whatever PUPPETEER_EXECUTABLE_PATH points at. puppeteer-capture only rejects a binary that is not chrome-headless-shell when a capture attaches to a page.
A pod with the wrong binary therefore passes the readiness probe and fails every render, one scan at a time, with the library's error as the failure reason.
Changes
The worker now refuses to start when the launched browser is not chrome-headless-shell. The pod exits, and the worker log names the path and the variable to fix.
Nothing changes for a user on a correctly configured fleet. The path can no longer reach a scan result, because a browser that passes this check also passes the library's check at attach time.
The check runs once in BrowserPool.launch(), before the worker reports ready. Per-render relaunches in getPage() do not repeat it; the library already covers those.
Mechanical: the test helper mockBrowser takes a spawnfile.
How did you test this code?
One Jest case in browser-pool.test.ts: launch() rejects with the path, closes the browser, and getPage() does not hand out the refused browser. It catches a dropped or inverted check, and a check that leaves the refused slot in the idle pool.
Automatic notifications
Docs update
None.
🤖 Agent context
Autonomy: Fully autonomous
/writing-tests,/writing-code-comments,/writing-user-facing-copy,/writing-pr-descriptions,/simplify,writing-simplified-technical-english.gh pr list --state open --searchover the rasterizer and browser keywords found nothing.puppeteer-capturesource showed the check runs per capture, not per launch, which is why the startup check is where the fix belongs and the workflow branch is the backstop.launchBrowser, not frommain, so a browser relaunched later in the pod's life is covered by the same guard./usr/bin/chromium.Created with PostHog Desktop from this inbox report.