Skip to content

Commit d005e70

Browse files
committed
core: ensure models configuration is not empty before loading
1 parent 46122d9 commit d005e70

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/opencode/src/provider/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export namespace ModelsDev {
8787
export const Data = lazy(async () => {
8888
const file = Bun.file(filepath)
8989
const result = await file.json().catch(() => {})
90-
if (result) return result
90+
if (result && typeof result === "object" && Object.keys(result).length > 0) return result
9191
// @ts-ignore
9292
const snapshot = await import("./models-snapshot")
9393
.then((m) => m.snapshot as Record<string, unknown>)

0 commit comments

Comments
 (0)