Aiden Cline 1 месяц назад
Родитель
Сommit
2fd97377f6

+ 2 - 2
packages/opencode/src/provider/transform.ts

@@ -279,7 +279,7 @@ export namespace ProviderTransform {
         // https://v5.ai-sdk.dev/providers/ai-sdk-providers/azure
         if (id === "o1-mini") return {}
         const azureEfforts = ["low", "medium", "high"]
-        if (id === "gpt-5" || id === "gpt-5-nano" || id === "gpt-5-mini") {
+        if (id.includes("gpt-5-") || id === "gpt-5") {
           azureEfforts.unshift("minimal")
         }
         return Object.fromEntries(
@@ -298,7 +298,7 @@ export namespace ProviderTransform {
         const openaiEfforts = iife(() => {
           if (id.includes("codex")) return WIDELY_SUPPORTED_EFFORTS
           const arr = [...WIDELY_SUPPORTED_EFFORTS]
-          if (id === "gpt-5" || id === "gpt-5-nano" || id === "gpt-5-mini") {
+          if (id.includes("gpt-5-") || id === "gpt-5") {
             arr.unshift("minimal")
           }
           if (model.release_date >= "2025-11-13") {

+ 7 - 7
packages/opencode/test/provider/transform.test.ts

@@ -694,10 +694,10 @@ describe("ProviderTransform.variants", () => {
 
     test("standard azure models return custom efforts with reasoningSummary", () => {
       const model = createMockModel({
-        id: "azure/gpt-4o",
+        id: "o1",
         providerID: "azure",
         api: {
-          id: "gpt-4o",
+          id: "o1",
           url: "https://azure.com",
           npm: "@ai-sdk/azure",
         },
@@ -713,7 +713,7 @@ describe("ProviderTransform.variants", () => {
 
     test("gpt-5 adds minimal effort", () => {
       const model = createMockModel({
-        id: "azure/gpt-5",
+        id: "gpt-5",
         providerID: "azure",
         api: {
           id: "gpt-5",
@@ -743,10 +743,10 @@ describe("ProviderTransform.variants", () => {
 
     test("standard openai models return custom efforts with reasoningSummary", () => {
       const model = createMockModel({
-        id: "openai/gpt-4o",
+        id: "gpt-5",
         providerID: "openai",
         api: {
-          id: "gpt-4o",
+          id: "gpt-5",
           url: "https://api.openai.com",
           npm: "@ai-sdk/openai",
         },
@@ -763,10 +763,10 @@ describe("ProviderTransform.variants", () => {
 
     test("models after 2025-11-13 include 'none' effort", () => {
       const model = createMockModel({
-        id: "openai/gpt-4.5",
+        id: "gpt-5-nano",
         providerID: "openai",
         api: {
-          id: "gpt-4.5",
+          id: "gpt-5-nano",
           url: "https://api.openai.com",
           npm: "@ai-sdk/openai",
         },