mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
core: ensure models configuration is not empty before loading
This commit is contained in:
@@ -87,7 +87,7 @@ export namespace ModelsDev {
|
|||||||
export const Data = lazy(async () => {
|
export const Data = lazy(async () => {
|
||||||
const file = Bun.file(filepath)
|
const file = Bun.file(filepath)
|
||||||
const result = await file.json().catch(() => {})
|
const result = await file.json().catch(() => {})
|
||||||
if (result) return result
|
if (result && typeof result === "object" && Object.keys(result).length > 0) return result
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const snapshot = await import("./models-snapshot")
|
const snapshot = await import("./models-snapshot")
|
||||||
.then((m) => m.snapshot as Record<string, unknown>)
|
.then((m) => m.snapshot as Record<string, unknown>)
|
||||||
|
|||||||
Reference in New Issue
Block a user