Skip to content

fix(desktop): install matching V2 CLI in WSL - #41807

Open
opencode-agent[bot] wants to merge 1 commit into
v2from
wsl-v2-cli
Open

fix(desktop): install matching V2 CLI in WSL#41807
opencode-agent[bot] wants to merge 1 commit into
v2from
wsl-v2-cli

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

The V2 beta Desktop still used the production WSL bootstrap path: it passed the Electron beta release version to https://opencode.ai/install, discovered $HOME/.opencode/bin/opencode, and launched that V1 binary as the WSL server. The beta Desktop version and bundled V2 CLI version differ, so the install could not find a matching release.

This change scopes the V2 npm behavior to the beta channel:

  • beta reads the bundled V2 CLI's actual version, discovers opencode2 from WSL's Linux PATH, and installs the exact package with npm install --global @opencode-ai/cli@<version>
  • beta reuses an existing opencode2 when its version already matches and refuses to launch a mismatched CLI
  • dev and prod retain the existing curl installer, $HOME/.opencode/bin/opencode discovery, and Desktop release version matching
  • V2 CLI output in the form opencode2 v<version> is parsed correctly

The beta flow requires npm in the WSL distro. The production curl path remains unchanged for the official channel.

Checks

  • bun test src/main/wsl/servers.test.ts — 16 passed
  • bun typecheck — passed
  • full Desktop test run: 74 passed; draft-store.test.ts could not load node:sqlite in the Host's runtime

Requested by: @neriousy (Filip Hejmowski via Slack)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant