fix: register failed community plugins as disabled instead of enabled

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
EthanMiller0x 2026-03-27 20:53:16 +07:00
parent e560f3a5c8
commit a048dd637d

View File

@ -150,12 +150,13 @@ export async function runSetup(
settingsPath: settingsManager.getSettingsPath(plugin?.name ?? npmPackage),
description: plugin?.description ?? installedPkg.description,
});
} catch {
// Plugin installed via npm but failed to load — still register
} catch (err) {
// Plugin installed via npm but failed to load — register as disabled
console.log(fail(`Failed to load ${npmPackage}: ${(err as Error).message}`));
pluginRegistry.register(npmPackage, {
version: 'unknown',
source: 'npm',
enabled: true,
enabled: false,
settingsPath: settingsManager.getSettingsPath(npmPackage),
});
}