fix(setup): Playwright Chromium failure becomes best-effort warn, not exit 1#1900
Open
DavidMiserak wants to merge 1 commit into
Open
fix(setup): Playwright Chromium failure becomes best-effort warn, not exit 1#1900DavidMiserak wants to merge 1 commit into
DavidMiserak wants to merge 1 commit into
Conversation
… exit 1 Replaces both `exit 1` paths in the Playwright install/verify block with a $_PW_FAIL_REASON accumulator that prints a named warning to stderr and returns control. Previously a Chromium download failure (network blip, locked-down corporate machine, missing Node.js on Windows) would abort ./setup mid-run with no skills registered, no hooks installed, no migrations applied — and a re-run would start over from the top. Now the failure only disables browser-driven features (/qa, /design-review, make-pdf, sidebar, /pair-agent); skills, hooks, and migrations land normally. The warning names which sub-step failed (chromium-install / windows-no-node / windows-node-modules / post-install-launch) so users and bug reports can be specific, and tells the user to re-run ./setup to retry just this step. Tests (5) exercise the actual block from setup with stubbed ensure_playwright_browser and bunx, simulate install + post-install failures, and assert the script exits 0 with the named warning. One side-by-side test inlines the OLD bug shape and confirms it returned non-zero, so the exit-code difference is proven, not just asserted. Coordinates with garrytan#1838 (pins Playwright install version): both touch the same code block, so whichever lands first needs the other to rebase. The changes are complementary — garrytan#1838 fixes which Chromium build gets installed; this PR fixes what happens when the install fails. Carved out from garrytan#1883 per @jbetala7's review request.
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
This was referenced Jun 7, 2026
Open
Open
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.
Carving out the Playwright-warn change from #1883 as a focused PR per
@jbetala7's review request. Coordinated with #1838 — see "Relationship
to #1838" below.
Problem
The Playwright Chromium install in
./setupis the riskiest step in thewhole script: it needs network, talks to a Microsoft CDN, on Windows it
bounces through Node.js because of a Bun pipe bug, and on locked-down
corporate machines it may not even be allowed to run. Until now, any
failure in that step was fatal (
exit 1) and aborted./setupmid-run,before skills got registered, hooks got installed, or migrations ran.
A re-run would start over from the top, hit the same Chromium download
issue, fail the same way. There was no clean way to get a working gstack
install on a machine where Chromium was unreachable, even though every
non-browser feature would have worked fine.
Fix
Replace both
exit 1paths in the Playwright install/verify block with a$_PW_FAIL_REASONaccumulator. On failure, the script:chromium-install,windows-no-node,windows-node-modules, orpost-install-launch./qa,/design-review,make-pdf, sidebar,/pair-agent).node -e "require('playwright')"verify command../setupto retry — at which point only thePlaywright step needs to succeed, because skills, hooks, and
migrations are already in place from earlier steps.
All other setup behavior is unchanged. The script exits 0 in the
warn-only path and the user gets a usable gstack install minus browser
features.
Tests
test/setup-playwright-warn-not-exit.test.ts— 5 tests, exit-code-pathexercised (not source-grep):
exit 1reachable from the block — source-anchored regexon the live block extracted from
setup._PW_FAIL_REASONaccumulator + named warning present — samesource-anchored extraction.
block in bash with stubbed
ensure_playwright_browser(always fails)and stubbed
bunx(fails). Asserts script exits 0, stderr containswarning: Playwright Chromium is unavailable (chromium-install),and the retry hint fires.
exit 1path with the same stubs and confirms it returned non-zero. Proves
the exit-code difference is real, not a quoting illusion.
bunxsucceeds,ensure_playwright_browserkeeps failing — assertsexit 0 with reason
post-install-launch.Test plan
bun test test/setup-playwright-warn-not-exit.test.ts— 5 passbun test test/setup-*.test.ts— 70 passbash -n setup— syntax OK_PW_FAIL_REASONvalueRelationship to #1838
This PR and #1838 modify the same Playwright block in
setupbutsolve non-overlapping problems:
bunx playwright installto the bundledplaywright/package.jsonversion so the install-time and runtime versions don't drift) + tightensensure_playwright_browser()to assertexecutablePath()exists.exit 1→_PW_FAIL_REASONaccumulator + named warning, no abort).Both can land — they're complementary. Whichever lands first, the other
needs a small rebase. I'm happy to rebase this PR onto #1838 if the
maintainers prefer that order (likely the cleaner sequence, since #1838
is closer to merging).
Relationship to #1883
This PR is the "(2) Playwright warn-don't-exit" split @jbetala7 asked
for on #1883. The third split — the phase reorder — will be a separate
PR against fresh
mainwith an issue describing the failure modes itfixes. #1883 stays open until all three splits are visible, then I'll
close it with links to all three.
Sibling: #1898 (the two bug fixes, opened first).