Skip to content

windows: Desktop v2 and legacy winget v1 conflict on shared database #59727

Closed as duplicate

Description

@phanex

Description

There is a conflict on Windows between OpenCode Desktop (v2.x) and the official winget package:

  1. Desktop (v2.x) places opencode-cli.exe in %LOCALAPPDATA%\Programs\@opencodedesktop\resources\, but does not register it in PATH or create an opencode.exe alias.
  2. Users looking for CLI access run winget install SST.opencode.
  3. However, on GitHub Releases, the Latest release badge is still attached to the legacy v1.19.4 release instead of v2.x. As a result, WinGet bots package and serve v1.19.x.
  4. Both versions share the database at ~/.local/share/opencode/opencode.db.
  5. Running the v1 CLI against a v2 database immediately fails with:
    Database is not empty and has no session table
    and spawns orphaned legacy background servers (ports 4555/4556) that leak memory.

Expected:

  • OpenCode Desktop on Windows should expose its CLI to PATH (e.g. by creating an opencode.exe alias/hardlink in %LOCALAPPDATA%\Microsoft\WindowsApps or adding resources to User PATH).
  • The Latest release tag on GitHub Releases should point to the current v2 release so WinGet manifests track v2 instead of legacy v1.19.x.

Workaround for now:
mklink /H "%LOCALAPPDATA%\Microsoft\WindowsApps\opencode.exe" "%LOCALAPPDATA%\Programs\@opencodedesktop\resources\opencode-cli.exe"

Plugins

None

OpenCode version

2.1.4 (Desktop) vs 1.19.4 (winget)

Steps to reproduce

  1. Install OpenCode Desktop on Windows from opencode.ai (installs v2.x) and create a session.
  2. Notice opencode is not recognized in terminal.
  3. Run winget install SST.opencode (installs legacy v1.19.x because GitHub Latest points to v1.19.4).
  4. Run opencode session list in terminal.
  5. Fails with "Database is not empty and has no session table" due to v1/v2 schema mismatch.

Operating System

Windows 10 / 11 x64

Terminal

PowerShell / CMD / Windows Terminal

Activity

  1. opencodejr commented on Oct 27, 2026

    @opencodejr

    Thanks for the detailed write-up, @phanex! I think this is a duplicate of #53221. The error you see happens when a v1 build (here the winget SST.opencode 1.19.x CLI) opens the shared ~/.local/share/opencode/opencode.db after OpenCode v2 has migrated it. #55731 reported this same Windows setup (winget SST.opencode plus Desktop v2) and was closed as a duplicate of #53221.

    The other points in your report are also already tracked. Here are the possible duplicates and related issues, ordered from most to least likely:

    Until then, use a v2 CLI against that data directory, for example with your hard link to the Desktop's opencode-cli.exe, and uninstall the v1 SST.opencode package so that opencode on PATH doesn't run v1.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr

    Closing this as a duplicate of #53221, since there was no reply in the past day. That issue covers the same Database is not empty and has no session table error, which happens when a v1 build (here the winget SST.opencode 1.19.x CLI) opens the shared opencode.db after v2 has migrated it. Please follow #53221 for that problem. These issues cover the rest of your report:

    In the meantime, keep using a v2 CLI with that data directory, for example through your hard link to the Desktop's opencode-cli.exe, and uninstall the v1 SST.opencode package.

    If your problem turns out to be different, reply here and we can reopen it.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions