v2.1.0 · released 2026-10-20

OpenCode 2.1 breaking changes: public contracts

As of 2026-10-20, OpenCode v2.1.0 makes intentional changes to public SDK, HTTP message/event, and plugin contracts; anyone building plugins, using the SDK, or integrating over HTTP has to adopt the new fields. The official changelog says stored sessions, credentials, and older session imports remain readable, and no database migration is required.

Updated 2026-10-20

Point this tool at the QCode endpoint — one key for Claude, GPT and Chinese models.

#v2.1.0#Breaking changes#SDK / HTTP / plugins#No DB migration

Four changes (one is a new feature)

native

New name for replay fields

The official changelog says provider replay data used different names on different surfaces; 2.1 reads and writes native instead.

session.compacted

Removed from public events

The transitional event is gone; update event subscriptions and schema imports to session.compaction.started and session.compaction.ended.

Credential.Key.configuration

Moved to metadata

Public credential writes must put setup-form answers in metadata; the old configuration shape is accepted only for storage and import.

x64 / ARM64

Windows persistent PTY

The same release adds persistent PTY support for Windows x64 and ARM64; TUI todo lists appear when experimental.todo is enabled.

What v2.1.0 changes

OpenCode v2.1.0 shipped on 2026-10-20. The official changelog says version 2.1 makes intentional changes to public SDK, HTTP message/event, and plugin contracts so provider replay data and compaction use consistent names and shapes, and that integrations must adopt the new fields. It also says existing stored sessions, credentials, and older session imports remain readable through compatibility decoders, with no database migration required.

What the official changelog says

The breaking changes centre on public SDK, HTTP message/event, and plugin contracts; the official changelog describes the changes group by group: provider replay, credential setup, summary compaction, provider compaction, and events. The same release adds persistent PTY on Windows and TUI todo lists, and lets plugin commands, shell calls, and other TUI requests run beyond Bun's five-minute fetch deadline without losing the connection.

Timeline

2026-10-20

OpenCode v2.1.0 ships; the official changelog lists the SDK, HTTP message/event, and plugin contract changes as breaking changes.

2026-10-20

The same release adds Windows persistent PTY on x64 and ARM64 plus TUI todo lists; todo lists require the experimental.todo option.

2026-10-20

The QCode docs' OpenCode page was verified on 2026-10-20 and now includes an OpenCode 2 section.

Confirmed vs not verified

Confirmed (checkable in the official changelog)

The official changelog states that v2.1.0 shipped on 2026-10-20, and that version 2.1 makes intentional changes to public SDK, HTTP message/event, and plugin contracts; integrations must adopt the new fields.

Unverified and not published by the vendor

The official changelog does not list a release schedule for later 2.1 versions, and it does not describe how this contract change affects any specific third-party integration.

2.1.0 vs 2.0

Against 2.0

Compared with 2.0, 2.1.0 changes field names and events in the public contracts: replay data becomes native, the session.compacted event is removed, and Credential.Key.configuration is removed in favor of metadata.

For ordinary CLI use

The official changelog's requirement is addressed to integrations; it does not say separately whether ordinary CLI use is affected.

Four places to change

① Read and write replay data through native instead of state, providerState, or resultState (text and reasoning parts, assistant and compaction messages, and lifecycle events follow the changelog table; a tool's execution state, tool.state, and UI metadata are not renamed). ② Remove session.compacted from event subscriptions and schema imports; use session.compaction.started and session.compaction.ended. ③ Put setup-form answers in metadata for public credential writes and stop sending configuration. ④ Check plugin and SDK reads of providerContext and recent: the replacement message window for provider compaction now lives in native.messages; summary compactions no longer expose recent, new ones reference the first retained message through metadata.keepID, and kept text from pre-2.1 compactions and V1 imports remains available as metadata.recent.

OpenCode on QCode

QCode's documented OpenCode setup is: the config file is ~/.config/opencode/opencode.json; Claude uses https://api.qcode.cc/claude/v1; GPT uses the openai provider and Chinese models use an OpenAI-compatible provider, both with the https://api.qcode.cc/openai/v1 baseURL. Write the key with opencode auth login or /connect; OpenCode 1 saves credentials in ~/.local/share/opencode/auth.json, while OpenCode 2 stores them in SQLite and imports the old auth.json. Enable API direct access first; it is disabled by default, and the QCode docs say to contact online support or email hi@qcode.cc to have it activated for your key. That docs page was last verified on 2026-10-20 and says the V1-format configuration is still supported in OpenCode 2. Billing is per token, with per-model rates on /models. Not ready for a monthly plan? Pay-as-you-go Packs start at $4 for a one-time quota you use within 7 to 90 days. If you already have a Personal Plan, add a booster pack when you need more quota.

Frequently asked questions

Who has to change code for the 2.1 breaking changes?

The official changelog says integrations must adopt the new fields, and lists the public SDK, HTTP message/event, and plugin contracts as the affected contracts. Anyone building plugins, using the SDK, or integrating over HTTP needs to adopt the new fields.

What changed in the replay data?

Different surfaces used different names such as state, providerState, and resultState; 2.1 reads and writes native. A tool's execution state and UI metadata are not renamed.

Can I still use session.compacted?

No. It is removed from the public event surface; use session.compaction.started and session.compaction.ended in event subscriptions and schema imports.

Does upgrading to 2.1 require a database migration?

No. The official changelog says stored sessions, credentials, and older session imports remain readable through compatibility decoders; no database migration is required.

Do ordinary CLI users need to change anything?

The official changelog's requirement is addressed to integrations and is not broken down by user type. Check your own plugins, SDK use, and event subscriptions before upgrading.

What changes when connecting OpenCode to QCode?

Follow the QCode docs: in opencode.json, set the Anthropic provider to https://api.qcode.cc/claude/v1 and the OpenAI provider to https://api.qcode.cc/openai/v1, and write the key with opencode auth login or /connect. The QCode docs' OpenCode page was verified on 2026-10-20: the V1-format configuration on it is still supported in OpenCode 2, and the docs also give a native V2 form. Billing is per token, with per-model rates on /models.

Sources

OpenCode official changelog (captured 2026-10-20, v2.1.0 entry); OpenCode official CLI docs (opencode auth login); QCode docs OpenCode page (captured 2026-10-20; page last verified 2026-10-20); QCode Pay-as-you-go page (captured 2026-10-20).

Contract changes, one by one

QCode's OpenCode setup uses opencode.json plus two base URLs; billing is per token, with per-model rates on /models.

Not sure where to start?

Try it for a week

Week Pack: $4 for $30 of quota, valid 7 days

Use it every day

Starter: $8.57/month, about half the price per $1 of quota compared with the Month Pack ($5 of quota per day)