Repository navigation
fix(core,engine,producer): handle id-less media in sub-composition renders - #96
Merged
Merged
Conversation
parseVideoElements required video[id][src] but agent-generated sub-compositions often omit the id on nested videos. Without an id, the producer can't extract frames via ffmpeg, causing black rectangles in rendered output while the preview works fine. Now auto-generates stable IDs (__auto_video_0, etc.) for id-less videos so the producer's frame extraction pipeline handles them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Resolve the videoFrameExtractor conflict by keeping the broader src-based parsing and the newer duration fallback logic. Move the id-less media timing fix into core compileTimingAttrs so producer can resolve durations for auto-generated media ids before inlining sub-compositions. Also make producer prefer sub-composition media timing over the later inlined parse and add runnable regression coverage for sub-composition-video.
miguel-heygen
marked this pull request as ready for review
March 31, 2026 23:33
vanceingalls
approved these changes
Mar 31, 2026
Collaborator
Author
Merge activity
|
dahans-msft2
pushed a commit
to dahans-msft2/hyperframes
that referenced
this pull request
Aug 6, 2026
…nders (heygen-com#96) ## What Move the id-less media fix into the shared timing compiler so producer can resolve durations for sub-composition videos before inlining, then carry the merged result through engine parsing, regression coverage, and the regression Docker image used in CI. This PR now does five concrete things: - assigns stable ids to id-less media in core `compileTimingAttrs()` so unresolved duration injection can target them - keeps the engine-side `parseVideoElements()` support for `video[src]` plus the newer `data-duration` / natural-duration fallback from `main` - makes producer prefer sub-composition media metadata over the later inlined-document parse when the same media id appears in both places - makes `sub-composition-video` a runnable regression test by fixing its metadata and checking in the missing `output/compiled.html` snapshot - removes the stale `pnpm-workspace.yaml` copy step from `Dockerfile.test`, so regression CI builds the Bun-based test image from the current workspace layout ## Why - media without an explicit `id` could not participate in unresolved-duration resolution early enough - producer could lose the resolved sub-composition timing by overwriting it with the later inlined parse - the regression fixture intended to cover this case was not actually running in CI because its `meta.json` was incomplete and the required compiled snapshot was missing - the regression image definition still expected a deleted `pnpm-workspace.yaml`, so GitHub Actions failed before the test shard could start Putting the id-generation step in core makes the behavior reusable instead of relying on producer-only HTML patching. ## How ### Shared compiler - core `compileTimingAttrs()` now auto-assigns stable ids to id-less `video` / `audio` tags - those generated ids are returned in `unresolved`, so `injectDurations()` can add `data-duration` and `data-end` to the same media element later in the pipeline - added core tests that cover auto-id assignment and duration injection for generated ids ### Producer - when producer combines `subVideos` / `subAudios` with the media re-parsed from the final inlined HTML, it now lets the sub-composition metadata win - this preserves the resolved/clamped timing already computed for nested media instead of overwriting it with the later parse - `sub-composition-video` now has valid regression metadata and a checked-in `output/compiled.html` snapshot so CI actually executes it ### Engine - resolved the merge conflict in `videoFrameExtractor` by keeping the broader `video[src]` parsing from this branch and the `data-duration` / natural-duration fallback that landed on `main` - added a focused engine unit test for videos without ids ### CI image - `Dockerfile.test` now copies only `package.json` and `bun.lock` at the workspace root before `bun install --frozen-lockfile` - this matches the current monorepo layout and removes the obsolete pnpm-era dependency on `pnpm-workspace.yaml` ## Test plan - [x] `bun run --filter @hyperframes/core test` - [x] `bun run --filter @hyperframes/engine test` - [x] `bun run --filter @hyperframes/producer test --update --sequential sub-composition-video` - [x] `bun run --filter @hyperframes/producer test --sequential sub-composition-video` - [x] Browser check with `agent-browser` against the compiled fixture page (`http://127.0.0.1:8123/compiled.html`) - [x] Clean tracked-only Docker build of `Dockerfile.test` with the PR version of the file applied ## Notes - Latest regression workflow is green on `main`, but before this PR the `sub-composition-video` fixture was being skipped by the harness rather than exercised end to end. - The CI Docker fix was validated from a tracked-only export to avoid local untracked worktree artifacts affecting the result.
philipp676767
pushed a commit
to philipp676767/hyperframes
that referenced
this pull request
Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kqj2XLEj7NbFbvWVzMgo4
philipp676767
pushed a commit
to philipp676767/hyperframes
that referenced
this pull request
Nov 26, 2026
… scene Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kqj2XLEj7NbFbvWVzMgo4
philipp676767
pushed a commit
to philipp676767/hyperframes
that referenced
this pull request
Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kqj2XLEj7NbFbvWVzMgo4
philipp676767
pushed a commit
to philipp676767/hyperframes
that referenced
this pull request
Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kqj2XLEj7NbFbvWVzMgo4
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
Move the id-less media fix into the shared timing compiler so producer can resolve durations for sub-composition videos before inlining, then carry the merged result through engine parsing, regression coverage, and the regression Docker image used in CI.
This PR now does five concrete things:
compileTimingAttrs()so unresolved duration injection can target themparseVideoElements()support forvideo[src]plus the newerdata-duration/ natural-duration fallback frommainsub-composition-videoa runnable regression test by fixing its metadata and checking in the missingoutput/compiled.htmlsnapshotpnpm-workspace.yamlcopy step fromDockerfile.test, so regression CI builds the Bun-based test image from the current workspace layoutWhy
idcould not participate in unresolved-duration resolution early enoughmeta.jsonwas incomplete and the required compiled snapshot was missingpnpm-workspace.yaml, so GitHub Actions failed before the test shard could startPutting the id-generation step in core makes the behavior reusable instead of relying on producer-only HTML patching.
How
Shared compiler
compileTimingAttrs()now auto-assigns stable ids to id-lessvideo/audiotagsunresolved, soinjectDurations()can adddata-durationanddata-endto the same media element later in the pipelineProducer
subVideos/subAudioswith the media re-parsed from the final inlined HTML, it now lets the sub-composition metadata winsub-composition-videonow has valid regression metadata and a checked-inoutput/compiled.htmlsnapshot so CI actually executes itEngine
videoFrameExtractorby keeping the broadervideo[src]parsing from this branch and thedata-duration/ natural-duration fallback that landed onmainCI image
Dockerfile.testnow copies onlypackage.jsonandbun.lockat the workspace root beforebun install --frozen-lockfilepnpm-workspace.yamlTest plan
bun run --filter @hyperframes/core testbun run --filter @hyperframes/engine testbun run --filter @hyperframes/producer test --update --sequential sub-composition-videobun run --filter @hyperframes/producer test --sequential sub-composition-videoagent-browseragainst the compiled fixture page (http://127.0.0.1:8123/compiled.html)Dockerfile.testwith the PR version of the file appliedNotes
main, but before this PR thesub-composition-videofixture was being skipped by the harness rather than exercised end to end.