anomalyco / anomalyco/opencode
VS Code extension: spawn opencode ENOENT on Windows
@Hona is already working on this.
Since Jul 22, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When opening the OpenCode Assistant from the VS Code UI (Ctrl+P -> Open OpenCode Assistant), the panel fails to open with:
Failed to open OpenCode panel: spawn opencode ENOENT
Root Cause
In sst-dev.opencode-v2 extension (v0.1.1), dist/extension.js spawns the opencode binary using child_process.spawn without shell: true:
(0,Ve.spawn)("opencode",["serve",...],{signal:d.signal,env:{...}})
On Windows, npm installs executables as .cmd files (e.g., opencode.cmd). Without shell: true, Node.js spawn cannot resolve .cmd files, resulting in ENOENT.
Fix
Add shell: process.platform === "win32" to the spawn options:
(0,Ve.spawn)("opencode",["serve",...],{signal:d.signal,shell:process.platform==="win32",env:{...}})
Workaround
Until this is fixed upstream, users can manually patch dist/extension.js in the extension directory at ~/.vscode/extensions/sst-dev.opencode-v2-0.1.1/dist/extension.js and add shell:process.platform==="win32" to the spawn call options object, then reload VS Code.
Environment
- OS: Windows
- Extension: sst-dev.opencode-v2 v0.1.1
- opencode installed via: npm (global)
- opencode path:
C:\Users\Vinicius\AppData\Roaming\npm\opencode.cmd
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.