From 1f73513a456d8a32f539a51b7ca82e10c5cdc013 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 6 Apr 2026 18:19:15 -0500 Subject: [PATCH 1/3] chore: bump anthropic ai sdk pkg, delete patch --- bun.lock | 10 +- package.json | 4 +- packages/opencode/package.json | 2 +- patches/@ai-sdk%2Fanthropic@3.0.64.patch | 119 ----------------------- 4 files changed, 9 insertions(+), 126 deletions(-) delete mode 100644 patches/@ai-sdk%2Fanthropic@3.0.64.patch diff --git a/bun.lock b/bun.lock index a57f1f0d29c8..ea7aacc91317 100644 --- a/bun.lock +++ b/bun.lock @@ -308,7 +308,7 @@ "@actions/github": "6.0.1", "@agentclientprotocol/sdk": "0.16.1", "@ai-sdk/amazon-bedrock": "4.0.83", - "@ai-sdk/anthropic": "3.0.64", + "@ai-sdk/anthropic": "3.0.67", "@ai-sdk/azure": "3.0.49", "@ai-sdk/cerebras": "2.0.41", "@ai-sdk/cohere": "3.0.27", @@ -621,8 +621,6 @@ "patchedDependencies": { "solid-js@1.9.10": "patches/solid-js@1.9.10.patch", "@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch", - "@ai-sdk/anthropic@3.0.64": "patches/@ai-sdk%2Fanthropic@3.0.64.patch", - "@ai-sdk/provider-utils@4.0.21": "patches/@ai-sdk%2Fprovider-utils@4.0.21.patch", }, "overrides": { "@types/bun": "catalog:", @@ -5699,6 +5697,8 @@ "nypm/tinyexec": ["tinyexec@1.0.4", "", {}, "sha512-u9r3uZC0bdpGOXtlxUIdwf9pkmvhqJdrVCH9fapQtgy/OeTTMZ1nqH7agtvEfmGui6e1XxjcdrlxvxJvc3sMqw=="], + "opencode/@ai-sdk/anthropic": ["@ai-sdk/anthropic@3.0.67", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@ai-sdk/provider-utils": "4.0.23" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-FFX4P5Fd6lcQJc2OLngZQkbbJHa0IDDZi087Edb8qRZx6h90krtM61ArbMUL8us/7ZUwojCXnyJ/wQ2Eflx2jQ=="], + "opencontrol/@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.6.1", "", { "dependencies": { "content-type": "^1.0.5", "cors": "^2.8.5", "eventsource": "^3.0.2", "express": "^5.0.1", "express-rate-limit": "^7.5.0", "pkce-challenge": "^4.1.0", "raw-body": "^3.0.0", "zod": "^3.23.8", "zod-to-json-schema": "^3.24.1" } }, "sha512-oxzMzYCkZHMntzuyerehK3fV6A2Kwh5BD6CGEJSVDU2QNEhfLOptf2X7esQgaHZXHZY0oHmMsOtIDLP71UJXgA=="], "opencontrol/@tsconfig/bun": ["@tsconfig/bun@1.0.7", "", {}, "sha512-udGrGJBNQdXGVulehc1aWT73wkR9wdaGBtB6yL70RJsqwW/yJhIg6ZbRlPOfIUiFNrnBuYLBi9CSmMKfDC7dvA=="], @@ -6419,6 +6419,8 @@ "motion/framer-motion/motion-utils": ["motion-utils@12.36.0", "", {}, "sha512-eHWisygbiwVvf6PZ1vhaHCLamvkSbPIeAYxWUuL3a2PD/TROgE7FvfHWTIH4vMl798QLfMw15nRqIaRDXTlYRg=="], + "opencode/@ai-sdk/anthropic/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@4.0.23", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@standard-schema/spec": "^1.1.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-z8GlDaCmRSDlqkMF2f4/RFgWxdarvIbyuk+m6WXT1LYgsnGiXRJGTD2Z1+SDl3LqtFuRtGX1aghYvQLoHL/9pg=="], + "opencontrol/@modelcontextprotocol/sdk/express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="], "opencontrol/@modelcontextprotocol/sdk/express-rate-limit": ["express-rate-limit@7.5.1", "", { "peerDependencies": { "express": ">= 4.11" } }, "sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw=="], @@ -6751,6 +6753,8 @@ "js-beautify/glob/path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], + "opencode/@ai-sdk/anthropic/@ai-sdk/provider-utils/@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="], + "opencontrol/@modelcontextprotocol/sdk/express/accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="], "opencontrol/@modelcontextprotocol/sdk/express/body-parser": ["body-parser@2.2.2", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^1.0.5", "debug": "^4.4.3", "http-errors": "^2.0.0", "iconv-lite": "^0.7.0", "on-finished": "^2.4.1", "qs": "^6.14.1", "raw-body": "^3.0.1", "type-is": "^2.0.1" } }, "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA=="], diff --git a/package.json b/package.json index e4a2b5844f55..e938f4ab618d 100644 --- a/package.json +++ b/package.json @@ -118,8 +118,6 @@ }, "patchedDependencies": { "@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch", - "solid-js@1.9.10": "patches/solid-js@1.9.10.patch", - "@ai-sdk/provider-utils@4.0.21": "patches/@ai-sdk%2Fprovider-utils@4.0.21.patch", - "@ai-sdk/anthropic@3.0.64": "patches/@ai-sdk%2Fanthropic@3.0.64.patch" + "solid-js@1.9.10": "patches/solid-js@1.9.10.patch" } } diff --git a/packages/opencode/package.json b/packages/opencode/package.json index d55933ee58b6..ee89a28ce7db 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -79,7 +79,7 @@ "@actions/github": "6.0.1", "@agentclientprotocol/sdk": "0.16.1", "@ai-sdk/amazon-bedrock": "4.0.83", - "@ai-sdk/anthropic": "3.0.64", + "@ai-sdk/anthropic": "3.0.67", "@ai-sdk/azure": "3.0.49", "@ai-sdk/cerebras": "2.0.41", "@ai-sdk/cohere": "3.0.27", diff --git a/patches/@ai-sdk%2Fanthropic@3.0.64.patch b/patches/@ai-sdk%2Fanthropic@3.0.64.patch deleted file mode 100644 index b8c2f387d7f7..000000000000 --- a/patches/@ai-sdk%2Fanthropic@3.0.64.patch +++ /dev/null @@ -1,119 +0,0 @@ ---- a/dist/index.js -+++ b/dist/index.js -@@ -3155,15 +3155,6 @@ - }); - } - baseArgs.max_tokens = maxTokens + (thinkingBudget != null ? thinkingBudget : 0); -- } else { -- if (topP != null && temperature != null) { -- warnings.push({ -- type: "unsupported", -- feature: "topP", -- details: `topP is not supported when temperature is set. topP is ignored.` -- }); -- baseArgs.top_p = void 0; -- } - } - if (isKnownModel && baseArgs.max_tokens > maxOutputTokensForModel) { - if (maxOutputTokens != null) { -@@ -5180,4 +5171,4 @@ - createAnthropic, - forwardAnthropicContainerIdFromLastStep - }); --//# sourceMappingURL=index.js.map -\ No newline at end of file -+//# sourceMappingURL=index.js.map ---- a/dist/index.mjs -+++ b/dist/index.mjs -@@ -3192,15 +3192,6 @@ - }); - } - baseArgs.max_tokens = maxTokens + (thinkingBudget != null ? thinkingBudget : 0); -- } else { -- if (topP != null && temperature != null) { -- warnings.push({ -- type: "unsupported", -- feature: "topP", -- details: `topP is not supported when temperature is set. topP is ignored.` -- }); -- baseArgs.top_p = void 0; -- } - } - if (isKnownModel && baseArgs.max_tokens > maxOutputTokensForModel) { - if (maxOutputTokens != null) { -@@ -5256,4 +5247,4 @@ - createAnthropic, - forwardAnthropicContainerIdFromLastStep - }; --//# sourceMappingURL=index.mjs.map -\ No newline at end of file -+//# sourceMappingURL=index.mjs.map ---- a/dist/internal/index.js -+++ b/dist/internal/index.js -@@ -3147,15 +3147,6 @@ - }); - } - baseArgs.max_tokens = maxTokens + (thinkingBudget != null ? thinkingBudget : 0); -- } else { -- if (topP != null && temperature != null) { -- warnings.push({ -- type: "unsupported", -- feature: "topP", -- details: `topP is not supported when temperature is set. topP is ignored.` -- }); -- baseArgs.top_p = void 0; -- } - } - if (isKnownModel && baseArgs.max_tokens > maxOutputTokensForModel) { - if (maxOutputTokens != null) { -@@ -5080,4 +5071,4 @@ - anthropicTools, - prepareTools - }); --//# sourceMappingURL=index.js.map -\ No newline at end of file -+//# sourceMappingURL=index.js.map ---- a/dist/internal/index.mjs -+++ b/dist/internal/index.mjs -@@ -3176,15 +3176,6 @@ - }); - } - baseArgs.max_tokens = maxTokens + (thinkingBudget != null ? thinkingBudget : 0); -- } else { -- if (topP != null && temperature != null) { -- warnings.push({ -- type: "unsupported", -- feature: "topP", -- details: `topP is not supported when temperature is set. topP is ignored.` -- }); -- baseArgs.top_p = void 0; -- } - } - if (isKnownModel && baseArgs.max_tokens > maxOutputTokensForModel) { - if (maxOutputTokens != null) { -@@ -5148,4 +5139,4 @@ - anthropicTools, - prepareTools - }; --//# sourceMappingURL=index.mjs.map -\ No newline at end of file -+//# sourceMappingURL=index.mjs.map ---- a/src/anthropic-messages-language-model.ts -+++ b/src/anthropic-messages-language-model.ts -@@ -534,16 +534,6 @@ - - // adjust max tokens to account for thinking: - baseArgs.max_tokens = maxTokens + (thinkingBudget ?? 0); -- } else { -- // Only check temperature/topP mutual exclusivity when thinking is not enabled -- if (topP != null && temperature != null) { -- warnings.push({ -- type: 'unsupported', -- feature: 'topP', -- details: `topP is not supported when temperature is set. topP is ignored.`, -- }); -- baseArgs.top_p = undefined; -- } - } - - // limit to max output tokens for known models to enable model switching without breaking it: From 23c5734f2fcec011b5aa0e3f490674d0dedc544f Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 6 Apr 2026 19:59:46 -0500 Subject: [PATCH 2/3] bun i --- bun.lock | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bun.lock b/bun.lock index 0d488cb29b44..1c6bcd4716d9 100644 --- a/bun.lock +++ b/bun.lock @@ -6507,8 +6507,6 @@ "motion/framer-motion/motion-utils": ["motion-utils@12.36.0", "", {}, "sha512-eHWisygbiwVvf6PZ1vhaHCLamvkSbPIeAYxWUuL3a2PD/TROgE7FvfHWTIH4vMl798QLfMw15nRqIaRDXTlYRg=="], - "opencode/@ai-sdk/anthropic/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@4.0.23", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@standard-schema/spec": "^1.1.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-z8GlDaCmRSDlqkMF2f4/RFgWxdarvIbyuk+m6WXT1LYgsnGiXRJGTD2Z1+SDl3LqtFuRtGX1aghYvQLoHL/9pg=="], - "opencontrol/@modelcontextprotocol/sdk/express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="], "opencontrol/@modelcontextprotocol/sdk/express-rate-limit": ["express-rate-limit@7.5.1", "", { "peerDependencies": { "express": ">= 4.11" } }, "sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw=="], @@ -6843,8 +6841,6 @@ "js-beautify/glob/path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], - "opencode/@ai-sdk/anthropic/@ai-sdk/provider-utils/@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="], - "opencontrol/@modelcontextprotocol/sdk/express/accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="], "opencontrol/@modelcontextprotocol/sdk/express/body-parser": ["body-parser@2.2.2", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^1.0.5", "debug": "^4.4.3", "http-errors": "^2.0.0", "iconv-lite": "^0.7.0", "on-finished": "^2.4.1", "qs": "^6.14.1", "raw-body": "^3.0.1", "type-is": "^2.0.1" } }, "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA=="], From 4835a045de4b8a831477e2ca3b12d24eb6ac6c6a Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 6 Apr 2026 20:00:42 -0500 Subject: [PATCH 3/3] fix: test --- packages/opencode/test/session/llm.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/opencode/test/session/llm.test.ts b/packages/opencode/test/session/llm.test.ts index 82ee8c08106e..946797da50e2 100644 --- a/packages/opencode/test/session/llm.test.ts +++ b/packages/opencode/test/session/llm.test.ts @@ -872,16 +872,15 @@ describe("session.llm.stream", () => { }) }) - test("sends messages API payload for Anthropic models", async () => { + test("sends messages API payload for Anthropic Compatible models", async () => { const server = state.server if (!server) { throw new Error("Server not initialized") } - const providerID = "anthropic" - const modelID = "claude-3-5-sonnet-20241022" + const providerID = "minimax" + const modelID = "MiniMax-M2.5" const fixture = await loadFixture(providerID, modelID) - const provider = fixture.provider const model = fixture.model const chunks = [ @@ -962,7 +961,7 @@ describe("session.llm.stream", () => { role: "user", time: { created: Date.now() }, agent: agent.name, - model: { providerID: ProviderID.make("minimax"), modelID: ModelID.make("MiniMax-M2.7") }, + model: { providerID: ProviderID.make("minimax"), modelID: ModelID.make("MiniMax-M2.5") }, } satisfies MessageV2.User const stream = await LLM.stream({