Skip to content

feat(cli): name a caller's owner id on the browsers and warm check it starts - #7687

Merged
miguel-heygen merged 1 commit into
mainfrom
dagentmem/browser-owner
Nov 14, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
dagentmem/browser-owner

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

When HYPERFRAMES_OWNER is set to a plain id (letters, digits, ., _, -, up to 64 characters), every browser the CLI or engine launches and the warm check server the CLI leaves behind carry --hyperframes-owner=<id> on their command line. Chrome ignores the switch. The warm check server strips it before it reads its own arguments. With the variable unset, or set to anything else, command lines are unchanged.

Why

A caller that runs several renders at once can't tell which leftover browser or warm check server belongs to which of its runs. Both already carry --hyperframes-owned-browser, but that is the same for every run, and a process's environment or working folder can't always be read from outside. With a per-run id on the command line, the caller can close one run's leftovers without touching another run that is still using its own.

How

  • withHyperframesBrowserMarker (core), which every browser launch already goes through, appends the owner switch once.
  • The warm check server's argv is built by warmServerArgs and read back by parseWarmServerArgs (cli warmCheckProtocol.ts), so the switch never reaches the check's own arguments.
  • The variable is part of the environment the warm server compares, so a warm server only serves checks with the same owner.

Tests

  • fails without the fix: packages/core/src/browserMarker.test.ts "names the caller's owner once, and only a plain id".
  • fails without the fix: packages/cli/src/warmCheckProtocol.test.ts "names the caller's owner and hands the check its own args back".
  • fails without the fix: packages/engine/src/services/browserManager-ownerMarker.test.ts "names the caller's owner on the capture browser".
  • On main's source the new cases fail: core 1 failed, 2 passed; cli warmCheckProtocol 2 failed, 8 passed; engine owner marker 1 failed, 3 passed. With the change: 3/3, 10/10 and 4/4, three runs in a row (Linux, Node 24, vitest 4). oxlint is clean on the changed files.

Not exercised

  • No real Chrome or warm check server was started with the variable set; the tests read the launch args and the warm server's argv.
  • Typecheck and the full suites are left to CI.

… starts

A caller that runs several renders at once sets HYPERFRAMES_OWNER to a per-run id; every browser the CLI or
engine launches and the warm check server carry --hyperframes-owner=<id>, so the caller can tell one run's
leftovers from another's.
@github-actions

Copy link
Copy Markdown
Contributor

Fallow audit report

Quality gate failed

Found 1 finding.

Dead code (1)
Severity Rule Location Description
major fallow/unused-export packages/cli/src/warmCheckProtocol.ts:10 Export 'WARM_IDLE_MS' is never imported by other modules

Generated by fallow.

Gate outcomes: failed audit-verdict.

@github-actions

Copy link
Copy Markdown
Contributor

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

Unstable (1)

  • seqplainkeys-none-px-r0-root-z100: 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 / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, 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 b95ec508

Every browser launch site (cli launch.ts, engine browserManager.ts/hdrCapture.ts, producer, inspector) goes through withHyperframesBrowserMarker, so all of them pick up the owner. Because envDigest hashes the whole launch env, a warm server only serves its own owner. All three fails without the fix: tests fail on the merge base and pass on this head. I reproduced that locally.

Scope / CI

All required checks are green. The only red is the optional Fallow audit (see the nit). Locally, cli warmCheckProtocol.test.ts "refuses a token file others can read" also fails on the merge base, so this PR didn't introduce it.

Comment thread packages/cli/src/warmCheckProtocol.ts Resolved
@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 798c241 Nov 14, 2026
96 of 97 checks passed
@miguel-heygen
miguel-heygen deleted the dagentmem/browser-owner branch November 14, 2026 02:58
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