Skip to content

fix(cli): snapshot prints a progress line as each frame starts - #6618

Merged
miguel-heygen merged 2 commits into
mainfrom
fix/snapshot-frame-progress
Oct 28, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
fix/snapshot-frame-progress

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

What

hyperframes snapshot prints one line on stderr as each frame starts:

[hyperframes] snapshot: frame 3/40 at 12.5s

Why

Snapshot printed a header, then nothing until every frame was saved. On a long list of --at times, or a heavy page, that is minutes of silence: an agent or a person cannot tell a slow run from a stuck one, and the last thing printed doesn't say which frame it was on. check already prints a line per sample in the same shape ([hyperframes] check: craft 12/80).

Related work

None.

How

One console.error at the top of the frame loop, before the seek, so the last line names the frame a slow or stuck run is working on, including a frame --zoom later skips. It goes to stderr in both modes, so --json stdout stays one envelope.

Test plan

fails without the fix: packages/cli/src/commands/snapshot.progress.browser.test.ts ("prints a progress line on stderr as each frame starts, and keeps stdout one --json envelope"): with main's snapshot.ts it fails (expected [] to deeply equal [ …(2) ]); with this change it passes 3 runs in a row.

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)
  • Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug

oxfmt, oxlint and fallow audit are clean on the changed files.

Why under 100 lines

Small on purpose: one progress line per frame, so a long snapshot is no longer silent, plus the test that fails without it and the narrowing of four existing assertions that counted every stderr line.

@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: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 30751d7c

The new stderr line breaks five existing tests, which turns required Test and Tests on windows-latest red ↓ inline. Main's CI is green.


for (let i = 0; i < positions.length; i++) {
const time = positions[i]!;
console.error(`[hyperframes] snapshot: frame ${i + 1}/${positions.length} at ${time}s`);

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.

blocker: snapshot-contactSheet.test.ts asserts expect(console.error).not.toHaveBeenCalled() at lines 126, 164 and 328. Every capture now calls console.error once per frame, so all five tests in that file fail (expected "error" to not be called at all, but actually been called 2 times). That turns required Test (cli) red on ubuntu (5 failed / 6277 passed), and the same file fails Tests on windows-latest: engine-cli. Those assertions should still catch real errors, so narrow them to ignore the [hyperframes] snapshot: progress lines instead of deleting them. For example, filter console.error calls by that prefix and expect none to remain.

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.

✅ Fixed in ae117ac

@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

Fixed at ae117ac: the four console.error assertions in snapshot-contactSheet.test.ts (three "not called", one "called once") now count only calls other than the [hyperframes] snapshot: progress lines, so they still catch real errors. vitest run --project unit src/commands/snapshot: 144/144, three runs in a row; the progress test still passes.

@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 — 1 resolved, 0 open, 0 new · 30751d7 → ae117ac. The contact-sheet tests now skip only the [hyperframes] snapshot: lines, so they still catch real errors. Required Test and Tests on windows-latest are green.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 28, 2026
@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit b288ce0 Oct 28, 2026
113 checks passed
@miguel-heygen
miguel-heygen deleted the fix/snapshot-frame-progress branch October 28, 2026 07:12
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