OpenCode 2.0 represents a significant architectural overhaul of the coding agent framework, moving from a standard client/server model to a persistent background process. In this new version, the server runs as a single background process on the user's machine, allowing various interfaces—including Terminal User Interfaces (TUIs), web interfaces, and desktop applications—to communicate with the same central process. This change is designed to improve reliability for scheduled tasks and programmatic scripts, as the `@opencode/client` package now automatically discovers the local service. The update also includes a complete rewrite of the API to better accommodate the evolving requirements of AI agents, including self-awareness features where the agent can recognize and interact with its own API to perform tasks like moving sessions into specific git worktrees.

This image serves as a primary visual for the OpenCode 2.0 architectural overhaul, which shifts the framework toward a persistent background service model.
One of the most distinct technical shifts in 2.0 is the introduction of a minimal JavaScript interpreter via the `@opencode/codemode` package. Unlike previous iterations that might have relied on complex Node.js Virtual Machines or embedded solutions like QuickJS, this new mode allows agents to ingest Model Context Protocol (MCP) servers or OpenAPI endpoints and convert them into functions. This enables the agent to write and execute scripts natively to perform complex, multi-step operations—such as mapping over results from one tool to feed into another—in a single round trip. By opting all MCP servers into 'code mode' by default, the system aims to reduce context bloat, allowing agents to compose thousands of tools with minimal overhead.
To improve the user experience during long-running operations, OpenCode 2.0 introduces background sub-agents and asynchronous shell commands. This allows a primary agent to delegate tasks, such as code reviews or build processes, to a sub-agent while remaining available to the user for further prompting. Users can also move foreground tasks to the background using a hotkey if a command takes longer than expected. Furthermore, the framework has adopted an 'everything is a plugin' philosophy, with over 80 internal features now implemented as plugins. This architecture supports hot-reloading, meaning an agent can theoretically write and deploy a plugin for itself during an active session and utilize it immediately without restarting the service. While the update includes breaking changes for 1.0 plugins and the server API, it provides a migration path for existing configurations to support these more advanced orchestration capabilities.