deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (native)

OpenCode 2.0 adds shared background service, Code Mode scripting and stable plugins

OpenCode 2.0 reworks the open-source coding agent around a shared background service, a rewritten API, a JavaScript-based Code Mode for MCP tools, background subagents and a stable plugin system.

OpenCode 2.0 adds shared background service, Code Mode scripting and stable plugins

OpenCode, the open-source coding agent, has shipped version 2.0, a wide-ranging rework of its architecture, API, plugin system and execution model. According to the release notes currently on the Hacker News front page, the redesign draws on feedback from what the team describes as millions of daily users.

One service behind every interface

OpenCode has used a client/server model from the start, but the notes concede that mainly power users took advantage of it. In 2.0 the server launches automatically as a single background process, and the terminal UI, the web interface and the desktop app all talk to that one process.

Scripts built on the new @opencode/client package autodiscover the local service, which the team highlights as handy for scheduled tasks, and the CLI exposes opencode api commands for direct calls. Running /pair or opencode pair exposes the service to other hosts and applications; native apps built on that flow are said to be in the works.

An API rebuilt from scratch

The previous API, the team writes, accreted over time as everyone collectively worked out what agents should actually be, and it had become a liability. Version 2.0 replaces it with an interface designed around the awkward edge cases observed across the user base.

More notably, OpenCode is aware of its own API and will call it: one cited example is relocating the current session into a git worktree when new work begins. A new @opencode/client package ships with clients for both vanilla JavaScript and Effect.

Code Mode turns tools into functions

Code Mode is the headline feature. The @opencode/codemode package contains a small JavaScript interpreter that ingests MCP servers or OpenAPI endpoints and exposes them as functions the agent can call from a script. Scripts run natively, without Node.js VMs or an embedded engine such as QuickJS.

The payoff is round trips: rather than invoking tools one at a time, the agent writes a script that calls one tool, transforms the output and calls another. Every MCP server is enrolled in Code Mode by default, and the team claims a thousand servers can be installed with little added context overhead, because the agent composes them in code instead of enumerating them in the prompt.

Background subagents and shells

The newest models are strong orchestrators, the notes argue, and 2.0 gives them room to act like it. Background subagents let the primary agent delegate work and carry on; this can happen automatically or on request, and the subagent can run a different model than the main one. Shell commands can also run asynchronously, with the agent notified when they finish. If a foreground command or subagent takes too long, a hotkey pushes it to the background.

Plugins become load-bearing

OpenCode 1.x had a plugin system, but the team admits it was neglected. To correct that, nearly every 2.0 feature was implemented as an internal plugin — there are now more than 80 — which keeps the public Plugin API exercised and maintained. TUI plugins have graduated from experimental to stable and, built on OpenTUI, can render almost any interface. Everything hot-reloads, so the agent can write a plugin for itself mid-session and start using it immediately.

An SDK for custom builds

The @opencode/sdk package turns OpenCode into a library built on the same codebase as the CLI. Trimmed-down custom variants can run on a server or in environments such as Durable Objects, reachable from any OpenCode client because they speak the standard server protocol. An optional Effect-based API is included but still in development.

Upgrading and breaking changes

CLI users should first update to the latest 1.x release, then run opencode upgrade --major; the desktop app updates via download. Three breaking changes stand out: 1.0 plugins will not run in 2.0, the server API is completely different, and tui. configuration moves into the general JSON config. The team suggests pointing OpenCode at the migration document and letting it carry out the conversion.

Why it matters

Most coding agents are applications; OpenCode 2.0 positions itself as a service and a platform. A shared background process, an API the agent itself uses, an SDK and a pairable protocol make it embeddable in ways a monolithic CLI is not. Code Mode attacks two of the sharpest pains in current agent practice — tool-call latency and context bloat from large MCP catalogs — by letting models do what they do best, writing code, instead of looping through tool calls one by one. Plugin-first internals and hot reloading point the same way, toward an agent that extends itself while it works. The cost is a hard migration: plugin and server API incompatibilities will bite existing setups.

  • #open-source
  • #coding-agent
  • #developer-tools
  • #ai-agents
  • #mcp

Related posts