Skip to content

[Bug] OpenCode execution failed: spawn EINVAL #67

Description

@ekv88

Describe the Bug

There is a bug with missing shell config for windows

remote-opencode/src/services/serveManager.ts:157 there is a function called spawnServe() that invokes spawn() without shell param. It should be like this:

  const child = spawn(command, args, {
+   shell: process.platform === 'win32',
    cwd: projectPath,
    env,
    stdio: ["inherit", "pipe", "pipe"],
  });

Steps to Reproduce

Try running any command on Windows PC

Expected Behavior

 Prompt: Test

Test received. 
✅

Actual Behavior

 Prompt: Test
❌ OpenCode execution failed: spawn EINVAL
❌ Execution failed. Queue cleared.

Environment

  • OS: Windows 11
  • Node.js version: v25.3.0
  • remote-opencode version: 1.5.3
  • OpenCode version: 1.18.14

Conclusion

I've included a fix here for developers to introduce in a newer version. I've tested it and it works without issues when you add shell param.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions