Skip to content

Windows: OpenCode agent unavailable natively (win32 list is WSL-only), and the WSL fallback fails on a docker-desktop-only WSL setup #10

Description

@cfoellmann

Problem to solve

On Windows, OpenCode cannot be selected as an agent even when a working native opencode is on PATH (installed globally via npm, so %APPDATA%\npm\opencode.cmd resolves fine from cmd/PowerShell). The agent simply does not appear in the picker, with no hint as to why.

The only Windows option is Open Code (WSL), which is a much heavier requirement than it needs to be — and it fails outright for users whose only WSL distro is Docker Desktop's utility VM.

Root cause (from app.asar)

The agent catalogue is platform-keyed, and OPENCODE is absent from the win32 list:

default: [CLAUDE, CODEX, COPILOT, ANTIGRAVITY, GEMINI, AMP, GOOSE, QWEN, AUGGIE,
          MISTRAL_VIBE, CURSOR, Q, ROVO, AIDER, OPENCODE, CRUSH, CLINE, PLANDEX, DROID, QODO]

win32:   [CLAUDE, CODEX, COPILOT, ANTIGRAVITY, GEMINI, AMP, GOOSE, QWEN, AUGGIE,
          MISTRAL_VIBE, CURSOR, Q, ROVO, AIDER, CLINE, QODO,        // native
          CLAUDE_WSL, ..., AIDER_WSL, OPENCODE_WSL, CRUSH_WSL,
          CLINE_WSL, PLANDEX_WSL, DROID_WSL, QODO_WSL]              // WSL

Consistent with that, the OPENCODE definition has no win32 entry in installCommands:

[OPENCODE]: { label: "Open Code", checkCommand: "opencode", binaryName: "opencode",
              versionFlag: "--version", isWsl: false, requiresNode: false,
              installCommands: { darwin: "curl -fsSL https://opencode.ai/install | bash",
                                 linux:  "curl -fsSL https://opencode.ai/install | bash" } }

So checkAiAgent('opencode') is never invoked on Windows and PATH is irrelevant. Note the .cmd-suffix helper for non-WSL win32 agents already exists and is applied to every other native agent, so the machinery for a native Windows check appears to be in place.

Secondary issue: the WSL fallback fails silently in the UI

With Docker Desktop installed and no other distro, docker-desktop is the default WSL distro. It has no /bin/bash and no curl, so both the install command (wsl curl -fsSL https://opencode.ai/install | bash) and checkCommandInWSL fail:

[2026-08-23 23:28:47.693] [info]  [invariant:start] agent-install:opencode-wsl { agent: 'opencode-wsl', platform: 'win32' }
[2026-08-23 23:28:51.403] [error] [invariant:fail] agent-install:opencode-wsl {
  agent: 'opencode-wsl',
  platform: 'win32',
  exitCode: 1,
  durationMs: 3706,
  stdout: '',
  stderr: '<3>WSL (11 - Relay) ERROR: CreateProcessCommon:818: execvpe(/bin/bash) failed: No such file or directory\n' +
    '/bin/sh: curl: not found\n',
  fulfillmentMs: 3711,
  timedOut: false
}

The log records this, but the UI gives no actionable message — the user just sees an agent that will not install.

Proposed solution

  1. Add OPENCODE to the win32 agent list and give it a win32 entry in installCommands (e.g. npm i -g opencode-ai, or point at the official Windows install path). OpenCode ships a working Windows binary; the existing .cmd resolution should then detect an already-installed one on PATH.
  2. Treat CRUSH, PLANDEX and DROID the same way if they also have native Windows builds — they are currently in the same WSL-only bucket.
  3. When a WSL-backed agent check/install fails because the default distro is unusable (Docker Desktop's utility VM being the common case), surface a specific message such as "Default WSL distro docker-desktop cannot run this installer — install a full distro (wsl --install -d Ubuntu) or select a different one" instead of a generic failure.

Acceptance criteria: on Windows with opencode --version working in a normal shell, "Open Code" appears in the agent picker and is detected as installed, with no WSL requirement.

Alternatives considered

  • Installing a full WSL distro alongside docker-desktop and setting it as default — works, but changes the machine-wide default distro purely to satisfy one agent, and requires maintaining a second OpenCode install/auth inside WSL.
  • Patching app.asar locally to add OPENCODE to the win32 array — effective, but overwritten by every app update.

Environment

  • DevSwarm 2.5.1 (Windows installer build)
  • Windows 11 Pro 26200
  • opencode installed globally via npm; %APPDATA%\npm\opencode.cmd present and on PATH
  • WSL: single distro docker-desktop (Version 2, default)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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