Repository navigation
feat(cli): name a caller's owner id on the browsers and warm check it starts - #7687
Conversation
… 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.
Fallow audit reportQuality gate failed Found 1 finding. Dead code (1)
Generated by fallow.
|
Edit accuracy: accurate 267 (base branch 267), smooth 77 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (1)
|
There was a problem hiding this comment.
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.
What
When
HYPERFRAMES_OWNERis 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.warmServerArgsand read back byparseWarmServerArgs(cliwarmCheckProtocol.ts), so the switch never reaches the check's own arguments.Tests
packages/core/src/browserMarker.test.ts"names the caller's owner once, and only a plain id".packages/cli/src/warmCheckProtocol.test.ts"names the caller's owner and hands the check its own args back".packages/engine/src/services/browserManager-ownerMarker.test.ts"names the caller's owner on the capture browser".warmCheckProtocol2 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