Skip to content

fix(acpx): preserve Windows Claude CLI paths#60689

Merged
steipete merged 2 commits intomainfrom
fix/acpx-windows-claude-spawn
Apr 4, 2026
Merged

fix(acpx): preserve Windows Claude CLI paths#60689
steipete merged 2 commits intomainfrom
fix/acpx-windows-claude-spawn

Conversation

@steipete
Copy link
Copy Markdown
Contributor

@steipete steipete commented Apr 4, 2026

Summary

Why

#51366 was auto-closed for PR queue policy before it landed, but the underlying Windows bug in #50352 is still present on main.

Notes

  • keeps the Windows-specific executable heuristic narrow to direct executables (.exe/.com)
  • preserves Unix parsing behavior for non-Windows platforms
  • does not claim support for .cmd/.bat/.ps1 wrappers via direct spawn

Verification

  • direct Node assertions for the Windows parser cases pass
  • pnpm check currently fails on unrelated extensions/voice-call/src/config-compat.ts errors already present on origin/main
  • targeted vitest runs under the extension config did not return cleanly in this workspace, so parser behavior was verified directly via Node import instead

Supersedes #51366.
Closes #50352.

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 4, 2026

PR Summary

Medium Risk
Updates command-line parsing used to spawn the ACPX target process; while scoped to Windows heuristics, mistakes could prevent Claude sessions from launching or mis-handle arguments on Windows.

Overview
Fixes ACPX mcp-proxy command parsing on Windows by preserving backslashes and correctly handling unquoted absolute .exe/.com paths (including paths with spaces) before spawning the child process.

Refactors parsing into reusable helpers, adds a narrow Windows executable-path fast path, and gates runtime execution behind an isMainModule check so the parser can be imported for tests. Adds regression tests covering quoted/unquoted Windows executable paths and Windows path-valued arguments, and updates the changelog entry for the fix.

Reviewed by Cursor Bugbot for commit 1f520f2. Bugbot is set up for automated code reviews on this repo. Configure here.

@steipete steipete force-pushed the fix/acpx-windows-claude-spawn branch from f2cd223 to 1f520f2 Compare April 4, 2026 05:10
@steipete steipete merged commit db177ab into main Apr 4, 2026
@steipete steipete deleted the fix/acpx-windows-claude-spawn branch April 4, 2026 05:10
@steipete
Copy link
Copy Markdown
Contributor Author

steipete commented Apr 4, 2026

Landed via temp rebase onto main.

  • Gate: direct Node parser assertions; pnpm check reached unrelated pre-existing extensions/voice-call/src/config-compat.ts errors on origin/main; pnpm build advanced through the full build pipeline in this workspace but its shell wrapper did not return cleanly
  • Land commit: 1f520f2
  • Merge commit: db177ab

Thanks @steipete!

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 4, 2026

Greptile Summary

This PR fixes a real Windows bug where splitCommandLine treated \ as a universal escape character, silently dropping backslashes from Windows paths (e.g., C:\Users\file.exe became C:Usersfile.exe). The fix adds platform-aware backslash handling in splitCommandParts, a regex-based splitWindowsExecutableCommand to correctly extract unquoted Windows exe paths with spaces, and an isMainModule() guard that lets the .mjs file be safely imported in tests. The three new regression tests are well-targeted and the isMainModule() pattern is idiomatic ESM.

Confidence Score: 5/5

Safe 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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +8 to +9
const WINDOWS_EXECUTABLE_PATH_RE =
/^(?<command>(?:[A-Za-z]:[\\/]|\\\\[^\\/]+[\\/][^\\/]+[\\/]).*?\.(?:exe|com))(?=\s|$)(?:\s+(?<rest>.*))?$/i;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

KimGLee pushed a commit to KimGLee/openclaw that referenced this pull request Apr 4, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: acpx fails to spawn Claude CLI on Windows

1 participant