Repository navigation
fix(engine): diagnose the launch attempt whose error surfaces - #7630
Merged
Merged
Conversation
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>
5 of 6 tasks
Contributor
Contributor
There was a problem hiding this comment.
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
3 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 attemptlaunchWithChromeSandboxFallbackmakes. The diagnosis'sdefaultArgsis built from the last one, not from the args passed in.packages/cli/src/browser/launch.ts,launchManagedBrowser: same forwithStartupDiagnosis. It now gets the options of the attempt that failed: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 attemptedupdated 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 inlaunchOwnedBrowser, 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 withgit merge-tree).Test plan
browserManager-sandboxRetryDiagnosis.test.ts: both launches fail with a closed target. The diagnosis must get the retry's--no-sandboxflags. 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.browserManager,seatbeltandchromeSandboxtests (150), plus CLIsandboxDeniedandlaunch.startupFailuretests (14), pass.tsc --noEmitfor engine and cli,fallow audit, comment ratchet.— Rames Jusso
🤖 Generated with Claude Code