Repository navigation
fix(cli): require patched Chrome 148+ and rebuild Docker image on Dockerfile change - #6
Open
teamkareem wants to merge 2 commits into
Open
teamkareem wants to merge 2 commits into
teamkareem wants to merge 2 commits into
Conversation
Co-authored-by: Kareem <teamkareem@users.noreply.github.com>
Co-authored-by: Kareem <teamkareem@users.noreply.github.com>
8 of 9 tasks
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
Follow-up to #5 (CVE-2026-111497 / GHSA-9v8h-qqgm-4m35, Brotli decoder out-of-bounds write). This PR fixes two leftovers from that PR.
packages/cli/src/browser/manager.ts, the download version moves from131.0.6778.85to148.0.7778.167, the same buildDockerfile.testpins. I also added a minimum-version floor (MIN_CHROME_VERSION = 148.0.0.0) so older cached or system Chrome builds are no longer used.render --dockernever rebuilt its image. Inpackages/cli/src/commands/render.ts, the image tag is nowhyperframes-renderer:<version>-<sha256(Dockerfile)[0:12]>. A changed Dockerfile now gets a new tag and a fresh build, in both release and dev (latest) mode.Why
Chromium releases before 148 bundle a Brotli revision without the upstream fix (
0ed4268a). From 148.0.7778.0 onward, Chromium bundles Brotlicfa184a, which contains it. Before this PR, the CLI downloaded Chrome 131, andfindBrowser()accepted any cached headless-shell or system Chrome regardless of version. The Docker image was cached by CLI version only, so changes toDockerfile.render(such as #5's Node pin) never reached users who had already built the image.How
Version floor in
findBrowser()/ensureBrowser()~/.cache/hyperframes/chrome)ensureBrowser()downloads 148.0.7778.167 into the same cache.~/.cache/puppeteer/chrome-headless-shell)<binary> --version(memoized, 5s timeout). Old versions, or binaries whose version can't be read, are rejected and fall through to the download. On Windows,--versionis not run because it opens a browser window, so system Chrome there is treated as unknown and rejected.HYPERFRAMES_BROWSER_PATHThe published
enginesrange is unchanged.Render-output / golden-baseline impact
packages/producer/tests/*/output/output.mp4are rendered insideDockerfile.test, which installs chrome-headless-shell148.0.7778.167directly and doesn't use this CLI code path. The CLI fallback now matches that build.Dockerfile.testdocuments for Chrome bumps. Users whose system Chrome was older than 148 also switch from screenshot capture to BeginFrame capture on Linux, because they now get headless-shell.render --docker: the first run after upgrading builds a new image (several minutes) under the hash-suffixed tag. The rendered output depends on what's inDockerfile.render, not on the tag. Oldhyperframes-renderer:<version>images stay on disk until the user removes them.Files changed
packages/cli/src/browser/manager.ts: download version bumped, minimum-version floor and version detection added, clearer error on ARM64.packages/cli/src/browser/manager.test.ts:node:child_processis now mocked, fixtures moved to 148, and 7 new tests cover the floor (cache, puppeteer cache, system Chrome, unknown version, Debian version string, env override, re-download).packages/cli/src/commands/render.ts:dockerImageTag(version, dockerfile)hashes the Dockerfile, and the Dockerfile is read once and reused for the build context.packages/cli/src/commands/render.test.ts: 2 tests for the tag.docs/packages/cli.mdx: notes the minimum Chrome version underbrowser.Leftovers
packages/engine/src/services/browserManager.tsresolveHeadlessShellPath()still scans the puppeteer cache, sorts names lexicographically, and applies no minimum version. CLI renders aren't affected because the CLI passes its vetted path throughPRODUCER_HEADLESS_SHELL_PATH. Direct library users of@hyperframes/engineor@hyperframes/producercan still pick up a stale build.packages/studio/vite.adapter.tssetsPRODUCER_HEADLESS_SHELL_PATHfrom its own system-Chrome lookup without a version check.~/.cache/hyperframes/chrome, and oldhyperframes-renderer:*images aren't removed automatically. They're never selected again; users can delete them withhyperframes browser clearanddocker image rm.hyperframes-renderer:latest-<hash>image still pins whateverhyperframes@latestwas on npm when it was built, until the Dockerfile changes.Test plan
vitest run src/browser/manager.test.ts: 16/16 pass.dockerImageTagtests inrender.test.tspass (2/2).oxlintandoxfmt --checkare clean on the changed files.tsc --noEmitpasses onmanager.tsandmanager.test.ts.bun run buildandbun run test. Installing Bun was blocked in the agent environment, so tests ran through an isolated vitest install. Forrender.test.ts,@hyperframes/*imports were stubbed, so the existingrenderLocaltests in that file (which need the real@hyperframes/core) could not run locally. CI covers them.