mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 15:20:13 +00:00
fix(engine): carry programmatic forceScreenshot opt-out to concrete-resolved site
Miguel R3 blocker on #2359: the runtime helper only checked the env opt-out (PRODUCER_FORCE_SCREENSHOT=false), silently defeating the documented programmatic escape hatch (overrides.forceScreenshot === false) on the browserGpuMode:'auto' → software probe path. At the concrete-resolution site the boolean forceScreenshot === false is ambiguous between default and explicit opt-out — resolveConfig sees the provenance but the runtime helper does not. Fix: persist provenance on the resolved config. - New INTERNAL EngineConfig field forceScreenshotExplicitlyOptedOut, set by resolveConfig when EITHER env or programmatic explicit-false is present. Purpose-documented in the type as 'not intended to be set by callers'. - shouldClampToScreenshotForConcreteGpu gains an opts.programmaticOptOut parameter; returns false early when set. Env stays as the third arg (backward compatibility with existing tests). - frameCapture.ts and renderOrchestrator.ts pass config.forceScreenshotExplicitlyOptedOut through at both call sites, so the auto→software probe path preserves the same escape hatches as literal browserGpuMode:'software'. New tests: 5 additional cases across the helper (programmatic opt-out alone; programmatic beats missing env) and resolveConfig provenance (programmatic sets flag; env sets flag; neither leaves it undefined). Local: 61/61 engine config tests pass (was 56).
This commit is contained in:
@@ -1914,13 +1914,16 @@ export async function executeRenderJob(
|
||||
// that probe to software: `resolveConfig` couldn't see this at config
|
||||
// time, so `captureObservability.forceScreenshot` was still false,
|
||||
// misreporting `captureMode: "beginframe"` for a session that will
|
||||
// actually take the screenshot path. Env-level opt-out preserved via
|
||||
// the shared helper.
|
||||
// actually take the screenshot path. Both env and programmatic opt-outs
|
||||
// preserved via the shared helper (the programmatic one carried on the
|
||||
// config as `forceScreenshotExplicitlyOptedOut`).
|
||||
const observabilityForceScreenshot =
|
||||
captureObservability.forceScreenshot ||
|
||||
shouldClampToScreenshotForConcreteGpu(
|
||||
resolvedBrowserGpuMode,
|
||||
captureObservability.forceScreenshot,
|
||||
process.env,
|
||||
{ programmaticOptOut: cfg.forceScreenshotExplicitlyOptedOut ?? false },
|
||||
);
|
||||
updateCaptureObservability({
|
||||
browserGpuMode: resolvedBrowserGpuMode,
|
||||
|
||||
Reference in New Issue
Block a user