Skip to content

fix(engine): diagnose a failed Chrome launch with the env it had - #7634

Merged
jrusso1020 merged 1 commit into
mainfrom
fix/engine-diagnosis-launch-env
Nov 13, 2026
Merged

jrusso1020 merged 1 commit into
mainfrom
fix/engine-diagnosis-launch-env

Conversation

@jrusso1020

Copy link
Copy Markdown
Collaborator

When Chrome fails to start, the startup diagnosis now relaunches it with the env the failed attempt had, not one rebuilt from process.env. Before this, a launch that dropped WAYLAND_DISPLAY or the SwiftShader Vulkan pins was diagnosed with them restored, so the diagnosis could describe a different failure.

Claude Opus 5.5

Change

  • explainChromeLaunchFailure takes { signal, env } as its 4th argument (it was a bare signal). diagnoseChromeStartup spawns with buildChromeLaunchEnv(options.env). When no env is given it still falls back to process.env, and the allowlist still applies either way.
  • Engine launchBrowser passes the launchEnv(fingerprint) result that the attempt launched with. That env has the Wayland display removed on WSL hardware mode and the Vulkan pins removed for SwiftShader.
  • CLI withStartupDiagnosis passes the attempt's options.env, the same input launchOwnedBrowser filters.
  • Docstring updated: the diagnosis replays the failed launch's flags and env.

Tests

  • Engine (browserManager-sandboxRetryDiagnosis.test.ts): VK_DRIVER_FILES is set and a SwiftShader launch fails. The test asserts the diagnosis gets exactly the env the attempt launched with, and that env has no pin.
  • CLI (launch.sandboxRetryDiagnosis.test.ts): a real end-to-end probe. WAYLAND_DISPLAY is set in process.env, the launch env omits it, and a fake browser prints its WAYLAND_DISPLAY. The diagnosis must not see the process.env value.
  • Mutation check: each test fails when its piece of the fix is reverted (engine call without env, diagnosis spawn back on buildChromeLaunchEnv(), CLI call without env), and passes with the fix. The engine services suite passes (2215 tests), and so do the CLI launch tests.

Refs #7623

🤖 Generated with Claude Code

— Rames Jusso

The startup diagnosis rebuilt its env from process.env, so a launch that
dropped WAYLAND_DISPLAY or the SwiftShader Vulkan pins was diagnosed with
them restored. The engine and CLI now pass the failed attempt's env through
explainChromeLaunchFailure; process.env stays the fallback when no env is given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

  • 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
  • seqrotatenudge-none-px-r0-root-z100: tracking 0.03, pressJump 0, drop 0, reload 3.07, render 0.04, renderKey -, undo false, teleport true / tracking 0.03, pressJump 0, drop 0, reload 0, render 0.08, renderKey -, undo true, teleport true / tracking 0.03, pressJump 0, drop 0, reload 0, render 0.08, 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 · 0 nits · cb374285

This closes the #7629 diagnosis-env nit. Both callers of explainChromeLaunchFailure now pass the attempt's env: the engine passes launchEnv and the CLI passes options.env. Running that env through buildChromeLaunchEnv again is safe because the base already has the passthrough fix. An env of undefined still falls back to process.env. The switch from a positional signal to an options object leaves no stale callers, and CI is green.

— Genesis

@jrusso1020
jrusso1020 added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 9701f4b Nov 13, 2026
93 checks passed
@jrusso1020
jrusso1020 deleted the fix/engine-diagnosis-launch-env branch November 13, 2026 01:55
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