The open source coding agent.
TypeScript
core: improve plugin loading to handle builtin plugin failures gracefully (#6739)
Aiden Clineb9b0e3475c28
diff --git a/packages/opencode/src/plugin/index.ts b/packages/opencode/src/plugin/index.tsindex 9b9d3266a9c..4c42ab972e3 100644--- a/packages/opencode/src/plugin/index.ts+++ b/packages/opencode/src/plugin/index.ts@@ -39,8 +39,9 @@ export namespace Plugin {const lastAtIndex = plugin.lastIndexOf("@")const pkg = lastAtIndex > 0 ? plugin.substring(0, lastAtIndex) : pluginconst version = lastAtIndex > 0 ? plugin.substring(lastAtIndex + 1) : "latest"+ const builtin = BUILTIN.some((x) => x.startsWith(pkg + "@"))plugin = await BunProc.install(pkg, version).catch((err) => {- if (BUILTIN.includes(pkg)) return ""+ if (builtin) return ""throw err})if (!plugin) continue