Skip to content

Setup works on Windows when the home folder name has an apostrophe (#4386) - #4845

Merged
capy-ai[bot] merged 4 commits into
mainfrom
fix/windows-setup-apostrophe-home
Nov 26, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
fix/windows-setup-apostrophe-home

Conversation

@garrytan

@garrytan garrytan commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

./setup on Windows now installs when your home folder has an apostrophe in its name, such as C:\Users\O'Brien.
Git Bash turns /c/... paths into C:/... before starting Bun, but skips any path holding an apostrophe, so setup stopped with Module not found.
Nothing to do: re-run ./setup after upgrading.

What changed

Setup on a Windows runner with an apostrophe in the home folder: Bun could not find the script before; setup now finishes

Setup on a Windows runner with an apostrophe in the home folder: Bun could not find the script before; setup now finishes.

Before/after as text:

--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ HOME="$RUNNER_TEMP/o'brien/smoke-home" ./setup --host claude   # Windows runner, this branch (run 45842245130)
+gstack ready (claude)
+/ship, /review, /qa-only, /browse: SKILL_START_PROTO: 1
+/browse chain from an unrelated directory: gstack-windows-smoke-ok
-$ HOME="$RUNNER_TEMP/o'brien/smoke-home" ./setup --host claude   # Windows runner, main (run 45840283430)
-+ bun --no-env-file --config=NUL '/d/a/_temp/o'\''brien/smoke-home/.claude/skills/gstack/scripts/preflight-codex-overlap.ts' ...
-error: Module not found "/d/a/_temp/o'brien/smoke-home/.claude/skills/gstack/scripts/preflight-codex-overlap.ts"
-##[error]Process completed with exit code 1.
 

A Windows user whose home folder name has an apostrophe could not install gstack: ./setup handed Bun a /c/Users/O'Brien/... path, which Git Bash leaves unconverted, and Bun stopped with Module not found. Setup now converts every path it passes to Bun itself, through a small _bun_path helper that uses cygpath -m under Git Bash and does nothing elsewhere. That covers the Codex overlap preflight (script, --source, --namespace, --relocation), gstack-harness refresh and register, the skill-route default lookup and the skill-gate hook timeout. A new test pins those call sites and checks the helper on any OS.

The proof is a one-off windows-smoke dispatch from a scratch branch, not a new required check. It cloned gstack into $RUNNER_TEMP/o'brien/smoke-home/.claude/skills/gstack and ran setup there: run 45840283430 failed on main, and run 45842245130 passed setup, the core skills start and the /browse chain flow.

Why

"./setup still passes Bun unconverted paths under a home folder with an apostrophe" was the gap left open on #4386 after #4682. Windows users with such a name can now install gstack at all.

Blast radius

Only Git Bash and Cygwin behave differently. Off Windows _bun_path prints its argument unchanged, which test/setup-bun-path-apostrophe.test.ts checks (script ran), and the full free suite passed on this head. No dependencies, network, permissions or workflows change.

Pre-Landing Review

Two full review rounds and a second-model adversarial read. Round 1 found one gap (the --relocation path was unconverted), fixed in this PR. The final review of the whole diff found nothing blocking. The adversarial read raised four notes below the blocking floor, listed next; all four were already broken before this PR and lose no data.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL setup:2054 bun_cmd start of gstack-migrate-claude-code still passes unconverted paths; under an apostrophe home the legacy wrapper migration fails quietly (pre-existing, no data loss).
  • INFORMATIONAL setup:4474 gbrain render passes unconverted --out-dir/--link-root paths; render keeps the previous output under an apostrophe home (pre-existing).
  • INFORMATIONAL setup:4426 gstack-gbrain-detect (Bun shebang) may hit the same conversion skip; needs a Windows run with gbrain installed.
  • INFORMATIONAL setup:5013 SKILL_ROUTE_BIN assignment would abort setup under set -e if cygpath -m failed (theoretical).
Eval Results

No prompt-related files changed, so evals were skipped.

Issues

Refs #4386

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The docs already match this change, so no files were edited.

Audited scope: the committed diff from fd81a04 to 7ddeb754: setup (a new _bun_path helper that spells every path handed to Bun as C:/... through cygpath -m on Git Bash or MSYS), three tests and one changelog fragment. Nothing is staged, unstaged or untracked. I also searched every Markdown and template file for MSYS path-conversion, cygpath, Module not found and apostrophe mentions.

Documentation health:

  • changelog.d/fix-windows-setup-apostrophe-home.md: current, and accurate about the cause and the fix.
  • docs/support-tiers.md: current; the Windows minimal-support promise is unchanged.
  • AGENTS.md: current; the Bun-isolation rule still holds.
  • docs/troubleshooting.md: current; the Windows section has no stale claims.

Coverage debt: _bun_path is internal to setup and adds no command, flag or setting users see, so it needs no reference doc. docs/troubleshooting.md has no entry for the Module not found error that Windows users with an apostrophe in their home folder hit before this fix. That gap is minor and is reported here, not filled.

Diagram drift: none.

Tests
  • Full free suite carried from CI: free-tests run 45847831096 at 7ddeb75, 1723 files, 0 failed.
  • Windows: windows-smoke, windows-setup and windows-scoped-tests green on this head; the one-off apostrophe-home smoke run 45842245130 passed.
  • Locally: bun test test/setup-bun-path-apostrophe.test.ts test/setup-skill-hooks-gate.test.ts test/setup-hook-syntax-gate.test.ts test/codex-hooks-setup.test.ts test/team-mode.test.ts passed.
Agent notes

Follow-up to #4682 for #4386, per the maintainer ruling to test setup under an apostrophe home on a one-off Windows run and fix the call sites it breaks.

REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=4 fixed=1 scope=frozen dispatches=8
Gate edits: none detected (5 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Approvals: No approvals recorded for branch fix/windows-setup-apostrophe-home.
Plan: exempt: bug fix with a failing-first test and a Windows runner repro
Plan check: exempt bug fix

Refs GST-3483

{
  "schema_version": 1,
  "pr": 4845,
  "head": "7ddeb754abc86a0064df8c2b0e20e30f70cfa16b",
  "version": "1.104.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1723,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 45847831096,
      "attempt": 1,
      "tree": "ab105faf9a0b1cc46543050f3086b54e0a952223"
    }
  ],
  "calls": 20,
  "session_kind": "unattended",
  "run": "ship-4845",
  "head_tree": "ab105faf9a0b1cc46543050f3086b54e0a952223",
  "product_patch_id": "7f47efd12b486a8d101a1c034377c5164ed5d14d",
  "gstack_version": "1.104.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 20,
    "rules": "33831f8248a814fd",
    "base": "fd81a04ba7a85d20c8d2134893f45765df5ee578",
    "registry": "fd81a04ba7a85d20c8d2134893f45765df5ee578",
    "gate_scan": {
      "tagged": 0,
      "head": "7ddeb754abc86a0064df8c2b0e20e30f70cfa16b"
    },
    "reasons": [
      "runtime=20"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @ab105faf9a0b (8 checks, current for 7ddeb754abc8)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/45847831096/attempts/1",
    "windows-setup-e2e.yml/windows-setup: https://github.com/garrytan/gstack/actions/runs/45847830983/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/45847831021/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=ab105faf9a0b tests=38468 skipped=103 runs=45847831096/1 profiles=ci-reuse/free-tests heads=7ddeb754abc8 verified=2026-11-26T15:26:40.616Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      4386
    ],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CONTRIBUTING.md and the changelog fragment for the setup diff"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 4,
    "fixed": 1,
    "scope": "frozen",
    "rounds": 2,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "gate_dispositions": []
}

Open in Capy

garrytan and others added 2 commits November 26, 2026 14:37
…rophe (#4386)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits November 26, 2026 14:55
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 4ec576a into main Nov 26, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant