Repository navigation
fix(cli): snapshot prints a progress line as each frame starts - #6618
Conversation
|
|
||
| for (let i = 0; i < positions.length; i++) { | ||
| const time = positions[i]!; | ||
| console.error(`[hyperframes] snapshot: frame ${i + 1}/${positions.length} at ${time}s`); |
There was a problem hiding this comment.
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.
|
Fixed at ae117ac: the four |
What
hyperframes snapshotprints one line on stderr as each frame starts:Why
Snapshot printed a header, then nothing until every frame was saved. On a long list of
--attimes, 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.checkalready prints a line per sample in the same shape ([hyperframes] check: craft 12/80).Related work
None.
How
One
console.errorat 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--zoomlater skips. It goes to stderr in both modes, so--jsonstdout 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'ssnapshot.tsit fails (expected [] to deeply equal [ …(2) ]); with this change it passes 3 runs in a row.oxfmt, oxlint and
fallow auditare 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.