Browse Source

change default title model

Aiden Cline 4 months ago
parent
commit
9df61055e2
1 changed files with 22 additions and 21 deletions
  1. 22 21
      packages/opencode/src/provider/provider.ts

+ 22 - 21
packages/opencode/src/provider/provider.ts

@@ -121,9 +121,10 @@ export namespace Provider {
             }
             }
             case "ap": {
             case "ap": {
               const isAustraliaRegion = ["ap-southeast-2", "ap-southeast-4"].includes(region)
               const isAustraliaRegion = ["ap-southeast-2", "ap-southeast-4"].includes(region)
-              if (isAustraliaRegion && ["anthropic.claude-sonnet-4-5", "anthropic.claude-haiku"].some((m) =>
-                modelID.includes(m),
-              )) {
+              if (
+                isAustraliaRegion &&
+                ["anthropic.claude-sonnet-4-5", "anthropic.claude-haiku"].some((m) => modelID.includes(m))
+              ) {
                 regionPrefix = "au"
                 regionPrefix = "au"
                 modelID = `${regionPrefix}.${modelID}`
                 modelID = `${regionPrefix}.${modelID}`
               } else {
               } else {
@@ -273,31 +274,31 @@ export namespace Provider {
           cost:
           cost:
             !model.cost && !existing?.cost
             !model.cost && !existing?.cost
               ? {
               ? {
-                input: 0,
-                output: 0,
-                cache_read: 0,
-                cache_write: 0,
-              }
+                  input: 0,
+                  output: 0,
+                  cache_read: 0,
+                  cache_write: 0,
+                }
               : {
               : {
-                cache_read: 0,
-                cache_write: 0,
-                ...existing?.cost,
-                ...model.cost,
-              },
+                  cache_read: 0,
+                  cache_write: 0,
+                  ...existing?.cost,
+                  ...model.cost,
+                },
           options: {
           options: {
             ...existing?.options,
             ...existing?.options,
             ...model.options,
             ...model.options,
           },
           },
           limit: model.limit ??
           limit: model.limit ??
             existing?.limit ?? {
             existing?.limit ?? {
-            context: 0,
-            output: 0,
-          },
+              context: 0,
+              output: 0,
+            },
           modalities: model.modalities ??
           modalities: model.modalities ??
             existing?.modalities ?? {
             existing?.modalities ?? {
-            input: ["text"],
-            output: ["text"],
-          },
+              input: ["text"],
+              output: ["text"],
+            },
           provider: model.provider ?? existing?.provider,
           provider: model.provider ?? existing?.provider,
         }
         }
         if (model.id && model.id !== modelID) {
         if (model.id && model.id !== modelID) {
@@ -509,7 +510,7 @@ export namespace Provider {
 
 
     const provider = await state().then((state) => state.providers[providerID])
     const provider = await state().then((state) => state.providers[providerID])
     if (!provider) return
     if (!provider) return
-    const priority = ["3-5-haiku", "3.5-haiku", "gemini-2.5-flash", "gpt-5-nano"]
+    const priority = ["claude-haiku-4-5", "anthropic/claude-haiku-4.5", "gemini-2.5-flash", "gpt-5-nano"]
     for (const item of priority) {
     for (const item of priority) {
       for (const model of Object.keys(provider.info.models)) {
       for (const model of Object.keys(provider.info.models)) {
         if (model.includes(item)) return getModel(providerID, model)
         if (model.includes(item)) return getModel(providerID, model)
@@ -517,7 +518,7 @@ export namespace Provider {
     }
     }
   }
   }
 
 
-  const priority = ["gemini-2.5-pro-preview", "gpt-5", "claude-sonnet-4"]
+  const priority = ["gemini-2.5-pro-preview", "gpt-5", "claude-sonnet-4-5"]
   export function sort(models: ModelsDev.Model[]) {
   export function sort(models: ModelsDev.Model[]) {
     return sortBy(
     return sortBy(
       models,
       models,