Skip to content

fix(cli): composition path errors name the resolved entry and project directory - #6458

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/entry-error-resolved-paths
Oct 26, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/entry-error-resolved-paths

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

When --composition points outside the project, at a missing file, or at a directory, the error now names the path it resolved to and the project directory it was checked against, next to the value that was passed:

✗  Invalid composition path
   "../x.html" resolves to /tmp/demo/x.html, outside the project directory /tmp/demo/proj.
   Pass a .html file inside the project directory, relative to it (e.g. compositions/intro.html).

Why

The old outside-project error printed only the raw value (Entry file must stay inside the project directory: ../x.html), and the not-found and directory errors said "the project directory" without naming it. Agents reading this error could not tell which directory the path was resolved against, so they retried with the same wrong path. Both resolved paths make the mistake visible in one read.

How

  • CompositionEntryParseError now carries the resolved entryPath and projectDir, and compositionEntryErrorMessage is the one place that words all three cases.
  • cloud render had its own missing-entry message with the raw values. It now validates through the same parseCompositionEntryArg and prints through the same message, so it also rejects an entry outside the project before uploading. It keeps its own exit path.
  • The --composition helpers move from renderArgs.ts to utils/compositionEntry.ts, so cloud render can use them without loading the render engine. renderArgs.ts is otherwise unchanged.

Test plan

  • renderArgs.test.ts: each of the three cases must return the resolved entry path and project directory, and its message must name both. cloud/render.test.ts: a missing entry must print both. 51 passed, 3 runs; with the old message wording and the old cloud check restored, exactly these 4 fail.
  • src/commands/render plus both files: 215 passed, 3 runs. tsc --noEmit shows no errors in the changed files.
  • Ran the CLI: render -c ../x.html, render -c missing.html and cloud render --composition ../x.html --dry-run print the messages above.
  • oxfmt, oxlint, comment ratchet and check-cli-lazy-deps (on a fresh CLI build): clean.

Why under 100 lines

The behaviour change is about 30 lines across the error type, its message and the cloud check. The rest of the diff is the helpers moving to their own module, unchanged apart from shorter comments.

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 161 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 (0)

@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.

Verdict: APPROVE · 0 blocker · 0 important · 1 nit · head d6f78268

  • nit: cloud render still sends the raw args.composition to the server (commands/cloud/render.ts:299) while the local check now accepts ././/absolute spellings and normalizes them to a project-relative entry. Not introduced here, but passing entry.value through would make the server see the path that was validated.
Scope

Read the full diff. The move into utils/compositionEntry.ts is byte-equivalent apart from the new entryPath/projectDir fields and the message wording. The cloud check now goes through parseCompositionEntryArg: default index.html, .→index.html, absolute-inside, and rejecting outside-project entries all behave as intended, and it keeps failCommand. No other importers of the moved symbols. CI on this head is green, including Windows render verification and Comments.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 26, 2026
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Oct 26, 2026
Merge 20 more upstream commits (acd0bc3..ad4d3fa, v0.8.205: heygen-com#6403,
heygen-com#6363, heygen-com#6209, heygen-com#6395, heygen-com#6424, heygen-com#6426, heygen-com#6442, heygen-com#6430, heygen-com#6402, heygen-com#6435, heygen-com#6439,
heygen-com#6449, heygen-com#5436, heygen-com#6455 and docs). No conflicts. Record the 11 open PRs
heygen-com#6440-heygen-com#6458 and issue heygen-com#6443 in docs/DECISIONS.md (none adopted), re-check
the earlier open PRs, and advance the commit watermark to ad4d3fa, the
PR watermark to heygen-com#6458 and the issue watermark to heygen-com#6443.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merged via the queue into main with commit 306f21a Oct 26, 2026
70 checks passed
@miguel-heygen
miguel-heygen deleted the fix/entry-error-resolved-paths branch October 26, 2026 20:00
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