Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion external/opencode
Submodule opencode updated 1858 files
9 changes: 7 additions & 2 deletions spec/SNAPSHOT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenAPI Snapshot

Date: 2026-09-07
Date: 2026-09-08

`openapi.json` is the accepted snapshot of the upstream opencode OpenAPI 3.1 document — the v2
protocol surface (ADR-0005). The SDK is built against this snapshot, never against a live
Expand All @@ -14,9 +14,14 @@ their hash-pinned manifests.
|---|---|
| Upstream file | `packages/protocol/openapi.json` |
| Upstream branch | `v2` (active successor line; no release tags yet) |
| Commit | `89f1943d2da6af6087fed06a60c57bd0f384ab9f` |
| Commit | `f9bc2233ddcc11503a0804b317401bc221ef0e7f` |
| Upstream product channel | `opencode2` — npm `@opencode-ai/cli@next` (pre-release) |

At this pin the CLI package is named `@opencode/cli`, following upstream's rename of its workspace
scope from `@opencode-ai`. The published channel has not moved with it: npm's `@opencode` scope
carries a reserved placeholder on `latest`, so `@opencode-ai/cli@next` stays the installable
pre-release and is what the row above names.

Platform evidence for the v2 line: internal research, 2026-08-16, "The opencode v2 platform:
branch, surface, architecture, distribution".

Expand Down
88 changes: 88 additions & 0 deletions spec/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -14377,6 +14377,9 @@
"Config.ModelEncoded": {
"type": "object",
"properties": {
"compaction": {
"$ref": "#/components/schemas/Provider.Compaction"
},
"modelID": {
"type": "string"
},
Expand Down Expand Up @@ -14482,6 +14485,9 @@
"Config.ProviderEncoded": {
"type": "object",
"properties": {
"compaction": {
"$ref": "#/components/schemas/Provider.Compaction"
},
"canonical": {
"type": "string"
},
Expand Down Expand Up @@ -16463,6 +16469,9 @@
"package": {
"type": "string"
},
"compaction": {
"$ref": "#/components/schemas/Provider.Compaction"
},
"settings": {
"type": "object"
},
Expand Down Expand Up @@ -17396,6 +17405,36 @@
"required": ["id"],
"additionalProperties": false
},
"Provider.Compaction": {
"anyOf": [
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": ["local"]
}
},
"required": ["mode"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": ["provider"]
},
"threshold": {
"type": "integer",
"exclusiveMinimum": 0
}
},
"required": ["mode"],
"additionalProperties": false
}
]
},
"Provider.Info": {
"type": "object",
"properties": {
Expand All @@ -17418,6 +17457,9 @@
"package": {
"type": "string"
},
"compaction": {
"$ref": "#/components/schemas/Provider.Compaction"
},
"settings": {
"type": "object"
},
Expand Down Expand Up @@ -18709,6 +18751,9 @@
},
"recent": {
"type": "string"
},
"providerContext": {
"$ref": "#/components/schemas/Session.ProviderContext"
}
},
"required": ["type", "id", "time", "status", "reason", "summary", "recent"],
Expand Down Expand Up @@ -19371,6 +19416,46 @@
"Session.Metadata": {
"type": "object"
},
"Session.ProviderContext": {
"type": "object",
"properties": {
"version": {
"type": "number",
"enum": [1]
},
"provenance": {
"$ref": "#/components/schemas/Session.ProviderContext.Provenance"
},
"messages": {}
},
"required": ["version", "provenance", "messages"],
"additionalProperties": false
},
"Session.ProviderContext.Provenance": {
"type": "object",
"properties": {
"providerID": {
"type": "string"
},
"provider": {
"type": "string"
},
"modelID": {
"type": "string"
},
"route": {
"type": "string"
},
"protocol": {
"type": "string"
},
"endpoint": {
"type": "string"
}
},
"required": ["providerID", "provider", "modelID", "route", "protocol", "endpoint"],
"additionalProperties": false
},
"Session.Revert": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -21933,6 +22018,9 @@
"providerState": {
"$ref": "#/components/schemas/Session.Message.ProviderState_5"
},
"providerContext": {
"$ref": "#/components/schemas/Session.ProviderContext"
},
"text": {
"type": "string"
},
Expand Down
2 changes: 1 addition & 1 deletion spec/patches/001-restore-sse-payloads.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"patch": "001-restore-sse-payloads.patch",
"sha256": "aecd1686bc9b5e70a619e579fd87c6659fa299df53bb7b1fec17d7e8802cef10",
"sha256": "99e02b5452347d2dc87f108f2f46c54e471958728c5d96db584f72968babb544",
"upstreamReport": "https://github.com/anomalyco/opencode/pull/45182",
"order": 1,
"touches": [
Expand Down
10 changes: 5 additions & 5 deletions spec/patches/001-restore-sse-payloads.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/packages/protocol/script/generate-openapi.ts b/packages/protocol/script/generate-openapi.ts
index 61c4ddecd1..799ce56e43 100644
index 61c4dde..799ce56 100644
--- a/packages/protocol/script/generate-openapi.ts
+++ b/packages/protocol/script/generate-openapi.ts
@@ -1,10 +1,38 @@
Expand Down Expand Up @@ -44,12 +44,12 @@ index 61c4ddecd1..799ce56e43 100644
printWidth: 120,
})
diff --git a/packages/protocol/src/groups/session.ts b/packages/protocol/src/groups/session.ts
index f0f2b46e8e..426c77fadf 100644
index ffac096..c1cf2a3 100644
--- a/packages/protocol/src/groups/session.ts
+++ b/packages/protocol/src/groups/session.ts
@@ -31,6 +31,10 @@ import { Location } from "@opencode-ai/schema/location"
import { SessionEvent } from "@opencode-ai/schema/session-event"
import { EventLog } from "@opencode-ai/schema/event-log"
@@ -31,6 +31,10 @@ import { Location } from "@opencode/schema/location"
import { SessionEvent } from "@opencode/schema/session-event"
import { EventLog } from "@opencode/schema/event-log"

+export const SessionLogItem = Schema.Union([SessionEvent.Durable, EventLog.Synced]).annotate({
+ identifier: "SessionLogItem",
Expand Down
46 changes: 23 additions & 23 deletions spec/receipt.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
{
"schemaVersion": 1,
"upstreamCommit": "89f1943d2da6af6087fed06a60c57bd0f384ab9f",
"rawDocumentSha256": "72cfde2a06296df571e83ef9880a3bc3bdeb5d9679130f230b831d6778c777b7",
"generatedBaselineSha256": "f3e6a1b430db9e036bbe8fb34f1ba6bda11f84610e0710bede38ad520abb00f9",
"upstreamCommit": "f9bc2233ddcc11503a0804b317401bc221ef0e7f",
"rawDocumentSha256": "0bef23a00ff19c711cd871c7f0f9cc592ec81552aa94344f701ae380d2d752dc",
"generatedBaselineSha256": "180707057921ff2e1103066b0993db3646b19afbddf000ff7dba74c0cd36f179",
"patches": [
{
"manifest": "001-restore-sse-payloads.json",
"patchSha256": "aecd1686bc9b5e70a619e579fd87c6659fa299df53bb7b1fec17d7e8802cef10",
"patchSha256": "99e02b5452347d2dc87f108f2f46c54e471958728c5d96db584f72968babb544",
"preimages": [
{
"path": "packages/protocol/script/generate-openapi.ts",
"sha256": "0b750f4a0762d8835815b92b2bb9d292fe5f1889b8cda9188ca6e421d3d6a61d"
},
{
"path": "packages/protocol/src/groups/session.ts",
"sha256": "16077799284f6bdbd8190fdd912ee428ac3b2e126190f25862cf67a2e6ee216d"
"sha256": "c4659072876fc3232650439cec9dd57d23b9c0b1666e3f8d1897cf1854b83047"
}
]
}
],
"normalizedDocumentSha256": "2ecd7091a49a8b1505b8a7e935368129399e156fed6d344c9ca551b218b7e2f3",
"normalizedDocumentSha256": "809ad52800fa56ad266d2c5283d254c82200c64dae46b19a6edeba6e65bf41e2",
"normalizedDocumentPath": null,
"operationSetDigest": "038fa8d3b8cf12a9a3db9320f5945e5c7aaa5d07158cebc6a0527e4c56a0a2f8",
"operationCount": 140,
"addedOperations": [],
"removedOperations": [],
"componentCount": 352,
"componentCount": 355,
"contentSchemaCount": 2,
"watchedSources": [
{
"path": "packages/server/src/handlers/pty.ts",
"sha256": "4414c9709c4a66efbd2a24d49400022e4154587f3b94785871dfd2eca9220a30",
"sha256": "537e0f86abf23a5682a170bfbba88d586d53d7f0fec8f0bde317ce95ac7f92ba",
"anchorMatched": true
},
{
"path": "packages/server/src/middleware/authorization.ts",
"sha256": "7d3f8af2408e23ae35cf45d3693db034fd73d6ac8c07843154e3c8b3449529de",
"sha256": "c84f217a02bd2d2a839673308f9e268a2a68a1ac9f8c47c9c9e52f7f666e1486",
"anchorMatched": true
},
{
"path": "packages/protocol/src/groups/pty.ts",
"sha256": "fc5c3e39167a4d87e457365f3d36a8223a024ef345abbd26324cb7a36ca3b886",
"sha256": "0ea314dda5ea647de176ae6f43294c107d5d9f1abc8a35820c5a783d5f718fc8",
"anchorMatched": true
},
{
Expand All @@ -50,37 +50,37 @@
},
{
"path": "packages/core/src/pty/ticket.ts",
"sha256": "8a8e5ca2d5081d38e0c4200fe41de3d95d91830309c40aa26d5f4485c70853c7",
"sha256": "e9415c803919c69800c3d0555781be795df91b9cf0d01c7776ac5091bb49c116",
"anchorMatched": true
},
{
"path": "packages/core/src/pty.ts",
"sha256": "7d5ef3ebd36c473cc2acf047b99f8566011ccb64385bc04e9c771bc291367d59",
"sha256": "86ff2b792f1829b3f82badccffc1f63a95f98c7230f268c31d0f83c6f7340e6a",
"anchorMatched": true
},
{
"path": "packages/server/src/routes.ts",
"sha256": "4a0f61b114eb087e422dc593a58634bef2b75947dafb48f1941cdfaaa613df95",
"sha256": "880e16a03cb2d6aa1deced31f36f8ac13b4f66a522a8ec613550b22ff0d04bd7",
"anchorMatched": true
},
{
"path": "packages/protocol/src/groups/persistent-pty.ts",
"sha256": "114bf302f9542e7d1212886e9df04087c8a4315a1394884023d7c85e44ab683e",
"sha256": "a43d1e3c142b721186fb1f77afdb1da72f3c0c75cc71cba6c9f35f883afc1a08",
"anchorMatched": true
},
{
"path": "packages/server/src/handlers/persistent-pty.ts",
"sha256": "181266261e78117a9c09233cacd807cb853883f83e70024f612001fa0ef7885b",
"sha256": "3bb6bd5e006cf5a69cbca2231ded3922a95405e8932a8c89af6009d11ccd096e",
"anchorMatched": true
},
{
"path": "packages/core/src/persistent-pty/index.ts",
"sha256": "d34b09f60dbe8ddc9f2ca23550f57f24a8ac240a923d3d9790b7d154d343c754",
"sha256": "8b343fd3b60dbbd78314d23eb3ab2303fe30c986204ce4c049cfe6a6d4176f9e",
"anchorMatched": true
},
{
"path": "packages/core/src/persistent-pty/daemon.ts",
"sha256": "446c6b28268a1155d07b22f5767885f32e126a00659cee6f51723d5dbd4b81d7",
"sha256": "01e3d99d3f59dc8fc54eb31c94674b3d574169212bd35252441a3aeb20886129",
"anchorMatched": true
},
{
Expand All @@ -100,22 +100,22 @@
},
{
"path": "packages/core/src/persistent-pty/pty-binding.ts",
"sha256": "843092936a62d5fbe0c43d24604786ed77c04d0ad60a96c19ca31508b69bc1cd",
"sha256": "c4c835ddf472a7a299914341a4635be18c87bb37de556c24749d991f36c5c876",
"anchorMatched": true
},
{
"path": "packages/core/package.json",
"sha256": "4a0c6a39b98501f09acec8bf635e27e4798db9e1c4e1539c6146d0e021f858c2",
"sha256": "78ee3886360a8ece50c1ad67564586988e52ff5a9c8b18c90a48844668c21678",
"anchorMatched": true
},
{
"path": "packages/server/src/process.ts",
"sha256": "2e7b36c11d53e947a4fa15ce0271b03664031125ffac77036975881c6a9de6ec",
"sha256": "fb3bbb748814edfa92901e7228dfae707c3c668c4442e82648bf2fc6eaff8974",
"anchorMatched": true
},
{
"path": "packages/server/test/persistent-pty.test.ts",
"sha256": "025b44d37795c227ccd9b7f14762ecad3ef3100c9c413f39e8ab709e3b53f22b",
"sha256": "4beaf4903b95e1ecf600a5ad36e4b0e387e42c45850b1f84167af559e28f0284",
"anchorMatched": true
},
{
Expand All @@ -125,12 +125,12 @@
},
{
"path": "packages/core/src/ripgrep/binary.ts",
"sha256": "5e0398e1fe6bb5c2f694d01997781ef73060acd725468d7d4235a08ed96c41c6",
"sha256": "bc1bdc9e6429d8f586a8346ff58f5616e90f1755740f93fa938d266b34495d21",
"anchorMatched": true
},
{
"path": "packages/tui/src/component/terminal-pane.tsx",
"sha256": "973e352937fe66c218e7ca1c955cdd335eaedf81dc1f57f1a97ba0777e4578ae",
"sha256": "093707d4950af377f9a49d0c4f43d4ec1a289b7d04d47d894ea9f713ce026371",
"anchorMatched": true
}
]
Expand Down
Loading