summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorsredfern <[email protected]>2025-11-15 09:43:59 +1100
committerGitHub <[email protected]>2025-11-14 16:43:59 -0600
commit736f8882f5bf98dae53ed842c328913fac8d76b9 (patch)
tree266a87ad6f239ff631a1098fc2ada48d6c7fea01
parent37cf36592750afc0ffef08aa6a20fd64ae9d7d34 (diff)
downloadopencode-736f8882f5bf98dae53ed842c328913fac8d76b9.tar.gz
opencode-736f8882f5bf98dae53ed842c328913fac8d76b9.zip
fix(provider): support local file paths for custom providers (#4323)
-rw-r--r--packages/opencode/src/provider/provider.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/opencode/src/provider/provider.ts b/packages/opencode/src/provider/provider.ts
index d2957e3be..9aa960f1c 100644
--- a/packages/opencode/src/provider/provider.ts
+++ b/packages/opencode/src/provider/provider.ts
@@ -470,7 +470,15 @@ export namespace Provider {
const key = Bun.hash.xxHash32(JSON.stringify({ pkg, options }))
const existing = s.sdk.get(key)
if (existing) return existing
- const installedPath = await BunProc.install(pkg, "latest")
+
+ let installedPath: string
+ if (!pkg.startsWith("file://")) {
+ installedPath = await BunProc.install(pkg, "latest")
+ } else {
+ log.info("loading local provider", { pkg })
+ installedPath = pkg
+ }
+
// The `google-vertex-anthropic` provider points to the `@ai-sdk/google-vertex` package.
// Ref: https://github.com/sst/models.dev/blob/0a87de42ab177bebad0620a889e2eb2b4a5dd4ab/providers/google-vertex-anthropic/provider.toml
// However, the actual export is at the subpath `@ai-sdk/google-vertex/anthropic`.