Skip to content

VS Code extension: spawn opencode ENOENT on Windows #38376

Closed as not planned
Closed as not planned

Description

@ViniciusBloise

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

Activity

  1. siddhanttiwari19 commented on Jul 22, 2026

    @siddhanttiwari19

    Hi @ViniciusBloise, thanks for the clear root-cause writeup — this is a solid catch and an easy, well-scoped fix.

    I'd like to work on this. Since the issue is precisely diagnosed already, my plan is straightforward:

    Add shell: process.platform === "win32" to the spawn("opencode", ...) call options in dist/extension.js (or the source it's built from, if dist/ is generated rather than committed)
    Confirm this doesn't change behavior on macOS/Linux, where shell: false already resolves opencode correctly — the flag should only kick in on Windows where .cmd shims need shell resolution
    Add a regression test if there's an existing test harness around the spawn call, or at minimum verify manually that Open OpenCode Assistant succeeds on Windows with a global npm install afterward

    Could you assign this to me?

  2. github-actions commented on Sep 21, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  3. TdBSnip3r commented on Oct 6, 2026

    @TdBSnip3r

    Hi team! Is there any update on this?

    This issue is currently blocking our workflow / affecting us daily as well. If a fix or PR is already in progress, I’d be happy to test it out and provide feedback!

    Thanks for all your hard work on OpenCode!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions