Browse Source

fix: opencode run not parsing model string

Aiden Cline 3 months ago
parent
commit
de1278414f
1 changed files with 2 additions and 6 deletions
  1. 2 6
      packages/opencode/src/cli/cmd/run.ts

+ 2 - 6
packages/opencode/src/cli/cmd/run.ts

@@ -9,6 +9,7 @@ import { EOL } from "os"
 import { select } from "@clack/prompts"
 import { createOpencodeClient, type OpencodeClient } from "@opencode-ai/sdk"
 import { Server } from "../../server/server"
+import { Provider } from "../../provider/provider"
 
 const TOOL: Record<string, [string, string]> = {
   todowrite: ["Todo", UI.Style.TEXT_WARNING_BOLD],
@@ -237,12 +238,7 @@ export const RunCommand = cmd({
           },
         })
       } else {
-        const modelParam = args.model
-          ? (() => {
-              const [providerID, modelID] = args.model.split("/")
-              return { providerID, modelID }
-            })()
-          : undefined
+        const modelParam = args.model ? Provider.parseModel(args.model) : undefined
         await sdk.session.prompt({
           path: { id: sessionID },
           body: {