You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose an API version in /api/info + publish a v1→v2 migration path (routes, prompt payload, events, sessions) #55705
GET /api/info returns {version, pid, urls, paths, capabilities} — nothing that identifies the HTTP API generation. Since 2.0 the v1 routes are gone entirely (/global/health, /session/..., /question, /pty/...), but from the outside a 2.x server still just says "version": "2.0.29", so clients that gate on semver (>= 1.14.19) happily connect and then fail on every call.
With that, a client can detect the mismatch in one request and show a real error ("this build needs opencode 1.x") instead of failing later with an HTML parse error or a missing message.updated event.
Two related asks that would help third-party drivers:
A migration table for the v1 → v2 route/contract changes. The prompt payload changed from {parts: [...]} to {text} and the SSE event model was replaced (message.updated / message.part.updated / session.idle → session.inbox.* / session.execution.* / session.step.*). Right now the only spec is the source diff.
A migration path for 1.x sessions. 2.x writes to a separate session_v2 / session_message / session_inbox set of tables in the same opencode.db, so a 1.x client gets 404 for every session created by a 2.x server (and vice versa) — threads look lost even though both versions share one database. A one-way opencode migrate --to 2 would avoid a support wave of "my history disappeared".
Context: found while wiring the T3 Code desktop app (0.0.45, bundles @opencode-ai/sdk@1.15.13) to a 2.x server.
Thanks for the detailed write-up! To restate the request: add an API-generation marker to GET /api/info (e.g. apiVersion: 2) so clients built against the 1.x SDK can detect a 2.x server straight away, publish a v1 → v2 mapping of routes, prompt payloads and SSE events, and provide a clear migration path for 1.x sessions. Maintainers will consider it.
Some things that already exist and may help in the meantime:
The V1 migration guide has a "Server API and clients" section. It points to @opencode/client and the generated API reference, but you're right that it has no route-by-route or event-by-event mapping.
2.x already includes an importer that copies 1.x sessions into the v2 tables. It doesn't make sessions created by 2.x visible to a 1.x client. These open issues track gaps in that import:
Activity
opencode-agent commentedon Oct 15, 2026
Thanks for the detailed write-up! To restate the request: add an API-generation marker to
GET /api/info(e.g.apiVersion: 2) so clients built against the 1.x SDK can detect a 2.x server straight away, publish a v1 → v2 mapping of routes, prompt payloads and SSE events, and provide a clear migration path for 1.x sessions. Maintainers will consider it.Some things that already exist and may help in the meantime:
@opencode/clientand the generated API reference, but you're right that it has no route-by-route or event-by-event mapping.Other related issues:
/apiroutes return 200 HTML instead of 404, which causes the same "fails later with an HTML parse error" symptom you describe