Skip to content

fix(check): a Chrome that never becomes ready ends the check with a named error - #7360

Merged
miguel-heygen merged 2 commits into
mainfrom
fix/check-chrome-start-deadline
Nov 7, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
fix/check-chrome-start-deadline

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

hyperframes check could print nothing and never end when Chrome did not become ready: the check's idle clock only started once Chrome was ready, so the phases before it (the video copies, then starting Chrome) were not covered by any deadline of the check's own.

  • The check's deadline now covers Chrome start. From the moment the check begins starting Chrome, a Chrome that is not ready within 180 s ends the check with a runtime finding, Chrome did not start within 180 s while starting Chrome. Seconds per phase: ..., with a hint to run hyperframes browser ensure (a first run downloads Chrome).
  • Chrome start has its own window (180 s, or the idle window if that is longer) because a first-run download legitimately takes longer than the 120 s idle window. Video copies keep their own budget and still do not spend the idle window.
  • The "still ..." line on stderr every 30 s now also runs while Chrome starts (before, it began only when Chrome was ready).
  • The idle clock for page work is unchanged: it starts when Chrome is ready.

Why

A report: hyperframes check --json on Windows (0.9.19, win32 x64) printed nothing for 200+ s and the caller waited on it with no error. 0.9.19 predates the stderr phase lines, so the caller saw no output at all. This change makes the CLI always end, with a named error, inside a bounded time whichever phase stalls from Chrome start onward. I did not reproduce the original stall: I have no Windows machine, so the cause of Chrome not becoming ready on that machine is still unknown; the new finding records how long each step took, so the next report names it.

Size

One class and its tests (checkDeadline, one pipeline test) plus one paragraph in docs/packages/cli.mdx.

Test plan

  • vitest run of checkDeadline.test.ts, check.test.ts and checkPipeline*: 220 passed, 3 runs in a row (run on a built checkout).
  • fails without the fix: with the Chrome-start window disabled, the two new tests fail ("a Chrome that never becomes ready ends the check with a named error" and the pipeline version); 179 others pass.
  • bun run format:check exit 0; fallow audit --base origin/main --fail-on-issues exit 0 ("No issues in 56 changed files"); oxlint exit 0; tsc: no error in the changed files.
  • The tests use fake timers and a fake Chrome that settles only on abort, so they also run in the Windows test lanes of CI.
  • Not done: a run with a real Chrome made to stall on a Windows runner.

@mintlify

mintlify Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 7, 2026, 11:02 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

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

Request changes at fdc4b7e1. There's one blocker, and it's small.

Blocker: the Comments workflow is red. The comment ratchet fails on checkDeadline.ts:

RAISED comment share: packages/cli/src/utils/checkDeadline.ts is 1.5% (4/274), at the base 0.4% (1/247)
    3 comment line(s) added. Cut them, or move the explanation into a name or a type.

Three comments were added: the doc comment on CHROME_START_MS, the second line of the class doc, and the doc comment on start. The names already carry most of that meaning, for example CHROME_START_MS and CheckChromeStartError. Cutting the three lines should clear the ratchet. If you'd rather keep one, FIRST_RUN_DOWNLOAD_MS would say the same thing as a name. The test plan didn't run this check: fallow audit and format:check don't cover the ratchet.

Checked at this head. The logic looks right:

  • The 180 s window, or the idle window if that's longer, only arms while the phase is launch and the check is waiting.
  • start() (wired to onBrowserReady on both open paths) switches to the normal idle clock.
  • copies still runs before launch and still doesn't spend the window, which the new test shows.
  • runBrowserCheck runs inside deadline.run, so the expiry race ends the check even when a Chrome launch or download ignores the abort.
  • The heartbeat now starts at the first enter(), but announce still stays quiet for copies. expire and close clear the heartbeat.
  • Tests, on a built checkout: checkDeadline.test.ts, check.test.ts and checkPipeline* gave 220/220 passed.
  • The "fails without the fix" claim holds. With launching forced to false, exactly the two named tests fail ("a Chrome that never becomes ready ends the check with a named error" and the pipeline version), and the other 218 pass.
  • oxfmt is clean on the changed files.
  • The rest of CI is green or still running.

Not blocking: the replaced test, "browser provisioning does not spend the check budget", reverses an earlier choice on purpose: launch is now bounded at 180 s. The docs paragraph and the hyperframes browser ensure hint cover a slow first-run download, so I'm fine with it.

I'll approve once Comments is green on the new head.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 98 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 (8)

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

Approve at 1a36232f.

What changed since fdc4b7e1: only checkDeadline.ts, +3/−6. The three added comment lines are gone, CHROME_START_MS is renamed CHROME_START_WINDOW_MS, and the class doc is back to its one line on main. Nothing in the behavior changed.

Checks at this head:

  • checkDeadline.test.ts, check.test.ts and checkPipeline*: 220/220 passed.
  • The "fails without the fix" claim still holds. With launching forced to false, the two named tests fail and the others pass.
  • oxfmt is clean.
  • CI is fully green: CI, CodeQL, Comments (the ratchet now passes), Docs, preview-regression, regression, PR captures, Player perf and Windows render verification.

My notes on the logic from the last review still apply, and none of them block.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit e827de2 Nov 7, 2026
86 checks passed
@miguel-heygen
miguel-heygen deleted the fix/check-chrome-start-deadline branch November 7, 2026 11:43
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 7, 2026
…, heygen-com#7360, heygen-com#7347); review to PR heygen-com#7362

Adopt heygen-com#7357 and heygen-com#7361 (upload completion waits and retries), heygen-com#7360 (Chrome
start failure names its cause in check) and heygen-com#7347 (Safari perf tooling);
release v0.9.20 not applicable. Pin open heygen-com#7362 (needs its golden LFS pointer
when adopted); record issue heygen-com#7363. Monitored 126 -> 127.

Co-authored-by: Miguel Ángel <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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