Agents, Workers - Run OpenCode 2.0 on Cloudflare with the Agents SDK
Cloudflare Agents SDK 0.28.0+ adds support for running OpenCode 2.0 inside Durable Objects with SQLite session persistence and Workers AI connectivity.
Why this signal matters
The Cloudflare Agents SDK (version 0.28.0 or later) now includes experimental support for OpenCode 2.0 via OpenCodeHarness . This integration allows developers to execute OpenCode inside standard Durable Objects. Sessions are maintained within SQLite, and Lifecycle jobs automatically resume interrupted tasks following an eviction event. Connectivity to Workers AI is provided via the agents/models/opencode provider using the standard AI binding. Additionally, OpenCode plugins enable extending the harness using custom tools, remote MCP (Model Context Protocol) servers, and skills.
Actionable summary
Cloudflare Agents SDK v0.28.0 introduces experimental OpenCodeHarness to run OpenCode 2.0 in Durable Objects. It includes SQLite session storage, eviction resumption via Lifecycle jobs, Workers AI integration through agents/models/opencode , and plugin support for custom tools and remote MCP servers.
- Agent usefulness
- 80/100
- Confidence
- 90%
- Canonical data
- JSON + Markdown
What builders should check
- Install Agents SDK version 0.28.0 or later alongside the OpenCode packages to use OpenCode 2.0.
- Configure Durable Objects with SQLite storage and the agents/models/opencode provider using the Workers AI binding.
- Review OpenCode's Cloudflare SDK documentation for details on the embedded host API, custom tools, and remote MCP configuration.