OpenCode 2.0 Runs One Background Service for Every Client and Ships Code Mode, Background Subagents, and an Embeddable SDK
OpenCode 2.0 makes the client/server model the default: one background service shared by the TUI, web and desktop, Code Mode scripts for MCP tools, background subagents, 80-plus plugins and an embeddable SDK the launch note calls still in development, plus the opt-in upgrade path from 1.19.0.
OpenCode 2.0 has shipped, and the headline change is architectural rather than model-related. The open-source coding agent now runs by default as a single background service on your machine, and the terminal UI, web interface, desktop app and your own scripts all talk to the same central process. The release adds Code Mode scripting for MCP tools, background subagents and shell commands, a stable plugin system with more than 80 internal plugins, and an embeddable SDK. Cloudflare also announced hosting support for OpenCode 2.0 on October 12, 2026, through its Agents SDK.
What the evidence shows about the release window
Anomaly’s OpenCode 2.0 launch note describes the overhaul as shipped, but the fetched copy carries no publisher timestamp, so the window rests on corroboration. Cloudflare’s developer changelog entry is dated October 12, 2026 and gives install commands for @opencode/sdk@2 and @opencode/plugin@2: dated, publisher-hosted evidence that 2.x packages were installable that day. OpenCode’s GitHub releases page, fetched Oct. 13, still lists v1.19.0, published Oct. 11, as the latest tag, with notes saying updates are no longer automatic and pointing at opencode upgrade --major for OpenCode 2. The page lists no 2.x tag, so this article dates the 2.0 window to the launch note plus Cloudflare’s dated entry. Automater covered the runway in OpenCode 1.19.0 Ends Automatic Updates and Ships the Explicit Path to OpenCode 2.

One service behind every client
OpenCode has had a client/server model from the start, but 2.0 makes the server a single background process that starts automatically. Scripts using the @opencode/client package autodiscover the local service, which the note calls particularly useful for scheduled tasks, and opencode api commands expose the same API from the CLI. opencode pair connects the service to other applications, with native apps using this flow described as in the works.
The API was rebuilt from scratch, and the agent is aware of it: in the note’s example, OpenCode calls its own API to move a session into a new git worktree, interrupt a stuck session and close tabs. The new client package ships vanilla JavaScript and Effect clients:
import { OpenCode } from '@opencode/client'
import { Service } from '@opencode/client/service'
const endpoint = await Service.ensure()
const client = OpenCode.make({
baseUrl: endpoint.url,
headers: Service.headers(endpoint),
})
const session = await client.session.create({
location: { directory: process.cwd() },
})
await client.session.prompt({
sessionID: session.id,
text: 'Review the current changes',
})
Code Mode turns MCP tools into scripts
Code Mode builds on @opencode/codemode, a minimal JavaScript interpreter that ingests MCP servers or OpenAPI endpoints and turns them into functions the agent can call inside a script, running natively without Node.js VMs or QuickJS. Instead of one tool call per model turn, the agent writes a single script that calls a tool, maps over results and calls another tool. Every MCP server in 2.0 is opted into Code Mode by default, and the note argues you can attach a thousand of them with minimal context bloat because the agent discovers and composes tools through the interpreter instead of loading every schema into the prompt.
Background subagents and shell
Background subagents let the primary agent hand off a task and keep prompting, automatically or manually with a different model; the note’s example spawns a background fable subagent to review code while you continue. Background shell commands run the shell tool asynchronously and notify the primary agent on completion, and a hotkey moves long-running foreground work to the background.
Plugins, an embeddable SDK and a Cloudflare harness
Nearly every 2.0 feature is implemented as an internal plugin, now more than 80 of them; TUI plugins moved from experimental to stable on OpenTUI, and everything hot-reloads, so OpenCode can write a plugin for itself mid-session.
@opencode/sdk packages the same code that powers the CLI as a library, so you can strip it down into your own flavor of OpenCode on a server or in specialized environments like Durable Objects, still speaking the standard OpenCode server protocol. The note closes the SDK section with the caveat that “this one is still in development as things are shifting but you can already use it.” Read conservatively, that caveat covers the embeddable SDK itself: usable today, shifting under you.
Cloudflare’s Oct. 12 changelog entry turns that into a hosting example: an experimental OpenCodeHarness in Agents SDK 0.28.0 or later runs OpenCode inside a plain Durable Object with sessions in SQLite, while Lifecycle jobs wake interrupted work after eviction, and an agents/models/opencode provider wires it to Workers AI.
npm i agents@latest @opencode/sdk@2 @opencode/plugin@2

The upgrade path and breaking changes
Get to the latest 1.x release, then run opencode upgrade --major. The note lists three breaking changes: 1.0 plugins will not work in 2.0, the server API is completely different, and tui.json config moves to json; everything else is described as backward-compatible, and the note suggests pointing OpenCode at the upgrade doc to migrate for you.
A practical rollout plan:
- Canary the upgrade on a pinned lane first. With 1.19.0 ending automatic updates, nothing forces this migration on your schedule, which is why drift goes unnoticed on unpinned lanes. Apply the drill from Canary Every CLI Upgrade.
- Re-check plugins and configs against the stable plugin API and the moved
tui.json. - Evaluate Code Mode for MCP-heavy workflows. Single-script composition cuts model round trips; whether it cuts cost is a workload question, so measure tokens and latency per completed task before and after.
- Prototype hosted agents with the SDK. For background coding agents on a server, the Cloudflare harness is an early, experimental reference implementation, by Cloudflare’s own labeling.
Scale and context
The OpenCode repository, now anomalyco/opencode under the MIT license, shows 213.0k stars and ships two built-in agents: build for full-access work and plan for read-only exploration, plus a @general subagent. The project site claims more than 16 million developers use OpenCode every month and that it stores none of your code or context data. At that scale, making the service model the default changes what a session means: scheduled tasks, paired apps and background reviewers now share one process, one session list and one API.