[Bug] Voice plugin cannot run .cmd or .bat helper commands on Windows (spawn EINVAL)
Summary
The voice plugin starts REC_CMD, PLAY_CMD, WHISPER_CMD and PIPER_CMD with child_process.spawn and no shell. Node 22 refuses to spawn .cmd and .bat files that way, so helpers installed as shims fail.
Steps to reproduce
- On Windows with Node 22, create
ok.cmdcontaining@echo offandexit /b 0. - Set
REC_CMDto its full path. - Call
recordAudio('test.wav')from the voice plugin. Or runpnpm run test:ava plugins/voice/src/index.spec.ts.
Expected behaviour
The helper runs and recordAudio resolves.
Actual behaviour
Error { code: 'EINVAL', syscall: 'spawn', message: 'spawn EINVAL' }
15 tests in plugins/voice/src/index.spec.ts fail this way. They create their own .cmd mocks, so Windows support was intended. A plain Node spawn('ok.cmd', ['x']) throws the same error.
Environment
Windows 11, Node v22.22.3, Nanocoder 1.31.0 (main at 948a4e74)
Suggested fix
- Use
cross-spawn(already a dependency of the main app and used for LSP after #1690 and #1701) inplugins/voice/src/microphone.ts:37,speaker.ts:36,stt.ts:57,tts.ts:48,dependencies.ts:70and:232, andvad-worker.ts:63. - Or pass
shell: trueonly when the command ends in.cmdor.bat.
hi @addyCooks can you assign this to me
Hi @Vishesh-Verma-07 , thanks for your interest in this issue! I've already assigned you a few other issues, so please finish those first. Once they are done, let me know here and I'll assign this one to you too. If you get stuck on any of them, feel free to ask questions in the issue or PR.
Happy to help!
Yeah, sure. I'll let you know once I've made the PRs for the previous ones.
hey @addyCooks done with my previous issues now can you assign this to me