Skip to content

fix(cli): a locked Chrome debug.log on Windows no longer fails check, snapshot or render - #6771

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/windows-browser-log-ebusy
Oct 30, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/windows-browser-log-ebusy

Conversation

@miguel-heygen

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

Copy link
Copy Markdown
Collaborator

What

check, snapshot and render no longer fail on Windows with EBUSY: resource busy or locked, unlink '.../chrome-headless-shell-win64/debug.log' when a Chrome from the managed install is still running.

Why

Every cleanup of a set-aside or killed-install browser folder in browser/manager.ts was a bare recursive rmSync. A running chrome-headless-shell keeps debug.log open and Windows refuses to unlink it, so the removal threw and the command died before it did any work. The failed removal left the folder behind, so the next command tried again and failed again.

Related work

#5698 and #6506 retry other locked files on Windows (ffmpeg executables, undo/redo); neither touches the browser cache.

How

One helper, removeLeftover, now does both removals that run during normal commands: the sweep of killed-install folders (before every download, and before a render) and the removal of the folder an upgrade sets aside. It retries a few times, then leaves a folder that Windows still holds (EBUSY/EPERM) for the next sweep. Any other error still throws. hyperframes browser clear uses the same sweep, so it also leaves a folder Windows still holds instead of throwing.

render shares the path: it calls the same sweep (sweepKilledInstalls) and ensureBrowser as check and snapshot.

Test plan

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)
  • Comments follow CONTRIBUTING.md "Comments"

fails without the fix: with the EBUSY/EPERM tolerance removed, does not fail a run when Windows holds a leftover's debug.log fails with promise rejected "Error: EBUSY: resource busy or locked, un…" instead of resolving.

What I measured

manager.test.ts: 72 passed on three runs on Linux; oxfmt and oxlint clean. The test makes the removal of a set-aside folder throw EBUSY and checks the sweep, a forced download and a forced re-download all resolve and the folder stays.

What I did NOT execute

A real Windows machine with a running Chrome. The cause is reasoned from the reported error and the code, not reproduced on Windows.

@github-actions

Copy link
Copy Markdown
Contributor

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

Unstable (4)

  • seqrotatenudge-none-center-r0-nested-z100: tracking 0.02, pressJump 0, drop 0, reload 3.03, render 0.04, renderKey -, undo false, teleport true / tracking 0.02, pressJump 0, drop 0, reload 0, render 0.05, renderKey -, undo true, teleport true / tracking 0.02, pressJump 0, drop 0, reload 0, render 0.05, renderKey -, undo true, teleport true
  • seqfastkeys-none-px-r0-root-z100: tracking 0.07, pressJump 0.05, drop 0, reload 0, render 0.02, renderKey -, undo false, teleport true / tracking 0.07, pressJump 0.05, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0.05, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true
  • seqplainkeys-none-pct-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true
  • seqplainkeys-none-pct-r0-nested-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo false, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

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

  • nit: the body says hyperframes browser clear is unchanged, but clearBrowser (manager.ts:950) goes through removeInstallLeftovers, so it now swallows EBUSY/EPERM too. When the only thing left is a held .chrome-replaced-* folder, browser clear prints "Removed cached browser" and the folder is still there (before this change it threw). Worth a body fix, or keeping clearBrowser strict.
Checked
  • Ran manager.test.ts at head: 72 passed. With the EBUSY/EPERM tolerance in removeLeftover replaced by a rethrow, the new test fails with promise rejected "Error: EBUSY…" instead of resolving, so the fails-without-the-fix claim holds. The second forced ensureBrowser covers the set-aside path in moveStagedInstallIntoCache, and the sweep covers removeInstallLeftovers.
  • render reaches the same sweep through commands/render/execute.ts:201. Staging cleanup is still a bare rmSync, which is fine because a staged browser never runs.
  • oxlint/oxfmt are clean. CI is green on this head, including the Windows render and test lanes.
  • Not covered: real Windows behaviour (the body says the same).

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 6874cc2 Oct 30, 2026
209 checks passed
@miguel-heygen
miguel-heygen deleted the fix/windows-browser-log-ebusy branch October 30, 2026 01:51
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 2, 2026
…com#6605 heygen-com#6611 heygen-com#6831 heygen-com#6800

Windows debug.log lock, PowerShell UTF-16 batch JSON, long backup names,
--variables-file readFile override, Figma motion key collisions. Rest deferred
with per-commit evidence; 72 PRs pinned in monitored.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: SanHsien <34234698+SanHsien@users.noreply.github.com>
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