Skip to main content
Watch: I Built an AI App Without Leaving Databricks

OpenCode error

OpenCode: Connection Failed

Error message
Connection Failed

Status: WorkaroundLast verified 5 documented fixes3 sources

What it means

OpenCode Desktop could not reach its OpenCode server. Desktop runs a local server (the opencode-cli sidecar) by default, or connects to a server URL you configured. The docs cover this dialog and an app stuck on the splash screen.

Causes

  • A custom default server URL is set in the desktop app (official docs).
  • A server section (server.port or server.hostname) in opencode.json(c) (official docs).
  • OPENCODE_PORT is set in the environment, so the app tries to use that port (official docs).
  • A misbehaving plugin or corrupted cache. The docs name these as the most common causes of desktop issues.

How to fix it

  1. Fix 1.

    On the Home screen, click the server name (with the status dot) to open the Server picker. In the Default server section, click Clear.

  2. Fix 2.

    Temporarily remove the server section from opencode.json(c) and restart the app.

  3. Fix 3.

    Unset OPENCODE_PORT (or pick a free port) and restart.

    Terminal
    unset OPENCODE_PORT
  4. Fix 4.

    Disable plugins in the global config (~/.config/opencode/opencode.jsonc), then clear the cache and restart.

    JSON
    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": [],
    }
    
    rm -rf ~/.cache/opencode
  5. Fix 5.

    Last resort: quit the app and delete opencode.settings.dat (desktop default server URL), plus opencode.global.dat and opencode.workspace.*.dat, from the OpenCode Desktop app data directory.

More OpenCode errors

All 17 OpenCode errors

FAQ

What does "Connection Failed" mean in OpenCode?

OpenCode Desktop could not reach its OpenCode server. Desktop runs a local server (the opencode-cli sidecar) by default, or connects to a server URL you configured. The docs cover this dialog and an app stuck on the splash screen.

How do I fix "Connection Failed"?

There are 5 documented fixes. Start with the first: On the Home screen, click the server name (with the status dot) to open the Server picker. In the Default server section, click Clear.

Is this OpenCode error fixed?

Status: Workaround. No release removes the cause. The documented fixes work around it. Affected versions: Desktop app. Server detection and connection reliability were improved in v1.1.15 and v1.1.32.

Sources

Last verified against 3 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.