mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-07 09:11:42 +00:00
core: ensure models configuration is not empty before loading
This commit is contained in:
parent
46122d9a0a
commit
d005e70f50
1 changed files with 1 additions and 1 deletions
|
|
@ -87,7 +87,7 @@ export namespace ModelsDev {
|
|||
export const Data = lazy(async () => {
|
||||
const file = Bun.file(filepath)
|
||||
const result = await file.json().catch(() => {})
|
||||
if (result) return result
|
||||
if (result && typeof result === "object" && Object.keys(result).length > 0) return result
|
||||
// @ts-ignore
|
||||
const snapshot = await import("./models-snapshot")
|
||||
.then((m) => m.snapshot as Record<string, unknown>)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue