feat(cli): split cloud render --resolution into --aspect-ratio + --resolution#1143
Merged
jrusso1020 merged 1 commit intoJun 1, 2026
Merged
Conversation
…solution
Aligns the `hyperframes cloud render` CLI with the v3 API's decomposed
shape (ef#38182). Replaces the flat 6-value `--resolution` flag with two
independent flags:
- `--resolution`: tier ∈ {1080p, 4k}; default 1080p; 4k bills at 1.5x
- `--aspect-ratio`: ratio ∈ {16:9, 9:16, 1:1}; default 16:9
Regenerates `packages/cli/src/cloud/_gen/{types,client}.ts` from the
updated `experiment-framework/openapi/external-api.json`. Threads
`aspectRatio` through `SubmitOptions` and `buildRenderBody` so it lands
in the request body as `aspect_ratio`.
Old flag values (`landscape`, `portrait-4k`, etc.) now reject at the CLI
layer via `parseEnumFlag`, matching the API surface's rejection. The
six legacy combinations map to the same effective output in the new
shape — see the migration table in ef#38182's PR body.
Deferred (will follow in a separate PR): 720p, 4:5, 5:4, and `auto`.
These need producer-side capability + controller-side composition-dim
inference; out of scope for an API/CLI shape refactor.
miguel-heygen
approved these changes
Jun 1, 2026
Collaborator
miguel-heygen
left a comment
There was a problem hiding this comment.
Clean flag plumbing — the CLI tracks the API shape exactly. camelCase → snake_case mapping is correct (aspectRatio → aspect_ratio), old preset values correctly rejected at parseEnumFlag before hitting the server.
Pre-existing engine test red is mine (wrong call index in the 3-track audioMixer test, not introduced by this diff). Fix is in #1144.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Aligns the
hyperframes cloud renderCLI with the v3 API's decomposed resolution shape (companion to https://github.com/heygen-com/experiment-framework/pull/38182). Replaces the flat 6-value--resolutionflag with two independent flags:--resolution: tier ∈{1080p, 4k}; default1080p; 4K is billed at 1.5x by the API.--aspect-ratio: ratio ∈{16:9, 9:16, 1:1}; default16:9.Old CLI values (
landscape,portrait-4k, etc.) now reject at the flag-parsing layer (parseEnumFlag→Invalid --resolution) so callers see a clean local error instead of a server 422.Why
Today the CLI exposes the same 6-string flat preset (
landscape,landscape-4k,portrait,portrait-4k,square,square-4k) that the v3 API used until ef#38182. That shape conflates "aspect ratio" and "resolution tier" into a single value, which is awkward to author and reason about — devs naturally think--resolution 1080pand--aspect-ratio 16:9independently. The flat preset has also caused 400s fornpx hyperframes cloud renderusers trying the obvious shape.This PR moves the CLI to match the v3 API's new decomposed shape so the two stay in sync. Combined with ef#38182, a user can now say
hyperframes cloud render --resolution 4k --aspect-ratio 1:1and have it render at 4K square instead of needing to remember--resolution square-4k.How
Three files touched:
packages/cli/src/commands/cloud/render.ts—VALID_RESOLUTIONchanges to["1080p", "4k"], newVALID_ASPECT_RATIO = ["16:9", "9:16", "1:1"], new--aspect-ratioarg in the command schema, parsed viaparseEnumFlag, threaded throughSubmitOptionsandbuildRenderBodyinto the request body asaspect_ratio.packages/cli/src/cloud/_gen/types.ts— auto-regenerated from ef#38182's updatedopenapi/external-api.json. NewHyperframesResolution = "1080p" | "4k"andHyperframesAspectRatio = "16:9" | "9:16" | "1:1"types;CreateHyperframesRenderRequestgainsaspect_ratio?: HyperframesAspectRatio;HyperframesRenderDetailgainsaspect_ratio?: HyperframesAspectRatio | null.packages/cli/src/cloud/_gen/client.ts— also regenerated but no semantic delta (the request body is passed through verbatim via the typed interface); skipped to keep the PR minimal.The six legacy
--resolutioncombinations map to the same effective output in the new shape — see the migration table in ef#38182's PR body. The new shape is strictly a smaller surface (3×2 = 6 cells exactly).Pre-existing red CI
Testjob fails onpackages/engine/src/services/audioMixer.test.ts:122(compensates amix normalization so multi-track master gain equals track count) — the test readsmixArgs[mixArgs.indexOf("-filter_complex") + 1]and expects"amix=inputs=3"but gets"-ss". Wrong arg-index assumption.This is pre-existing on main, NOT introduced by this work. hf#1140 (Miguel's audio mixer fix, merged earlier) ALSO had
Test failin its CI checks — the test added by Magi in commite7355703passes locally per Magi's report but fails in CI because the actual ffmpeg arg layout differs from what the test assumes. This PR's diff is CLI-only (packages/cli/src/commands/cloud/render.ts+_gen/types.ts); it cannot affectpackages/enginetests. Verified by inspection.Cleanup PR needed against main from Magi or whoever owns the engine surface. Don't block this PR's review on it.
Test plan
bunx oxlint,bunx oxfmt --check,bunx fallow audit --base origin/main, andcd packages/core && bunx tsc --noEmit && cd ../studio && bunx tsc --noEmitall green locally via lefthook pre-commit.Manual flag parsing:
--resolution 1080p,--resolution 4k,--aspect-ratio 16:9accepted;--resolution landscape(and other old presets),--aspect-ratio autorejected withparseEnumFlagerror.Existing cloud-render unit tests in
packages/cli/src/cloud/*.test.ts(ansi, download, errors, parsing, poll) are unaffected by this change — none referenceresolutiondirectly.Unit tests added/updated — N/A; no
cloud/render.test.tsexists today and the change is mechanical (flag plumbing). Will add coverage in the same PR that addsauto+720psupport (those need new paths worth pinning).Manual testing performed — flag-parse smoke per above.
Documentation updated —
packages/cli/src/docs/rendering.mddoesn't reference the old presets, no doc update needed in this PR.Deferred
720p,4:5,5:4, andautoare intentionally NOT in the new enum surface. They need render-pipeline capability additions (producer-side preset support for720p/4:5/5:4, controller-side composition-dim inference forauto) — those will follow in a separate PR. The CLI will gain the same values when the API does.— Created by Rames Jusso (hyperframes specialist, Rames team)