Docs

OpenCode

How LinkCode runs OpenCode, including the CLI install prerequisite, model configuration, and why stopped threads can't be resumed.

OpenCode is the one agent LinkCode does not bundle. Everything else about it — signing in, models, permissions — is also handled differently from the other three agents.

Install

The opencode CLI must be on the PATH of the shell that starts the host (the LinkCode daemon). Install it using OpenCode's own instructions, then confirm opencode resolves on the command line before starting the host.

If LinkCode can't find opencode on PATH when a thread starts, that thread fails immediately with an error like opencode: failed to start server (...). There's no in-app hint pointing you back to this page today — if you see that error, this is the prerequisite you're missing.

Sign in and model

LinkCode has no sign-in flow of its own for OpenCode. If you set both an API key and a default model in Settings → Agents, LinkCode only applies the key when the model is given as provider/model-id (for example anthropic/claude-sonnet-5) — the part before the slash tells LinkCode which provider to inject the key for.

Give the model without a provider/ prefix, or leave it unset, and your configured API key is silently not applied — OpenCode falls back entirely to its own native sign-in and configuration. There is no curated model list; the model field is always free text.

Approval

OpenCode threads run unattended in LinkCode: there is no approval policy and no permission prompts for tool calls. See the agent comparison for how this compares to the other three agents.

Thread history

A stopped OpenCode thread cannot be resumed. Once a thread has sent at least one prompt, trying to resume it fails with opencode: history resume is not supported — start a new thread instead.

The connection between LinkCode and OpenCode's server is also a single, long-lived event stream. If that stream drops mid-thread, the thread ends; LinkCode does not reconnect and continue it automatically.

On this page