Skip to content

feat(producer): a render request can force screenshot capture for that render - #7066

Merged
miguel-heygen merged 2 commits into
mainfrom
rvelo/force-screenshot-request
Nov 3, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
rvelo/force-screenshot-request

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

The producer server accepts forceScreenshot: true in a render request body. That one render captures with screenshots, whatever PRODUCER_FORCE_SCREENSHOT says. A missing field, false or any non-boolean keeps today's behaviour.

Why

A deployment can run the faster BeginFrame capture by default and still need a safe way out. A retried render can now ask for the slower screenshot capture for that attempt only, without changing the pod's environment or affecting other renders.

How

parseRenderOptions reads body.forceScreenshot === true. buildRenderJobConfig passes it to createRenderRequest as an engine override, so the job's producerConfig.forceScreenshot is true. The engine already honours an explicit true over PRODUCER_FORCE_SCREENSHOT=false.

Test plan

  • server.forceScreenshot.test.ts: with PRODUCER_FORCE_SCREENSHOT=false, a body with forceScreenshot: true gives producerConfig.forceScreenshot === true; an absent field, false and "true" keep false. The forced case fails on main (expected false to be true) and passes with the change, 3 runs in a row, together with the neighbouring server test (9 of 9). Breaking the override line turns it red again.
  • Lint, format and typecheck clean on the changed files.
  • Documentation: no page lists the server request fields.
  • Comments follow CONTRIBUTING.md "Comments"

Size

About 85 changed lines: one parse line, one override line, one type field, plus the test.

…t render

A retried render can ask for the slower, safer capture mode without changing the pod's environment.
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 112 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (1)

  • seqab-none-center-r0-root-z100: tracking 0.03, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.03, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.03, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes at e30d690b for one reason: the Comments check fails on this head.

RAISED comment share: packages/producer/src/server.ts is 10.6% (113/1065), at the base 10.6% (112/1060)
    1 comment line(s) added.

CONTRIBUTING.md says "A package file's comment share may not rise" (scripts/comment-ratchet.mjs), and the PR body ticks "Comments follow CONTRIBUTING.md". The fix is to drop the /** Capture with screenshots for this render only… */ line on RenderInput.forceScreenshot. The name and the ?: true type already say it, and the explanation is in the PR description. Run node scripts/comment-ratchet.mjs before pushing.

Everything else checks out, so I'll approve once the ratchet is green:

  • New test fails without the change. I restored server.ts from main (merge base 3baf81f9a): the forced case fails ("expected … to match object { producerConfig: … }"), 1 failed and 3 passed. At the head all 4 pass. tsc --noEmit on packages/producer is clean.
  • The path is correct. forceScreenshot: true becomes engineOverrides → resolveConfig(overrides), so an explicit true wins over PRODUCER_FORCE_SCREENSHOT=false. Both handlers that go through buildRenderJobConfig get it. Absent, false and "true" leave the env value in charge.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at a68f7161.

  • Only the comment changed. Compared with e30d690b, the one difference is the removed /** Capture with screenshots… */ line in packages/producer/src/server.ts. The merge base is still 3baf81f9a, and the code and tests are unchanged.
  • Comments now passes on this head, so the ratchet finding is resolved.
  • My earlier checks still apply to the unchanged code. The new test fails on main (1 of 4) and passes at the head (4 of 4). tsc --noEmit is clean. An explicit true reaches resolveConfig through engineOverrides and wins over PRODUCER_FORCE_SCREENSHOT=false.

CI, regression, Windows render verification and CodeQL were still running when I approved.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 79b6af9 Nov 3, 2026
142 of 143 checks passed
@miguel-heygen
miguel-heygen deleted the rvelo/force-screenshot-request branch November 3, 2026 07:49
@miguel-heygen miguel-heygen mentioned this pull request Nov 3, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant