v1.57.4.0 fix(setup): route gen:skill-docs through bun_cmd; drop tail -3 pipe that masks bun failures#1898
Open
DavidMiserak wants to merge 1 commit into
Open
Conversation
|
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
Contributor
|
Verified on
Scope is tight (4 setup lines + a focused regression test), no phase restructure, no Playwright behavior change. Looks correct to me. |
74febfc to
696ee59
Compare
DavidMiserak
added a commit
to DavidMiserak/gstack
that referenced
this pull request
Jun 8, 2026
…ability
setup used to interleave trivial filesystem ops, expensive compute,
settings.json mutations, and network/sudo steps in whatever order the
script grew. A Playwright Chromium download failing at step 2 would
abort before skills got registered at step 4, hooks landed at step 10,
or migrations ran at step 8.
This commit groups work by where failures actually come from:
Phase A — filesystem (always succeeds): ~/.gstack/, welcome, GBrain detection
Phase B — local compute (low fail): bun build, skill linking, migrations, regen
Phase C — settings.json mutation (medium fail, reversible): team-mode + plan-tune hooks
Phase D — external network/sudo/package managers (highest fail): coreutils, font, Playwright
Each phase is bracketed with a header comment; steps within are
renumbered (A1, A2, B1, B2a...).
The biggest behavior shift is the GBrain detect/regen split that the
new order requires: detection moves to A3 (filesystem scan only, no
dependencies), regen moves to B6 (runs after the binary is built and
skill docs are generated). Detection persists to
~/.gstack/gbrain-detection.json so B6 can read it.
A safety guard for that split: when gstack-gbrain-detect exits non-zero,
A3 removes both the temp file AND any pre-existing detection file from a
prior successful run. Without the guard, a stale "ok" detection file
would survive a failed detect and silently apply ~250 tokens of overhead
per planning skill to a user whose gbrain may no longer be installed.
Behavior preservation:
- bun_cmd routing in link_{codex,factory,opencode}_skill_dirs is
unchanged (still buggy here). The fix is in garrytan#1898.
- gen:skill-docs:user still pipes through `tail -3` in B6 (still buggy
here). The fix is in garrytan#1898.
- Playwright Chromium install/verify in D3 still exits 1 on failure
(unchanged). The warn-don't-exit conversion is in garrytan#1900 and
coordinates with garrytan#1838.
Splitting those keeps this PR reviewable as "a move plus the gbrain
split that the move requires," per @jbetala7's request on garrytan#1883.
…hat masks bun failures Two surgical fixes called out by @jbetala7 on garrytan#1883, carved out as the focused fast-merge PR they asked for. 1. link_codex_skill_dirs, link_factory_skill_dirs, and link_opencode_skill_dirs called literal `bun run gen:skill-docs ...` instead of routing through `bun_cmd`, the wrapper installed by prepare_bun_for_windows_compile. On a non-ASCII Windows username the literal call would exit non-zero; the next line checks if the output directory exists and prints a soft warning, masking the failure. 2. The gbrain-detected SKILL.md regen ran `bun_cmd run gen:skill-docs:user --host claude 2>&1 | tail -3`. The pipe makes the subshell's exit status `tail`'s (always 0), swallowing bun's failure so the `|| log "warning..."` clause right after never fires regardless of whether bun succeeded. Tests exercise the exit-code path, not source-grep: stub bun_cmd to fail, run the actual shell pattern, assert the `|| log` clause fires only on the fixed shape and does NOT fire on the buggy shape with the pipe.
e091eaa to
76957bd
Compare
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
Fix two bugs in
setupthat silently broke skill doc generation on certain installations.bun_cmdrouting fix — Three helpers (link_codex_skill_dirs,link_factory_skill_dirs,link_opencode_skill_dirs) called literalbun run gen:skill-docsinstead of thebun_cmdwrapper. Thebun_cmdwrapper exists to handle Windows non-ASCII usernames:prepare_bun_for_windows_compilecopies bun to an ASCII path and pointsBUN_CMDat it when needed. Bypassing it caused silent failures on affected installs. (setup:714, 919, 951)Pipe-masking exit-code fix — The gbrain-detected SKILL.md regen ran
bun_cmd run gen:skill-docs:user ... 2>&1 | tail -3. The pipe makes the subshell's exit statustail's, which is always 0, so the trailing|| log "warning..."guard never fired when bun failed. Dropping the pipe restores correct failure detection. (setup:1297)Both fixes were identified by @jbetala7 during review on #1883, carved out as a focused fast-merge PR per their request.
Test Coverage
Tests: 0 → 5 (+5 new)
Pre-Landing Review
Review: CLEAR (DIFF, 2026-06-08, same commit). Quality score: 9.0/10.
0 critical. 4 informational (all skipped — minor test quality suggestions, no blocking issues).
Adversarial: Pre-existing
set -edead-code in warning blocks (not introduced by this PR). Recommendation: ship as-is.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Greptile Review
No Greptile comments.
Scope Drift
Scope Check: CLEAN — 4 setup lines + 5 tests + CHANGELOG/VERSION, no creep.
Plan Completion
No plan file detected.
TODOS
No TODO items completed in this PR.
Test plan
bun test test/setup-bun-cmd-and-pipe-bugs.test.ts— 5 pass / 0 failbun test— exit code 0 (pre-existing failures in E2E/browse suites unrelated to this branch)bash -n setup— syntax OK🤖 Generated with Claude Code