Commit 1bbf00c
committed
fix(windows): hasAuth cross-platform + findClaudePath prefer .cmd/.exe
Two more production fixes surfaced during the full native-Windows E2E
(not the deterministic-only smoke): the previous pass verified unit
tests + deterministic setup but hadn't installed Claude Code natively
on Windows to run a real LLM-backed setup.
1. src/cli.ts hasAuth(): split PATH with a hardcoded ':' separator
(POSIX-only — Windows uses ';') and looked for a bare-name file
'claude' (Windows executables need .exe/.cmd/.bat/.ps1 suffix).
Result: hasAuth returned false on Windows even when Claude Code
was installed via `npm install -g` and on PATH, bailing out of
setup with "No Claude authentication found." Delegated to the
existing findClaudePath() helper which already handles PATH.delimiter,
PATHEXT suffixes, and standard-install locations cross-platform —
no divergence between what hasAuth sees and what the scanners
will try to use.
2. src/utils/agent-options.ts findClaudePath(): `where.exe claude` on
Windows returns EVERY match from PATH including the bare-name
shebang file that npm ships for Unix compatibility (e.g.
C:\node\claude with no extension alongside C:\node\claude.cmd).
Our prior code took the first line — the bare-name file — which
the Claude Agent SDK / cmd.exe cannot execute. Now we filter the
where.exe output to prefer entries ending in .cmd/.exe/.bat/.ps1
on Windows, falling back to the first entry if nothing matches.
POSIX behavior unchanged.
Linux: npm test 511/511 pass; full E2E on a real repo clone
(tmp/axme-e2e, 79 .ts files) — setup LLM-scanned 28 decisions + 13
presets = 41 total, $0.92, 203s; Claude session with Bash + Read
tools, SessionEnd hook fired, detached audit worker ran to
audit_complete. No regression.1 parent 8297b95 commit 1bbf00c
2 files changed
Lines changed: 21 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
147 | 152 | | |
148 | 153 | | |
149 | 154 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| |||
0 commit comments