Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, localized server bug fix that normalizes synchronous browser-spawn failures into the existing typed error flow. Added tests cover both preview reporting and HTML publication fallback, with no changes to defaults, schemas, deployment, or static-analysis configuration. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
227c930 to
b3ee7f3
Compare
b3ee7f3 to
cbdd6e8
Compare
Problem
When Node's
spawnthrows synchronously, launching the headless browser fails with a defect instead ofHtmlRenderBrowserError. The reported Windows policy block (spawn UNKNOWN) takes this path, sohtml_previewandhtml_renderboth return only "Internal error".Change
launchBrowsernow maps defects from the spawn call to the existingHtmlRenderBrowserError, with the reason "the browser could not be started" and the original error ascause.processRunner.tsalready guards its spawn the same way.html_previewfails with "Headless Chrome could not render the page: the browser could not be started."html_renderuses its existing fallback for browser errors. It saves the page and returns it without measured heights.The new error carries no browser output, so host diagnosis is unchanged.
Scope and approval
Closes #21686 within its triaged scope, which is the error for a synchronous spawn throw. Choosing another browser location stays in Ideas #17465.
Verification
The new tests point the preview browser at a path beneath a regular file, so the real NodeServices spawner throws
spawn ENOTDIRsynchronously on Linux. Both that error and the reportedspawn UNKNOWNthrow atnode:internal/child_process:458.Command:
cd apps/server && T3CODE_TEST_HEADLESS_SHELL=<chrome-headless-shell path> vp test run src/htmlRender/HtmlRender.test.ts. The variable enables the existing real-browser tests.apps/server/src/htmlRender/HtmlRender.test.ts.apps/server/src/htmlRender/headlessChrome.tsreverted to066c8fc0cd, 2 tests fail with assertion errors: "HtmlRender > when the browser spawn throws synchronously > reports a typed preview error", "HtmlRender > when the browser spawn throws synchronously > publishes the page without measured heights".vp fmt --checkandvp lintreport no errors and no new warnings on the 2 changed TS files.t3.A separate run of the real
HtmlRenderservice on Linux (Node v24.21.0) showed the same behavior. On main, both methods died withspawn ENOTDIR. With the fix, preview returned the named error, and publish saved the page without heights. Pointing the same service at a working chrome-headless-shell then rendered the preview and measured all nine widths.Not run: Windows with AppLocker or SRP (
spawn UNKNOWN), or an MCP client call. The MCP handlers return the typed error's message as the tool failure.Rebased onto
066c8fc0cd; checks above rerun atcbdd6e8fbb.Model: GPT-6.1-Sol, Claude Opus 5.5 (review), GPT-6-Astra (review). Harness: Codex, Claude Code.