diff --git a/bun.lock b/bun.lock index 096cd6ac3c24..1c6bcd4716d9 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,7 +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", }, "overrides": { "@types/bun": "catalog:", @@ -5742,6 +5741,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=="], diff --git a/package.json b/package.json index 0c75547d1a0b..4ce36d17ecd1 100644 --- a/package.json +++ b/package.json @@ -118,7 +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/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 29b53c7b79cb..b88ba974f21e 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/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({ 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: