Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ymat19
Copy link
Contributor

@ymat19 ymat19 commented Jan 25, 2026

Summary

The previous check used includes("win") which incorrectly matched "darwin" (macOS) because it contains "win". This caused cmd.exe to be used on macOS instead of /bin/sh, resulting in spawn cmd.exe ENOENT errors.

Changes

  • Changed normalized.includes("win") to normalized === "win32"

Why win32 is safe

Per Node.js documentation, process.platform returns "win32" on Windows regardless of 32-bit or 64-bit architecture. This is a stable API.

Testing

  • Tested with local Clawdbot instance on macOS (darwin)
  • Verified /bin/sh is now correctly used instead of cmd.exe
  • Ran npm run lint - no warnings or errors
  • Windows testing not performed (no Windows environment available)

AI Disclosure

  • AI-assisted: Yes (Claude)
  • Degree of testing: Tested on macOS, not tested on Windows
  • I understand what the code does: The change ensures only Windows (win32) uses cmd.exe, while all other platforms use /bin/sh

The previous check used includes("win") which incorrectly matched
"darwin" (macOS) because it contains "win". This caused cmd.exe to be
used on macOS instead of /bin/sh.
@ymat19 ymat19 marked this pull request as ready for review January 25, 2026 09:48
@steipete steipete self-assigned this Jan 25, 2026
steipete added a commit that referenced this pull request Jan 25, 2026
@steipete
Copy link
Contributor

Landed via rebase onto main.

  • Rebases PR onto current main.
  • Adjusts node shell platform detection to treat Windows labels as Windows, adds unit coverage, and updates changelog.

Commits:

Thanks @ymat19!

@steipete steipete closed this Jan 25, 2026
steipete added a commit to orlyjamie/clawdbot that referenced this pull request Jan 25, 2026
mcinteerj pushed a commit to mcinteerj/moltbot that referenced this pull request Jan 25, 2026
rodrigouroz pushed a commit to rodrigouroz/moltbot that referenced this pull request Jan 26, 2026
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.

2 participants