OpenCode 2.0: Architectural Overhaul for AI Agents
A major update introducing a centralized server process, advanced sub-agent orchestration, and plugin-first development.
1Centralized Server Architecture
OpenCode 2.0 transitions from a loose client/server model to a robust architecture where a single background process manages all interactions. Whether using the TUI, desktop app, or web interface, all clients now communicate with this central service. This ensures consistent state management and seamless integration for programmatic clients and scheduled tasks.
2API and Workflow Automation
The API has been completely rebuilt to support complex agentic workflows based on real-world user data. OpenCode is now self-aware, allowing it to execute internal commands like moving sessions into git worktrees or renaming tasks. This enables the agent to perform multi-step operations autonomously while maintaining context across different development sessions.
3Code Mode and Tooling
The new @opencode/codemode package introduces a minimal JavaScript interpreter, allowing models to write and execute code natively. By ingesting MCP servers or OpenAPI endpoints, the agent converts external tools into callable functions. This eliminates the need for complex Node.js VMs, enabling efficient single-round-trip execution for chained tool calls.
4Advanced Agent Orchestration
OpenCode 2.0 introduces background sub-agents and asynchronous shell commands to prevent blocking the primary agent. Users can spawn specialized sub-agents for tasks like code reviews while continuing to prompt the main model. If a process takes longer than expected, a hotkey allows users to move active tasks to the background.
5Plugin-First Development Strategy
To ensure long-term maintainability, the development team implemented nearly every 2.0 feature as an internal plugin. There are now over 80 plugins available, and TUI plugins have been promoted to stable status. This architecture guarantees that the plugin API remains well-maintained and provides a reliable foundation for future custom extensions.
6Hot-Reloading and Extensibility
The system now supports full hot-reloading, allowing OpenCode to write and deploy plugins mid-session. This capability enables the agent to adapt its own functionality dynamically without requiring a restart. Developers can leverage this to build custom tools on the fly, significantly reducing the friction between ideation and functional implementation.
7SDK for Custom Environments
With the new @opencode/sdk package, the core logic is now available as a library. This allows developers to create custom versions of OpenCode tailored for specialized environments like Durable Objects. Since it uses the standard OpenCode server protocol, these custom flavors remain compatible with existing clients and tooling ecosystems.
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 significant, the team has maintained backward compatibility. Developers are encouraged to point the agent at the documentation to assist with automated migration of existing configurations.