fix: use cross-spawn for Windows compatibility#57
Merged
vincentkoc merged 2 commits intoopenclaw:mainfrom Mar 9, 2026
Merged
Conversation
Replace node:child_process spawn with cross-spawn to fix agent spawning on Windows. Node.js spawn() uses CreateProcess directly which cannot resolve .cmd/.bat scripts (e.g. npx.cmd) or PATHEXT, causing all agents to fail with 'Failed to spawn agent command' on Windows. cross-spawn is a drop-in replacement that handles PATHEXT resolution, .cmd script execution, and argument escaping on Windows.
Member
|
Rebased onto current What changed:
Validation on the rebased branch:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mainafter test: harden adapter coverage across CLI and platform edge cases #69 so it only changes the agent spawn pathsrc/client.tsfromnode:child_process.spawn()tocross-spawnwhile preserving the currentbuildAgentSpawnOptions()path andwindowsHidebehaviorpnpm-lock.yamland drop the stale npm lockfile from the old diffWhy this is still needed
Windows
CreateProcessdoes not resolve.cmd/.batlaunchers likenpx.cmdthroughPATHEXT, so agent startup can still fail withspawn EINVALeven after thewindowsHidework in #69. This PR keeps the Windows compatibility fix without reintroducing stale branch state.Testing
pnpm run typecheck:tscpnpm run lintpnpm run buildpnpm run testNotes
pnpm run format:checkcurrently reports an existing formatting issue inCONTRIBUTING.mdon currentmain; this branch does not modify that file.Fixes #48