Skip to content

fix(engine): diagnose the launch attempt whose error surfaces - #7630

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

jrusso1020 merged 1 commit into
mainfrom
fix/engine-sandbox-retry-diagnosis

Conversation

@jrusso1020

Copy link
Copy Markdown
Collaborator

When a sandboxed Linux Chrome launch fails and its no-sandbox retry fails too, the startup diagnosis now re-runs the retry's flags, the ones that produced the error you see, instead of the first attempt's. Follow-up to #7625.

Claude Opus 5.5

What

  • packages/engine/src/services/browserManager.ts, launchBrowser: the launch closure records the args of each attempt launchWithChromeSandboxFallback makes. The diagnosis's defaultArgs is built from the last one, not from the args passed in.

  • packages/cli/src/browser/launch.ts, launchManagedBrowser: same for withStartupDiagnosis. It now gets the options of the attempt that failed:

    • the no-sandbox retry when there was one
    • the one-process-over-pipe options in an agent seatbelt
    • the seatbelt relaunch's own options on that branch

    Before, all three used the caller's original options.

Why

Genesis noted this on #7625. After both attempts fail, the surfaced error is the retry's, but the diagnosis re-ran Chrome with the sandboxed flags. It reported how a different launch ended.

How

A let attempted updated inside the launch callback. Because the retry only runs after the first attempt fails, the last attempt is always the one whose error surfaces. No API changes.

Related work

Follow-up to #7625. Open-PR overlap: #7622 also edits packages/cli/src/browser/launch.ts, but in launchOwnedBrowser, not in the hunk here. #7629 (Chrome launch env) touches different hunks of the same two files, and the two branches merge cleanly together (checked with git merge-tree).

Test plan

  • browserManager-sandboxRetryDiagnosis.test.ts: both launches fail with a closed target. The diagnosis must get the retry's --no-sandbox flags. It failed before the fix and passes after.
  • launch.sandboxRetryDiagnosis.test.ts (Linux): a fake browser that prints its argv and exits, so the real diagnosis spawn runs. The surfaced message must show --no-sandbox. It failed before the fix and passes after.
  • Existing engine browserManager, seatbelt and chromeSandbox tests (150), plus CLI sandboxDenied and launch.startupFailure tests (14), pass.
  • oxfmt, oxlint, tsc --noEmit for engine and cli, fallow audit, comment ratchet.

— Rames Jusso

🤖 Generated with Claude Code

When a sandboxed Linux launch fails and the no-sandbox retry also fails,
the startup diagnosis re-ran Chrome with the first attempt's flags, so it
described a launch that was not the one reported. The engine and CLI now
diagnose the flags of the attempt that produced the error.

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 101 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)

@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 · 4dbca84b

I checked launchWithChromeSandboxFallback: the retry only runs after the first attempt throws, and its error is the one rethrown, so the last recorded attempted is always the attempt whose error surfaces. The CLI seatbelt branch now diagnoses with retry, and the non-seatbelt branch with prepared/no-sandbox args, as intended. Env parity for the diagnosis spawn is noted on #7629. 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 4372235 Nov 13, 2026
93 checks passed
@jrusso1020
jrusso1020 deleted the fix/engine-sandbox-retry-diagnosis branch November 13, 2026 00:52
@miguel-heygen miguel-heygen mentioned this pull request Nov 13, 2026
3 of 5 tasks
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