OpenCode 2.0: Architecture Overhaul and Agentic Workflow Improvements
A major update introducing background processes, native sub-agents, and a robust plugin-first architecture.
1Unified Client-Server Architecture
OpenCode 2.0 transitions from a sporadic client-server model to a persistent background process on your machine. Whether using the TUI, desktop app, or web interface, all interactions now communicate with this single central process. This architectural shift ensures consistent state management and seamless discovery for programmatic clients and scheduled automation tasks.
2API and Workflow Redesign
The API has been completely rebuilt from scratch to support complex agentic behaviors observed in millions of daily sessions. It now natively handles session management, such as moving work into git worktrees or renaming contexts. This allows the agent to interact with its own API to perform housekeeping tasks like closing tabs.
3Code Mode and Tooling
The new @opencode/codemode package introduces a minimal JavaScript interpreter, allowing agents to write and execute scripts natively. By ingesting MCP servers or OpenAPI endpoints, the agent can chain multiple tool calls in a single round trip. This capability significantly reduces complexity compared to traditional Node.js virtual machine implementations or embedded solutions.
4Background Sub-Agent Orchestration
OpenCode 2.0 introduces background sub-agents, enabling the primary agent to delegate tasks while remaining responsive to user prompts. Users can trigger these asynchronously or manually, even utilizing different models for specific sub-tasks. Additionally, long-running shell commands can now be moved to the background, ensuring the primary interface remains unblocked during execution.
5Plugin-First Development Strategy
To ensure long-term maintainability, the team implemented nearly every feature in version 2.0 as an internal plugin. With over 80 plugins now available, the system guarantees that the Plugin API remains robust and well-supported. Furthermore, TUI plugins have been promoted to stable, allowing developers to build custom interfaces powered by OpenTUI.
6Hot-Reloading and Extensibility
The system now supports comprehensive hot-reloading, enabling the agent to write and deploy its own plugins mid-session. This self-referential capability allows for rapid iteration and customization without restarting the environment. Developers can instruct the agent to build specific plugins, or refer to the documentation for manual implementation of custom logic.
7SDK and Library Integration
OpenCode 2.0 is now available as a library via the @opencode/sdk package, sharing the same core code as the CLI. This allows developers to strip down the agent for specialized environments like Durable Objects. By speaking the standard server protocol, these custom instances remain compatible with all existing OpenCode clients.
8Upgrade Path and Compatibility
Users can upgrade the CLI by running the command opencode upgrade --major after ensuring they are on the latest 1.x release. While many changes are backwards compatible, the team recommends pointing the agent at the documentation to assist with migration. Desktop users can download the latest version directly from the official source.