From dcf1e7ed39ea038cb96b8975dd6f92b6eddecd9f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 07:08:55 +0000 Subject: [PATCH 1/2] Update OpenCode client to 2.0.23 --- packages/opencode-adapter/package.json | 2 +- packages/opencode-adapter/src/index.ts | 2 +- pnpm-lock.yaml | 28 +++++++++++++------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/opencode-adapter/package.json b/packages/opencode-adapter/package.json index 053fc54..a71d9b7 100644 --- a/packages/opencode-adapter/package.json +++ b/packages/opencode-adapter/package.json @@ -18,7 +18,7 @@ "typecheck": "tsc -p tsconfig.json" }, "dependencies": { - "@opencode/client": "2.0.22" + "@opencode/client": "2.0.23" }, "devDependencies": { "@opencode2-mobile/test-fixtures": "workspace:*", diff --git a/packages/opencode-adapter/src/index.ts b/packages/opencode-adapter/src/index.ts index 7fdb207..a40886e 100644 --- a/packages/opencode-adapter/src/index.ts +++ b/packages/opencode-adapter/src/index.ts @@ -23,7 +23,7 @@ import { import { ensurePromiseWithResolvers } from "./promise-with-resolvers"; -export const openCodeClientContractVersion = "2.0.22"; +export const openCodeClientContractVersion = "2.0.23"; export type OpenCodeClientOptions = { authorization?: string; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ac73434..87affbe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -203,8 +203,8 @@ importers: packages/opencode-adapter: dependencies: '@opencode/client': - specifier: 2.0.22 - version: 2.0.22(effect@4.0.0-rc.112) + specifier: 2.0.23 + version: 2.0.23(effect@4.0.0-rc.112) devDependencies: '@opencode2-mobile/test-fixtures': specifier: workspace:* @@ -1370,8 +1370,8 @@ packages: '@opencode-ai/schema@0.0.0-beta-18387': resolution: {integrity: sha512-of3chc9a4eQ24z9gTct10kBlhycZ+cI3JeIl51ideHVySY5aQLbGBo5SL7NLiuC7pu2kUY5OdmLjPDnLXAskzg==} - '@opencode/client@2.0.22': - resolution: {integrity: sha512-FJKugH301QHlV/rGL8TvgL3ly+toVlww+TP+YdVTKQWytQvjLoUdYtvvm+Iq5k6pN6Ki3ybE/08E8Cg+e6Opbg==} + '@opencode/client@2.0.23': + resolution: {integrity: sha512-tHfYu7sKNxFu2dZ7Pu5vZG4T8GHqU71ZCsXHZ/RoI0LLdG7t2zwePHWR9aNbcSP+jDUGyaQlzr5utC9Uduczvg==} peerDependencies: effect: 4.0.0-rc.112 solid-js: '>=1.9.0' @@ -1381,11 +1381,11 @@ packages: solid-js: optional: true - '@opencode/protocol@2.0.22': - resolution: {integrity: sha512-Ws3DKQW/rlBDwNz2cPE9+nGwbw7pgnZ+5bzgoHWCWxgTZmxdFulmLP05lxR+PPwMklUwzOGoUXFIzODPZ27WfA==} + '@opencode/protocol@2.0.23': + resolution: {integrity: sha512-acwAvjQgzzBsZ0h2Phvo+P/SurCexqcidPL2AYB6cDDPgOhY7ppeoKJAOQ76zAUcT4WBlcQzLl6Lq3L+IR6OEw==} - '@opencode/schema@2.0.22': - resolution: {integrity: sha512-PTqTrx3QHhlRL5ypfoMnSzXDU8XB2+vtKX8QKwIHP7B1F1yw90LN0XTmGP82k9rYoEcERq0TLuL+ykAsYJXJdA==} + '@opencode/schema@2.0.23': + resolution: {integrity: sha512-DglA+CCNmCaiAJ8FqAKo2EKIkCOF9/EmMEYowcXhTrQcoJ7eaTx7ytGjPgis6VHQuU4aaAgwZYw96ypS3ojsIw==} '@oxc-project/types@0.143.0': resolution: {integrity: sha512-u6JZdLBTLotrNC9Vd6vPssINdzcCzleKAH6EJKImQb7GtYvX5keN2dxkoK44stCc4tffE6QQRtZTXVSzsLUlWA==} @@ -6445,19 +6445,19 @@ snapshots: '@standard-schema/spec': 1.1.0 effect: 4.0.0-rc.111 - '@opencode/client@2.0.22(effect@4.0.0-rc.112)': + '@opencode/client@2.0.23(effect@4.0.0-rc.112)': dependencies: - '@opencode/protocol': 2.0.22 - '@opencode/schema': 2.0.22 + '@opencode/protocol': 2.0.23 + '@opencode/schema': 2.0.23 optionalDependencies: effect: 4.0.0-rc.112 - '@opencode/protocol@2.0.22': + '@opencode/protocol@2.0.23': dependencies: - '@opencode/schema': 2.0.22 + '@opencode/schema': 2.0.23 effect: 4.0.0-rc.112 - '@opencode/schema@2.0.22': + '@opencode/schema@2.0.23': dependencies: '@standard-schema/spec': 1.1.0 effect: 4.0.0-rc.112 From 3a02776ff2ee5717fb743e419a9328b91ebb779e Mon Sep 17 00:00:00 2001 From: Eivind Jonassen Date: Mon, 5 Oct 2026 09:39:40 +0200 Subject: [PATCH 2/2] Fix compatibility tests for declared project-list 404 errors Client 2.0.23 declares project-list 404 responses, so an empty body no longer yields UnexpectedStatus. Exercise missing endpoints through server info and its legacy fallback, cover 405, and verify declared project errors remain NOT_FOUND. --- packages/opencode-adapter/src/index.test.ts | 36 +++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/packages/opencode-adapter/src/index.test.ts b/packages/opencode-adapter/src/index.test.ts index ef63b69..7df9a4e 100644 --- a/packages/opencode-adapter/src/index.test.ts +++ b/packages/opencode-adapter/src/index.test.ts @@ -1662,9 +1662,39 @@ it("classifies a malformed fake API event frame", async () => { expect(classifyOpenCodeError(error)).toBe("MALFORMED_RESPONSE"); }); -it("classifies a missing required V2 endpoint as incompatible", async () => { +it.each([404, 405])( + "classifies a missing required V2 endpoint HTTP %s as incompatible", + async (status) => { + // Project-list 404 is a declared API error in 2.0.23. Server info still + // treats missing routes as unexpected statuses, including its legacy fallback. + const api = createFakeOpenCodeApi({ + failures: { + "/api/info": { body: {}, status }, + "/api/status": { body: {}, status }, + }, + }); + const client = createOpenCodeClient({ + baseUrl: "https://fake.invalid", + fetch: api.fetch, + }); + + const error = await client.server.status().catch((caught: unknown) => caught); + expect(classifyOpenCodeError(error)).toBe("INCOMPATIBLE"); + }, +); + +it("classifies a declared project-list 404 as not found", async () => { const api = createFakeOpenCodeApi({ - failures: { "/api/project": { body: {}, status: 404 } }, + failures: { + "/api/project": { + body: { + _tag: "ProjectNotFoundError", + projectID: "missing-project", + message: "Project not found", + }, + status: 404, + }, + }, }); const client = createOpenCodeClient({ baseUrl: "https://fake.invalid", @@ -1672,7 +1702,7 @@ it("classifies a missing required V2 endpoint as incompatible", async () => { }); const error = await client.project.list().catch((caught: unknown) => caught); - expect(classifyOpenCodeError(error)).toBe("INCOMPATIBLE"); + expect(classifyOpenCodeError(error)).toBe("NOT_FOUND"); }); it("receives events on runtimes without Promise.withResolvers", async () => {