Repository navigation
gstack-hook-check reports every TypeScript hook as "bun could not bundle" on Windows (Git Bash): MSYS argv path conversion breaks the built.tsv lookup #3100
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
On Windows with Git Bash, ./setup (v1.91.66.0+) exits 1 and refuses to register every TypeScript-backed
hook, with bun could not bundle the TypeScript entry. The hooks bundle fine. The failure is in
bin/gstack-hook-check's bookkeeping:
- It passes absolute POSIX paths (
/c/Users/...) tobun.exeas argv. - MSYS converts native-exe argv to Windows form (
C:/Users/...). Bun.buildtherefore records rows keyedC:/Users/...inbuilt.tsv.- The later lookup searches for
/c/Users/..., finds nothing, and treats a missing row as a bundle
failure.
gstack-doctor shows the same false hooks: fail.
Environment
- gstack 1.91.68.0 (
20eb620), global Claude install at~/.claude/skills/gstack - Windows 11 Pro, Git for Windows (Git Bash / MSYS2 runtime)
- Bun 1.4.2
Symptoms
./setup ends with exit 1:
gstack setup: refusing to register hooks that do not parse (Claude Code would block tool calls with them):
.../hosts/claude/hooks/question-log-hook.ts:1: bun could not bundle the TypeScript entry
.../hosts/claude/hooks/question-preference-hook.ts:1: bun could not bundle the TypeScript entry
.../hosts/claude/hooks/auq-error-fallback-hook.ts:1: bun could not bundle the TypeScript entry
.../hosts/claude/hooks/timeline-stop-hook.ts:1: bun could not bundle the TypeScript entry
.../autoplan/bin/phase-publication-hook.ts:1: bun could not bundle the TypeScript entry
.../plan-ceo-review/bin/mode-handoff-hook.ts:1: bun could not bundle the TypeScript entry
Hooks that parse register as usual: bin/gstack-session-update careful/bin/check-careful.sh freeze/bin/check-freeze.sh
bin/gstack-doctor then reports fail hooks ... bun could not bundle the TypeScript entry.
The hooks are fine
The same entries bundle without error:
cd ~/.claude/skills/gstack/hosts/claude/hooks
bun build ./timeline-stop-hook.ts --target=bun --outdir "$(mktemp -d)"
# Bundled 4 modules in 11ms (exit 0)The check's own Bun.build call also succeeds. It is the argv spelling that changes:
E="$HOME/.claude/skills/gstack/hosts/claude/hooks/timeline-stop-hook.ts" # /c/Users/.../timeline-stop-hook.ts
bun -e 'for (const e of process.argv.slice(1)) { const r = await Bun.build({ entrypoints: [e], target: "bun", packages: "external", metafile: true, throw: false }); console.log(`argv=${e} success=${r.success} inputs=${Object.keys(r.metafile?.inputs ?? {}).length}`) }' "$E"
# argv=C:/Users/.../timeline-stop-hook.ts success=true inputs=4
MSYS_NO_PATHCONV=1 bun -e 'console.log(process.argv[1])' "$E"
# /c/Users/.../timeline-stop-hook.tsRoot cause (bin/gstack-hook-check at 1.91.68.0)
- Line 55 normalizes
ROOTto POSIX form on Windows:ROOT=$(cygpath -u "$ROOT"), giving/c/Users/.... - Lines 148-153 build
ENTRIESas absolute paths under that POSIXROOT:
ENTRIES="$ENTRIES${shim%/*}/$entry$NL". - Line 156 onward runs
"$BUN" -e '...' $ENTRIES > "$BUILT".bun.exeis a native Windows
executable, so the MSYS runtime rewrites each/c/...argument toC:/.... The script prints
${entry}, the rewritten spelling, as column 1 ofbuilt.tsv. - Line 206 looks rows up by the POSIX spelling:
result=$(awk -F '\t' -v e="$dir/$entry" '$1 == e' "$BUILT"). No row matches, soresultis empty. - An empty
resultis reported asbun could not bundle the TypeScript entry(line ~208), even though
the build succeeded.
So on Git Bash every TypeScript hook is rejected, whatever its content.
Suggested fixes (any one)
- Pass entries relative to
ROOT. The script already doescd "$ROOT"before invoking bun, and MSYS
does not rewrite relative paths. Key both the TSV and the lookup by the relative path. - Normalize the lookup key on Windows: compare against
cygpath -m "$dir/$entry"(or normalize both
sides) in the awk lookup. - Have the bun script echo the caller's spelling: pass entries via stdin or an env var (not
converted by MSYS) instead of argv, and print exactly what it received. - Distinguish "no row" from "build failed" in the message, e.g.
no build result recorded for <entry>, so a bookkeeping miss isn't reported as a bundle error.
Impact
./setupexits 1 on every Windows Git Bash install from 1.91.66.0 onward, andgstack-doctor
reportshooks: fail.- Settings-level TypeScript hooks are not (re)registered. Previously registered fail-open hooks (the
timeline-stop-hookStop shim) keep working. Skill-frontmatter hooks that call their scripts by path
(/autoplan,/plan-ceo-review) also keep working, since the scripts exist and build. - Users following the message's advice ("repair the file ... half-applied edits") will find nothing
to repair.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
gfl130902-maker commentedon Oct 11, 2026
Still reproduces on 1.91.83.0 (5cb5e1c) — Windows 11 10.0.26300, Git Bash, Bun 1.4.3. All six TS-entry hooks were skipped on a fresh install.
Confirmed locally that accepting both spellings in the lookup fixes it (
gstack-hook-checkthen reports 9/9okand setup registers every hook):Note
MSYS2_ARG_CONV_EXCL='*'is not a workaround: bun then fails withEINVAL: failed to open root directory: /c/Users/....capy-ai commentedon Oct 11, 2026
Fixed in v1.91.89.0 (e6edff0, #3140). This is the same false positive as #3088: Bun reported
C:/paths while the checker looked up/c/. The fix adopts @yuriysan's #3112.To recover a stuck install, run this once from Git Bash:
It also clears
/gstack-upgrade's "is not a gstack checkout" refusal. Thanks @bkermen. You're credited as co-author on the merged commit.