Skip to content

fix(engine): keep capture diagnostics on stderr - #5304

Open
user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/engine-diagnostics-stderr
Open

user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/engine-diagnostics-stderr

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

What

Send engine browser/capture/parallel diagnostics to stderr so commands such as hyperframes benchmark --json emit a parseable JSON report on stdout.

Why

A healthy benchmark completes all five configurations, but its stdout starts with [BrowserManager] Browser launched, initialization messages, and forwarded browser logs. Parsing the documented JSON output fails before reaching the report. These diagnostics bypass the producer logger, which already reserves stdout for command payloads.

Related work

Merged #2520, #2551, and #3836 establish stderr routing for system-memory, CLI, and proxy diagnostics. This change covers the remaining engine emitters. Open #5227, #5178, #4954, #3993, #3941, and #3803 touch these modules for timeline waiting, proxies, rendering, verification, or worker sizing; none covers diagnostic stream routing.

How

Route launch, initialization, browser-console, fallback, reuse, and parallel/debug notices to stderr. Keep diagnostic text, session buffering, font-error suppression, and render error classification. Extend the existing stderr-only lint guard to the three engine emitter modules.

Test plan

  • Two new regression tests fail on unchanged main with 128 controls passing. All 210 relevant engine tests and 20 producer-logger tests pass with the fix.
  • Actual source and built CLI benchmark --runs 1 --json processes on a valid 64×64, 0.2-second composition: parse the entire stdout with json.loads, verify five completed runs and zero failures, and verify launch/init/runtime diagnostics remain on stderr. Unchanged main completes the same runs but its complete stdout fails JSON parsing.
  • The existing guard rejects an injected console.log in an engine emitter. Changed files pass lint and formatting; root lint, test reachability, initial full workspace build, engine build, CLI rebuild/typecheck, and normal commit hooks pass.
  • The actual composition passes static lint and browser check.
  • Comments follow CONTRIBUTING.md.

To reproduce, run hyperframes benchmark <valid-project> --runs 1 --json > report.json and parse report.json. On main it contains engine notices before the JSON report; this change retains those notices on stderr.

This branch has not been deployed

No deployments
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