Skip to content

[Bug]: Title: pnpm dev fails to connect to OpenCode CLI on Linux/WSL due to "Sidecar Missing" loop, even when CLI is installed and opencode serve works. #341

@eren726290

Description

@eren726290

Summary

Description:
I am trying to run OpenWork (dev branch) on Ubuntu WSL. The application refuses to connect to the installed opencode CLI.
The app throws a "Sidecar Missing" error, tries to download/prepare the binary (which fails or is skipped on Linux), and then reports "OpenCode CLI is unavailable."

When I run opencode serve --port 8081 manually, the server starts successfully on 127.0.0.1:8081. However, there is no UI in OpenWork to simply input this URL to connect. It seems hardcoded to only look for the Sidecar binary, ignoring the OPENCODE_BIN_PATH environment variable.

Steps to reproduce

  1. Install OpenCode CLI (curl -fsSL https://opencode.ai/install | bash).
  2. Verify CLI works: opencode 1.1 . and opencode serve --port 8081 (starts successfully).
  3. Set environment variable: export OPENCODE_BIN_PATH=/home/eren7/.opencode/bin/opencode.
    4.Clone and run OpenWork:
    git clone https://github.com/different-ai/openwork.git my-openwork
    cd my-openwork
    git checkout dev
    pnpm install
    pnpm dev
    5.App starts, but status bar shows "OpenCode Engine Not Connected."
    6.Error message in App/Console: "Sidecar missing. Install the binary or set the *_BIN_PATH env var

Expected behavior

OpenWork should recognize the installed opencode CLI (via OPENCODE_BIN_PATH or system PATH) and connect to it, OR provide a manual "Connect to Server" input field in the UI so I can point it to http://127.0.0.1:8081.
Environment:

OS: Ubuntu (via WSL2) on Windows 11
Node.js: v22.x.x
OpenCode Version: 1.1.32 (Latest via curl script)
OpenWork Branch: dev

Actual behavior

Additional Context:
I tried to fix this by renaming prepare-sidecar.mjs to .bak to bypass the download script, but then the app errors saying it "Cannot find module" because it expects the file to exist. The system seems locked into expecting the Sidecar binary and does not gracefully fallback to a user-provided CLI server.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-infoMore info needed to proceed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions