summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-11-18 12:01:41 -0500
committerDax Raad <[email protected]>2025-11-18 12:01:41 -0500
commit7c0cc94023bc47b8a87067a0c5307581fd4b46f6 (patch)
treeda52dc88dc64350d80db86e39b3da0a25c56d4f8
parent3ed1bd2e8e00681b7c7dfaecce87a4400111f2cd (diff)
downloadopencode-7c0cc94023bc47b8a87067a0c5307581fd4b46f6.tar.gz
opencode-7c0cc94023bc47b8a87067a0c5307581fd4b46f6.zip
rework default model
-rw-r--r--packages/opencode/src/provider/provider.ts38
1 files changed, 1 insertions, 37 deletions
diff --git a/packages/opencode/src/provider/provider.ts b/packages/opencode/src/provider/provider.ts
index 62b08d955..774860ffb 100644
--- a/packages/opencode/src/provider/provider.ts
+++ b/packages/opencode/src/provider/provider.ts
@@ -627,7 +627,7 @@ export namespace Provider {
}
}
- const priority = ["gemini-2.5-pro-preview", "gpt-5", "claude-sonnet-4", "big-pickle"]
+ const priority = ["gpt-5", "claude-sonnet-4", "big-pickle", "gemini-3-pro"]
export function sort(models: ModelsDev.Model[]) {
return sortBy(
models,
@@ -641,42 +641,6 @@ export namespace Provider {
const cfg = await Config.get()
if (cfg.model) return parseModel(cfg.model)
- // this will be adjusted when migration to opentui is complete,
- // for now we just read the tui state toml file directly
- //
- // NOTE: cannot just import file as toml without cleaning due to lack of
- // support for date/time references in Bun toml parser: https://github.com/oven-sh/bun/issues/22426
- const lastused = await Bun.file(path.join(Global.Path.state, "tui"))
- .text()
- .then((text) => {
- // remove the date/time references since Bun toml parser doesn't support yet
- const cleaned = text
- .split("\n")
- .filter((line) => !line.trim().startsWith("last_used ="))
- .join("\n")
- const state = Bun.TOML.parse(cleaned) as {
- recently_used_models?: {
- provider_id: string
- model_id: string
- }[]
- }
- const [model] = state?.recently_used_models ?? []
- if (model) {
- return {
- providerID: model.provider_id,
- modelID: model.model_id,
- }
- }
- })
- .catch((error) => {
- log.error("failed to find last used model", {
- error,
- })
- return undefined
- })
-
- if (lastused) return lastused
-
const provider = await list()
.then((val) => Object.values(val))
.then((x) => x.find((p) => !cfg.provider || Object.keys(cfg.provider).includes(p.info.id)))