From bfb6c6290f178b3a92a3fd13db0e2afe0bc858c6 Mon Sep 17 00:00:00 2001 From: scoootscooob Date: Mon, 2 Mar 2026 12:12:49 -0800 Subject: [PATCH] fix: distinguish warning message for non-OpenClaw vs missing npm package Address Greptile review: show "not a valid OpenClaw plugin" when the npm package was found but lacks openclaw.extensions, instead of the misleading "npm package unavailable" message. Co-Authored-By: Claude Opus 4.6 --- src/cli/plugins-cli.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/cli/plugins-cli.ts b/src/cli/plugins-cli.ts index 954359c1908..258cdd2a7fb 100644 --- a/src/cli/plugins-cli.ts +++ b/src/cli/plugins-cli.ts @@ -638,11 +638,10 @@ export function registerPluginsCli(program: Command) { logger: createPluginInstallLogger(), }); if (!result.ok) { - const shouldTryBundledFallback = - isPackageNotFoundInstallError(result.error) || isNotAnOpenClawPluginError(result.error); - const bundledFallback = shouldTryBundledFallback - ? findBundledPluginByNpmSpec({ spec: raw }) - : undefined; + const isNpmNotFound = isPackageNotFoundInstallError(result.error); + const isNotPlugin = isNotAnOpenClawPluginError(result.error); + const bundledFallback = + isNpmNotFound || isNotPlugin ? findBundledPluginByNpmSpec({ spec: raw }) : undefined; if (!bundledFallback) { defaultRuntime.error(result.error); process.exit(1); @@ -680,7 +679,9 @@ export function registerPluginsCli(program: Command) { logSlotWarnings(slotResult.warnings); defaultRuntime.log( theme.warn( - `npm package unavailable for ${raw}; using bundled plugin at ${shortenHomePath(bundledFallback.localPath)}.`, + isNpmNotFound + ? `npm package unavailable for ${raw}; using bundled plugin at ${shortenHomePath(bundledFallback.localPath)}.` + : `npm package "${raw}" is not a valid OpenClaw plugin; using bundled plugin at ${shortenHomePath(bundledFallback.localPath)}.`, ), ); defaultRuntime.log(`Installed plugin: ${bundledFallback.pluginId}`);