Merge pull request #2506 from heygen-com/via/darwin-goto-nav-timeout-hint

feat(engine): surface escape hatches in page.goto Nav timeout errors
This commit is contained in:
Vance Ingalls
2026-07-15 17:22:01 -07:00
committed by GitHub
4 changed files with 346 additions and 1 deletions
@@ -79,6 +79,7 @@ import {
isDrawElementVerificationError,
getDrawElementVerificationDetails,
augmentProtocolTimeoutError,
augmentPageNavigationTimeoutError,
} from "@hyperframes/engine";
import { join, dirname, resolve } from "path";
import { totalmem } from "node:os";
@@ -3155,7 +3156,30 @@ export async function executeRenderJob(
// unchanged when the message doesn't match, so non-timeout failures (memory
// exhaustion, other CDP errors) flow through with no change.
const protocolTimeoutError = augmentProtocolTimeoutError(error, cfg.protocolTimeout);
const errorMessage = memoryGuidance ?? normalizeErrorMessage(protocolTimeoutError);
// Surface HyperFrames' PRODUCER_PAGE_NAVIGATION_TIMEOUT_MS env +
// --browser-timeout CLI + HYPERFRAMES_BROWSER_PATH escape hatch in
// Puppeteer `page.goto` navigation-timeout errors. Puppeteer's stock
// "Navigation timeout of 60000 ms exceeded" text names none of these
// levers. Field signal ts=1784146416 (darwin/arm64, CLI 0.7.58): host
// page.goto hit Navigation timeout twice on a CSS 3D + audio composition;
// Docker rendered the same composition successfully. Mirrors #2443's
// HYPERFRAMES_BROWSER_PATH surfacing at the runtime-navigation layer
// (vs download-time). `augmentPageNavigationTimeoutError` returns the
// input unchanged when the message doesn't match the Nav-timeout regex,
// so protocol-timeout / memory / other CDP errors flow through unchanged.
// hasCss3D + hasAudio are both left undefined here — no compile-time
// CSS-3D signal is currently threaded through the render pipeline, and
// `hasAudio` from the audio_process stage is block-scoped inside the
// try. Per the helper's fallback docs, unknown flags route to the
// generic env + browser-path hints (Docker compound hint suppressed).
// A future compile-time CSS-3D scan (e.g. htmlCompiler.ts pass over
// `transform-style: preserve-3d`, `perspective:`, `rotateX(`, etc.) can
// thread both flags here to enable the full compound Docker hint.
const navigationTimeoutError = augmentPageNavigationTimeoutError(
protocolTimeoutError,
cfg.pageNavigationTimeout,
);
const errorMessage = memoryGuidance ?? normalizeErrorMessage(navigationTimeoutError);
const carriedBrowserConsole = getCaptureStageBrowserConsole(error);
if (carriedBrowserConsole.length > 0) {
lastBrowserConsole = [...lastBrowserConsole, ...carriedBrowserConsole].slice(-200);