Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
21 lines
721 B
Diff
21 lines
721 B
Diff
diff --git i/packages/opencode/src/provider/models-macro.ts w/packages/opencode/src/provider/models-macro.ts
|
|
index 91a0348..4f60069 100644
|
|
--- i/packages/opencode/src/provider/models-macro.ts
|
|
+++ w/packages/opencode/src/provider/models-macro.ts
|
|
@@ -1,4 +1,15 @@
|
|
export async function data() {
|
|
+ const localApiJsonPath = process.env.MODELS_DEV_API_JSON
|
|
+
|
|
+ // Try to read from local file if path is provided
|
|
+ if (localApiJsonPath) {
|
|
+ const localFile = Bun.file(localApiJsonPath)
|
|
+ if (await localFile.exists()) {
|
|
+ return await localFile.text()
|
|
+ }
|
|
+ }
|
|
+
|
|
+ // Fallback to fetching from remote URL
|
|
const json = await fetch("https://models.dev/api.json").then((x) => x.text())
|
|
return json
|
|
}
|