diff options
| author | Dax <[email protected]> | 2026-02-18 18:08:48 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-18 18:08:48 -0500 |
| commit | 359360ad86e34db9074d9ef1281682206615d9cc (patch) | |
| tree | 2e8bc1c337dd693a5d8ac3fafa8336e8ccae7570 | |
| parent | 5d12eb952853ea94881e3a06e8213b7e0f20975c (diff) | |
| download | opencode-359360ad86e34db9074d9ef1281682206615d9cc.tar.gz opencode-359360ad86e34db9074d9ef1281682206615d9cc.zip | |
refactor: migrate src/provider/provider.ts from Bun.file() to Filesystem module (#14132)
| -rw-r--r-- | packages/opencode/src/provider/provider.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/opencode/src/provider/provider.ts b/packages/opencode/src/provider/provider.ts index d94d0cbb2..6480625e9 100644 --- a/packages/opencode/src/provider/provider.ts +++ b/packages/opencode/src/provider/provider.ts @@ -16,6 +16,7 @@ import { Flag } from "../flag/flag" import { iife } from "@/util/iife" import { Global } from "../global" import path from "path" +import { Filesystem } from "../util/filesystem" // Direct imports for bundled providers import { createAmazonBedrock, type AmazonBedrockProviderSettings } from "@ai-sdk/amazon-bedrock" @@ -1291,8 +1292,9 @@ export namespace Provider { if (cfg.model) return parseModel(cfg.model) const providers = await list() - const recent = (await Bun.file(path.join(Global.Path.state, "model.json")) - .json() + const recent = (await Filesystem.readJson<{ recent?: { providerID: string; modelID: string }[] }>( + path.join(Global.Path.state, "model.json"), + ) .then((x) => (Array.isArray(x.recent) ? x.recent : [])) .catch(() => [])) as { providerID: string; modelID: string }[] for (const entry of recent) { |
