diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts index f505a328f6..04d14248b1 100644 --- a/packages/opencode/src/provider/transform.ts +++ b/packages/opencode/src/provider/transform.ts @@ -577,14 +577,6 @@ function googleThinkingLevelVariants() { ) } -function googleThinkingBudgetVariants(budget: ReasoningBudgetOption, model: Provider.Model) { - return reasoningBudgetVariants( - budget, - (thinkingBudget) => ({ thinkingConfig: { includeThoughts: true, thinkingBudget } }), - model.limit.output, - ) -} - function openAIReasoningEffortVariants() { return Object.fromEntries( OPENAI_EFFORTS.map((effort) => [ @@ -623,25 +615,6 @@ function reasoningBudgetVariants( } } -function gemini25BudgetVariants(model: Provider.Model, budget: ReasoningBudgetOption) { - // Gemini 2.5 uses numeric thinking budgets in the Google SDK; thinkingLevel is for Gemini 3. - if (!idIncludes(model, "gemini-2.5") && !idIncludes(model, "gemini-2-5")) return undefined - - switch (model.api.npm) { - case "@ai-sdk/gateway": - if (idIncludes(model, "google")) return googleThinkingBudgetVariants(budget, model) - return undefined - - case "@ai-sdk/google": - case "@ai-sdk/google-vertex": - return googleThinkingBudgetVariants(budget, model) - - case "@jerome-benoit/sap-ai-provider-v2": - return wrapInSapModelParams(googleThinkingBudgetVariants(budget, model)) - } - return undefined -} - function anthropicAdaptiveFromOptions(effort: ReasoningEffortOption) { return effort.values.includes("max") } @@ -759,8 +732,6 @@ function reasoningOptionVariants(model: Provider.Model): Record ({ thinkingConfig: { includeThoughts: true, thinkingBudget } }), + model.limit.output, + ) } break @@ -812,7 +787,11 @@ function reasoningOptionVariants(model: Provider.Model): Record ({ thinkingConfig: { includeThoughts: true, thinkingBudget } }), + model.limit.output, + ) case "@jerome-benoit/sap-ai-provider-v2": if (model.api.id.includes("anthropic")) { diff --git a/packages/opencode/test/provider/transform.test.ts b/packages/opencode/test/provider/transform.test.ts index 62e8074d0a..d1230dd6e7 100644 --- a/packages/opencode/test/provider/transform.test.ts +++ b/packages/opencode/test/provider/transform.test.ts @@ -3220,10 +3220,7 @@ describe("ProviderTransform.variants", () => { url: "https://gateway.ai", npm: "@ai-sdk/gateway", }, - reasoning_options: [ - { type: "effort", values: ["minimal", "low", "medium", "high"] }, - { type: "budget_tokens", min: 128, max: 32768 }, - ], + reasoning_options: [{ type: "budget_tokens", min: 128, max: 32768 }], }), ) expect(Object.keys(result)).toEqual(["high", "max"]) @@ -3772,10 +3769,7 @@ describe("ProviderTransform.variants", () => { npm: provider.name, }, reasoning_options: testCase.expectedMax - ? [ - { type: "effort", values: ["minimal", "low", "medium", "high"] }, - { type: "budget_tokens", max: testCase.expectedMax.thinkingConfig.thinkingBudget }, - ] + ? [{ type: "budget_tokens", max: testCase.expectedMax.thinkingConfig.thinkingBudget }] : [{ type: "effort", values: testCase.efforts }], }), ) @@ -3872,19 +3866,6 @@ describe("ProviderTransform.variants", () => { }, }) }) - - test("uses reasoning_options budget tokens for Gemini 2.5 variants", () => { - const result = ProviderTransform.variants( - sapModel("gemini-2.5-pro", [ - { type: "effort", values: ["minimal", "low", "medium", "high"] }, - { type: "budget_tokens", min: 128, max: 32768 }, - ]), - ) - expect(result).toEqual({ - high: { modelParams: { thinkingConfig: { includeThoughts: true, thinkingBudget: 16_000 } } }, - max: { modelParams: { thinkingConfig: { includeThoughts: true, thinkingBudget: 32_768 } } }, - }) - }) }) describe("ai-gateway-provider (cloudflare-ai-gateway)", () => {