mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-10 02:23:59 +00:00
fix(cli): reduce plugin hook fallback noise (#100554)
* fix(cli): reduce plugin hook fallback noise Co-authored-by: Vincent Koc <vincentkoc@ieee.org> * docs(changelog): defer plugin diagnostic note --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
committed by
GitHub
parent
e9a5dc9bf6
commit
a0e591c863
@@ -2,6 +2,7 @@
|
||||
import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { HOOK_INSTALL_ERROR_CODE } from "../hooks/install.js";
|
||||
import type { PluginKind } from "../plugins/plugin-kind.types.js";
|
||||
import { loadPluginMetadataSnapshot } from "../plugins/plugin-metadata-snapshot.js";
|
||||
import { applyExclusiveSlotSelection } from "../plugins/slots.js";
|
||||
@@ -169,10 +170,10 @@ export function enableInternalHookEntries(
|
||||
|
||||
export function formatPluginInstallWithHookFallbackError(
|
||||
pluginError: string,
|
||||
hookError: string,
|
||||
hookFallback: { error: string; code?: string },
|
||||
): string {
|
||||
const formattedPluginError = formatPluginInstallAttemptError(pluginError);
|
||||
const formattedHookError = formatPluginInstallAttemptError(hookError);
|
||||
const formattedHookError = formatPluginInstallAttemptError(hookFallback.error);
|
||||
if (/plugin already exists: .+ \(delete it first\)/.test(pluginError)) {
|
||||
return `${formattedPluginError}\nUse \`openclaw plugins update <id-or-npm-spec>\` to upgrade the tracked plugin, or rerun install with \`--force\` to replace it.`;
|
||||
}
|
||||
@@ -182,6 +183,9 @@ export function formatPluginInstallWithHookFallbackError(
|
||||
) {
|
||||
return formattedPluginError;
|
||||
}
|
||||
if (hookFallback.code === HOOK_INSTALL_ERROR_CODE.MISSING_OPENCLAW_HOOKS) {
|
||||
return formattedPluginError;
|
||||
}
|
||||
return `${formattedPluginError}\nAlso not a valid hook pack: ${formattedHookError}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user