core: improve plugin loading to handle builtin plugin failures gracefully (#6739)

pull/6745/head
Aiden Cline 2026-01-02 22:54:35 -08:00 committed by GitHub
parent 77fcefca0e
commit b9b0e3475c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -39,8 +39,9 @@ export namespace Plugin {
const lastAtIndex = plugin.lastIndexOf("@")
const pkg = lastAtIndex > 0 ? plugin.substring(0, lastAtIndex) : plugin
const 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