Skip to content

fix(websearch): run .bat custom scripts via shell on Windows (#190) - #274

Open
innocarpe wants to merge 1 commit into
lessweb:mainfrom
innocarpe:fix/190-windows-bat
Open

fix(websearch): run .bat custom scripts via shell on Windows (#190)#274
innocarpe wants to merge 1 commit into
lessweb:mainfrom
innocarpe:fix/190-windows-bat

Conversation

@innocarpe

Copy link
Copy Markdown

Summary

  • Custom webSearchTool scripts pointing at .bat files now run on Windows instead of failing with spawn EINVAL.

Why

Node.js v20+ removed the automatic cmd.exe routing for .bat/.cmd files, so child_process.spawn of a .bat path throws EINVAL on Windows. This broke the configured web-search script path for Windows users.

Changes

  • packages/core/src/tools/web-search-handler.ts: pass shell: process.platform === "win32" to spawn so .bat scripts execute through cmd.exe on Windows only (POSIX behavior unchanged).
  • packages/core/src/tests/web-search-handler.test.ts: Windows-only test running a .bat script (skipped elsewhere).

Validation

  • npm run typecheck
  • npm test — existing web-search tests still pass; new .bat test runs on Windows ✅

Closes #190

…#190)

Node.js v20+ removed the automatic cmd.exe routing for .bat/.cmd files, causing spawn EINVAL for webSearchTool scripts pointing at .bat files. Enable shell on win32 only.

(cherry picked from commit 3fe982c5f0a169e07464810e7befeef26d2f90b6)
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.

[Windows] webSearchTool 配置自定义脚本时 spawn 失败 (Node.js v24 已移除 .bat 自动路由)

1 participant