fix(setup): phase-ordered setup — skills/hooks land before network ops#1
Open
DavidMiserak wants to merge 2 commits into
Open
fix(setup): phase-ordered setup — skills/hooks land before network ops#1DavidMiserak wants to merge 2 commits into
DavidMiserak wants to merge 2 commits into
Conversation
Restructures setup into four phases ordered by failure probability so a bad network day or missing sudo never leaves users with zero skills: Phase A — trivial filesystem ops (always succeed) Phase B — local compute: binary build, skill linking, migrations Phase C — settings.json mutation (reversible) Phase D — network/sudo/package managers (best-effort, warn not exit) Playwright/Chromium failures are now non-fatal warnings with a named $_PW_FAIL_REASON. Skills, hooks, and migrations are already installed before Phase D runs; re-running ./setup retries only the network step. Also fixes two bugs found in code review: - Use bun_cmd wrapper (not bare bun) in Codex/Factory/OpenCode skill generation helpers — fixes silent failures on Windows with non-ASCII bun paths - Remove | tail -3 pipe in GBrain regen so bun exit code is preserved and the error warning actually fires on failure
There was a problem hiding this comment.
Pull request overview
This PR refactors the setup script into four ordered phases (A–D) so that skill linking, hooks, and migrations complete before higher-risk network/sudo operations. It also changes Playwright/Chromium installation failures from fatal exits to warnings, and fixes Windows non-ASCII Bun path issues by routing skill-doc generation through bun_cmd.
Changes:
- Reorders setup flow into Phase A (trivial), Phase B (local compute/filesystem), Phase C (settings mutation), and Phase D (network/package managers).
- Makes Playwright/Chromium installation and launch checks best-effort, emitting a warning with a reason code instead of aborting.
- Fixes skill-doc generation on Windows non-ASCII Bun paths by using
bun_cmdfor Codex/Factory/OpenCode doc generation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
setupinto four phases ordered by failure probability, so a bad network day or missingsudonever leaves users with zero skills installedexit 1, now a named warning with$_PW_FAIL_REASON; skills, hooks, and migrations are already in place before Phase D runsPhase structure
~/.gstack/, welcome message, GBrain detectionsettings.jsonmutation: team/plan-tune hooksPreviously, a Playwright install failure (network issue, bad mirror, missing sudo) would
exit 1mid-run, leaving skills unregistered. Now Phase D is best-effort; re-running./setupretries only that phase.Bug fixes
link_codex_skill_dirs,link_factory_skill_dirs, andlink_opencode_skill_dirswere callingbun rundirectly instead ofbun_cmd, bypassing the Windows non-ASCII path workaround. Silent failures masked by subsequent directory-existence checks.bun_cmd run gen:skill-docs:user ... | tail -3causedtail's exit 0 to swallow bun's failure, so the|| log "warning..."clause never fired. Removed the pipe.Test plan
./setupon a clean install — confirm skills link, hooks install, and Playwright failure (if any) prints a warning instead of aborting./setup --host codexon Windows with non-ASCII username — confirm Codex skill docs generate./setupwith GBrain installed — confirm warning fires ifgen:skill-docs:userfails