OpenCode
Not in a release yet
This arrives with #2903.
OpenCode is an open-source coding agent; Octant drives it as a native driver. Octant needs OpenCode 2, release 2.0.22 or later. OpenCode 1 is no longer supported: update OpenCode, or use Octant's managed copy. With an older OpenCode installed, the provider shows as incompatible and nothing starts.
Set up OpenCode
- Install OpenCode, or use Octant's managed copy (see Update OpenCode).
- Sign in with OpenCode's own login in a terminal.
- Open Settings → Providers & Models and turn OpenCode on. A detected OpenCode is added switched off.
- Run Check connection and wait for Ready.
Released OpenCode 2 installs the opencode executable. opencode2 names the earlier beta build, which discovery still accepts as a fallback and shows as OpenCode 2 preview. When both names are installed, discovery prefers opencode.
To reach OpenCode's paid gateways without the CLI, add the OpenCode Go or OpenCode Zen preset as a model endpoint.
OpenCode 2
Octant lists OpenCode's providers and models from OpenCode's own catalogue and runs each turn under the thread's access mode. Some features need a newer OpenCode 2 release, and this page names the release where one does.
- Approvals. Approval requests reach you as usual, with one exception. If you saved a permission for this repository in OpenCode itself by choosing to always allow it, OpenCode applies it and Octant does not ask. Octant's own refusals still apply, and Octant never saves such a permission for you. Clear the saved permissions in OpenCode to get the prompts back.
- Questions. From 2.0.22, the agent's questions reach you as a question form in the thread. A question with several answers to pick still ends the turn. For any other kind of form, such as a sign-in, OpenCode is told that Octant cannot show it and the turn carries on. On an earlier release the agent is told no and carries on.
- OpenCode updates. A message from OpenCode that Octant does not recognise is ignored, so a new OpenCode release does not end a turn for sending something new. A permission request Octant cannot classify reaches you as an ordinary approval.
- Stop. Pressing Stop interrupts the turn as usual. If OpenCode shuts down or its process stops while a turn is running, for example because Octant is quitting, the turn is held as waiting with a note saying so instead of looking like a Stop. Check what it did before you continue. Octant never sends it again on its own.
- Sending while a turn runs. From 2.4.1, a message you send while a turn runs goes into that turn. On an earlier release it waits for the next turn.
OpenCode 2 inside a Git work tree
OpenCode 2 resolves a project inside a Git work tree by starting Git, which the Chat, Plan, and Work jail does not allow. On macOS Octant gives those launches a stand-in git that always fails, so OpenCode serves the folder without Git and every mode runs. Linux has no such stand-in, so on Linux a 2.x runtime runs turns where a shell is already allowed: Work and Code at every level except Plan. A Chat or Plan turn on Linux is refused before it starts, with the reason, and its capabilities say so for each mode. A runtime whose confined server cannot answer for a work tree is shown as Incompatible: its models are listed and no turn is offered. Octant never falls back to an unconfined session.
What works natively
| Feature | OpenCode |
|---|---|
| Reopen the thread's own session | Yes |
| Approval prompts from the runtime | Yes |
| Questions from the agent | Yes, from 2.0.22 |
| Reasoning shown | Yes |
| Token usage counted | Yes |
| File changes and diffs | 2.2.0 or newer; diffs only before that |
| Attachments sent natively | Non-text models |
| Octant tools (Browser, Computer) | macOS, on some releases |
| Change model inside a thread | Yes |
| Compact session | Yes, 2.2.0 or newer |
| Auto-review of approvals in Code | No |
Octant tools on OpenCode
Octant's tools reach OpenCode through a loopback MCP server registered for that one session. The native OpenCode adapter offers them only on macOS, and only on the OpenCode releases whose isolated configuration was verified: 2.0.22 and 2.0.27. On any other release it reports app-managed tools as unsupported, and its text and native-tool support do not imply a browser bridge. Changing the thread to Full access does not remove the isolation requirement.
With OpenCode 2.0.22 or 2.0.27 on macOS, Octant's tools are registered for each session through OpenCode's runtime MCP API and stay private to that session. Each call goes through Octant's own tool handling and approvals, as on every other runtime.
Outside Strict, a Work or Code thread on OpenCode gets Octant's tools at every level, beside whatever your own OpenCode configuration loads. Octant labels that as mixed, because the tools are no longer the only ones in the session. Under Strict below Full access, Octant's tools need one of the releases above.
Run OpenCode as itself
OpenCode runs as itself unless you turn Run … as itself off for the account or the thread. See Let a provider run as itself for the switches. OpenCode then loads:
- its skills in
.claude/skillsand.agents/skills; below Full access, only the Project's; - the MCP servers in your own OpenCode configuration, in either form OpenCode has written them. Their tools follow the thread's level. A password or token typed straight into a server's settings is left out, so give the server an environment variable (
{env:NAME}) instead; - the permission rules you wrote in OpenCode, which apply over the thread's level. A command or edit you allowed runs without asking, and without Auto's reviewer. Plan's denials always win, and a catch-all allow is ignored, because only the thread's level can lift everything. A deny you wrote always holds, at every level and at Full access too: a catch-all deny, and a deny for folders outside the Project, narrow what the agent may do exactly as they do in OpenCode itself;
- outside Strict, the skill rules you wrote in OpenCode: a skill you allowed loads without asking, and one you denied stays denied;
- in a Project you trust for OpenCode, outside Plan, the Project's own
opencode.jsonoropencode.jsoncand its.opencodeagents, commands, plugins, and tools, loaded by OpenCode as it loads them on its own. Their rules can override Octant's in that Project. Plan, Chat, and a Project you have not trusted leave them out; - its own web search and fetch. With the account turned off, OpenCode is denied both in every mode;
AGENTS.md, including your globalAGENTS.mdoutside Strict.
Your own OpenCode configuration
From OpenCode 2.4.1, OpenCode goes one step further. In a Work or Code thread outside Plan and outside Strict, with Run OpenCode as itself on, it runs on your own OpenCode configuration, cache and state, as it does in your terminal. Your agents, commands, plugins, instructions, formatters, language servers and tool servers all load, and OpenCode finds your global AGENTS.md itself.
- What Octant adds. Only the permission rules for the thread's access mode. They apply to every session of the thread, the sessions of OpenCode's own subagents included. Below Full access, a subagent session that cannot be held to the mode is stopped, and its run shows as failed.
- Updates and the model list. Whether OpenCode updates itself follows Let providers update themselves (Provider telemetry and updates). OpenCode does not download its model list there; it reads the list your own OpenCode already cached.
- Where it does not apply. OpenCode runs on a private configuration that Octant manages, with only the parts listed above, in these cases: under Strict, with Run OpenCode as itself off, in Chat and Plan, in a thread that keeps or chose a sandbox, during Check connection, and on a release older than 2.4.1.
Sessions, fork, and rewind
- Continue a session started outside Octant. An empty Work or Code thread on OpenCode lists OpenCode sessions you started outside Octant in the same folder under Continue one, so you can adopt and continue one inside Octant.
- Native fork and Code rewind. OpenCode forks onto its own session copy, and a Code rewind continues on its own session copy, leaving the source session untouched. See Session rollback.
At every level, Plan included, OpenCode reads, finds, searches, and lists files inside the Project and its extra folders without asking. .env files are refused, and so are the protected files that OpenCode and Strict names. Its other read-only tools (its task list, code search, language server, and web fetch and search) also run without asking: in Plan, and outside Strict at Ask first and Accept edits too. Under Strict those two modes ask for them. A web read still marks the thread. Edits, commands, and subagents stay refused in Plan. Below Full access OpenCode asks before it reaches a folder outside the Project and its extra folders; at Full access it reaches other folders too, as on its own.
If you remember approvals for the Project, approving one remembers it in OpenCode's own settings, as OpenCode does. The approval says so, and you clear it in OpenCode.
When OpenCode hands a task to a subagent, the subagent starts without asking at every level outside Plan, as OpenCode's own default agent starts it. It shows in the thread as a subagent run, and each edit, command or outside folder it asks for reaches you the same way as the main session's. Plan still refuses subagents, and an OpenCode rule of yours that denies task still wins.
OpenCode and Strict
OpenCode starts with your own environment, without Octant's own variables. Under Strict it gets a short fixed list instead, plus every model provider's key, because OpenCode signs in to any model provider itself. A proxy variable, an AWS profile, or a variable your OpenCode configuration reads with {env:NAME} then needs a row for OpenCode in Let through under Strict.
Outside Strict, OpenCode's sandbox and permission rules refuse only other providers' sign-ins among the protected files, so tools such as aws, kubectl and gh work as on their own. In Work and Code outside Plan, OpenCode runs with no Octant sandbox below Full access, as it does on Windows: its permission rules ask you before an edit, a command, or a folder outside the Project, as the thread's level says, and the process can read anything you can. Chat and Plan keep Octant's sandbox. Under Strict OpenCode runs in Octant's sandbox below Full access, and every protected file is closed to it.
Outside Strict, a file OpenCode changes that no approval named is recorded as a change OpenCode made, and the turn carries on. Under Strict it ends the turn.
OpenCode serves every session of an account from one process, whose rules are fixed when it starts. A session that asks for the other Strict setting than the running process has is refused, and the next start launches a fresh process.
On Windows outside Strict, OpenCode runs in Chat using OpenCode's own deny-everything Chat permission ruleset rather than Octant confinement, so its command templates and plugins run as they do in OpenCode itself. Under Strict on Windows, OpenCode Chat stays refused until Windows has an Octant sandbox.
Update OpenCode
OpenCode is not updated by a provider-owned command. Settings → Providers & Models shows the installed and available versions of Octant's managed OpenCode copy and an Update action.
- Update checks the same managed tool channel as device tools, verifies the registry integrity hash, stages the release, and keeps the previous copy if the new one does not start. A failure says why.
- Update writes only inside Octant's managed location. It never replaces an OpenCode you installed elsewhere.
- Use Octant's copy appears only after you agree. It switches this provider to the managed executable instead of overwriting your other install.