The open source coding agent.
TypeScript
chore: bump anthropic ai sdk pkg, delete patch (#21247)
Aiden Cline3c31d046669c
diff --git a/bun.lock b/bun.lockindex 096cd6ac3c2..1c6bcd4716d 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": {"[email protected]": "patches/[email protected]","@standard-community/[email protected]": "patches/@standard-community%[email protected]",- "@ai-sdk/[email protected]": "patches/@ai-sdk%[email protected]",},"overrides": {"@types/bun": "catalog:",@@ -5742,6 +5741,8 @@"nypm/tinyexec": ["[email protected]", "", {}, "sha512-u9r3uZC0bdpGOXtlxUIdwf9pkmvhqJdrVCH9fapQtgy/OeTTMZ1nqH7agtvEfmGui6e1XxjcdrlxvxJvc3sMqw=="],+ "opencode/@ai-sdk/anthropic": ["@ai-sdk/[email protected]", "", { "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/[email protected]", "", { "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/[email protected]", "", {}, "sha512-udGrGJBNQdXGVulehc1aWT73wkR9wdaGBtB6yL70RJsqwW/yJhIg6ZbRlPOfIUiFNrnBuYLBi9CSmMKfDC7dvA=="],diff --git a/package.json b/package.jsonindex 0c75547d1a0..4ce36d17ecd 100644--- a/package.json+++ b/package.json@@ -118,7 +118,6 @@},"patchedDependencies": {"@standard-community/[email protected]": "patches/@standard-community%[email protected]",- "[email protected]": "patches/[email protected]",- "@ai-sdk/[email protected]": "patches/@ai-sdk%[email protected]"+ "[email protected]": "patches/[email protected]"}}diff --git a/packages/opencode/package.json b/packages/opencode/package.jsonindex 29b53c7b79c..b88ba974f21 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.tsindex 82ee8c08106..946797da50e 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.serverif (!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.providerconst model = fixture.modelconst 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.Userconst stream = await LLM.stream({diff --git a/patches/@ai-sdk%[email protected] b/patches/@ai-sdk%[email protected]deleted file mode 100644index b8c2f387d7f..00000000000--- a/patches/@ai-sdk%[email protected]+++ /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: