Skip to content

fix(cli): keep check --json stdout pure by sending proxy pre-resolve diagnostics to stderr - #3836

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/check-json-proxy-preresolve-stderr
Oct 2, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/check-json-proxy-preresolve-stderr

Conversation

@miga-heygen

@miga-heygen miga-heygen commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

hyperframes check --json did not always print pure JSON on stdout. preResolveHostileMediaProxies() in packages/cli/src/utils/checkBrowser.ts logged its summary line ([hyperframes] media proxy pre-resolve: N/M ready, F failed (Xms)) and its scan-failure line with console.info, which writes to stdout. With auto-proxy on (the default), any project with HEVC/ProRes/AV1 media printed that line before the JSON envelope, so JSON.parse(stdout) failed for machine consumers.

Fix

Both lines now go through console.error (stderr). This is the function's only caller path and its only stdout writes, so one change covers every case. In human mode the line still shows in the terminal, but it now goes to stderr: a run that captures only stdout (hyperframes check > log) no longer records it. Nothing in the repo parses it, and exit codes and the JSON shape are unchanged.

Size

Under 100 lines: two console.info to console.error swaps plus tests.

Tests

  • The existing "swallows a resolveProxy rejection" test now spies on console.error.
  • New: the summary lands on stderr with the exact N/M ready, F failed (Xms) shape; console.info, console.log and process.stdout.write are never called.
  • New: a scan failure lands on stderr, stdout stays untouched, and no proxy resolution is attempted.
  • vitest run src/utils/checkBrowser.test.ts: 18/18 pass; with the swap reverted, the 3 stderr tests fail (15/18).
  • tsc --noEmit -p packages/cli and oxfmt --check clean.

@miga-heygen
miga-heygen enabled auto-merge (squash) September 10, 2026 02:30
@miga-heygen
miga-heygen force-pushed the fix/check-json-proxy-preresolve-stderr branch from a8ea8d0 to 8da0950 Compare September 10, 2026 02:31
@miguel-heygen
miguel-heygen force-pushed the fix/check-json-proxy-preresolve-stderr branch from 8da0950 to b5644d1 Compare October 2, 2026 10:31
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Edit accuracy: accurate 1216 (base branch 1216), smooth 1009 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 (1)

…diagnostics to stderr

preResolveHostileMediaProxies() logged its summary and scan-failure lines via
console.info, which writes to stdout. With autoProxy on (the default), any
project containing HEVC/ProRes/AV1 media emitted that line ahead of the JSON
envelope from `check --json`, so JSON.parse(stdout) failed for consumers of
the machine-readable output.

Route both diagnostics through console.error (stderr), matching how the check
command already reports its own failures. Add regression tests asserting the
summary and scan-failure lines land on stderr and that stdout stays untouched.
@miguel-heygen
miguel-heygen force-pushed the fix/check-json-proxy-preresolve-stderr branch from a197335 to 7ce2be3 Compare October 2, 2026 12:08
@miguel-heygen
miguel-heygen merged commit 1a61978 into main Oct 2, 2026
153 of 155 checks passed
@miguel-heygen
miguel-heygen deleted the fix/check-json-proxy-preresolve-stderr branch October 2, 2026 13:25
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.

2 participants