fix(acpx): preserve Windows Claude CLI paths#60689
Conversation
PR SummaryMedium Risk Overview Refactors parsing into reusable helpers, adds a narrow Windows executable-path fast path, and gates runtime execution behind an Reviewed by Cursor Bugbot for commit 1f520f2. Bugbot is set up for automated code reviews on this repo. Configure here. |
f2cd223 to
1f520f2
Compare
|
Landed via temp rebase onto main.
Thanks @steipete! |
Greptile SummaryThis PR fixes a real Windows bug where Confidence Score: 5/5Safe to merge — the fix is narrow and well-tested, Unix behavior is unchanged, and the Windows path logic is correctly guarded by platform checks. All findings are P2 or lower. The core logic (regex, win32 backslash semantics, isMainModule guard) is correct and matches the intended behavior. The three new tests directly reproduce the failure mode from #50352. No regressions to existing Unix parsing paths are introduced. No files require special attention. Reviews (1): Last reviewed commit: "docs: add changelog for #60689" | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0c8e234d7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const WINDOWS_EXECUTABLE_PATH_RE = | ||
| /^(?<command>(?:[A-Za-z]:[\\/]|\\\\[^\\/]+[\\/][^\\/]+[\\/]).*?\.(?:exe|com))(?=\s|$)(?:\s+(?<rest>.*))?$/i; |
There was a problem hiding this comment.
Restrict Windows executable heuristic to real command token
The new WINDOWS_EXECUTABLE_PATH_RE can consume into arguments because it matches the first .exe/.com anywhere after an absolute-path prefix, not just the executable token. On Windows inputs like C:/tools/node C:/work/agent.exe --stdio (or args ending in .com), splitWindowsExecutableCommand returns command: "C:/tools/node C:/work/agent.exe", so spawn tries to execute a non-existent path and the proxy fails. This regression affects valid custom targetCommand strings that previously parsed correctly when they used forward-slash paths.
Useful? React with 👍 / 👎.
Summary
.exepaths with spaces before spawningWhy
#51366was auto-closed for PR queue policy before it landed, but the underlying Windows bug in#50352is still present onmain.Notes
.exe/.com).cmd/.bat/.ps1wrappers via direct spawnVerification
pnpm checkcurrently fails on unrelatedextensions/voice-call/src/config-compat.tserrors already present onorigin/mainvitestruns under the extension config did not return cleanly in this workspace, so parser behavior was verified directly via Node import insteadSupersedes #51366.
Closes #50352.