fix(cli): keep plugin help registration reachable

This commit is contained in:
Peter Steinberger
2026-05-10 04:03:36 +01:00
parent aafadd45a5
commit 4b6cb9e9bc
3 changed files with 6 additions and 6 deletions

View File

@@ -353,7 +353,7 @@ describe("channel-auth", () => {
});
await expect(runChannelLogin({ channel: "whatsapp" }, runtime)).rejects.toThrow(
'Channel "whatsapp" does not support login. Run `openclaw channels status --channel whatsapp` to inspect supported actions.',
'Channel "whatsapp" does not support login. Run openclaw channels status --channel whatsapp to inspect supported actions.',
);
});
@@ -564,7 +564,7 @@ describe("channel-auth", () => {
});
await expect(runChannelLogout({ channel: "whatsapp" }, runtime)).rejects.toThrow(
'Channel "whatsapp" does not support logout. Run `openclaw channels status --channel whatsapp` to inspect supported actions.',
'Channel "whatsapp" does not support logout. Run openclaw channels status --channel whatsapp to inspect supported actions.',
);
});
});

View File

@@ -18,15 +18,15 @@ export function shouldSkipPluginCommandRegistration(params: {
hasBuiltinPrimary: boolean;
}): boolean {
const invocation = resolveCliArgvInvocation(params.argv);
if (params.primary === "help") {
return invocation.hasHelpOrVersion && invocation.commandPath.length <= 1;
}
if (invocation.hasHelpOrVersion) {
return true;
}
if (params.hasBuiltinPrimary) {
return true;
}
if (params.primary === "help") {
return invocation.hasHelpOrVersion && invocation.commandPath.length <= 1;
}
if (!params.primary) {
return invocation.hasHelpOrVersion;
}

View File

@@ -189,7 +189,7 @@ describe("plugins cli policy mutations", () => {
);
expect(runtimeErrors).toContain(
"Plugin not found: missing-plugin. Run `openclaw plugins list` to see installed plugins, or `openclaw plugins search missing-plugin` to look for installable plugins.",
"Plugin not found: missing-plugin. Run openclaw plugins list to see installed plugins, or openclaw plugins search missing-plugin to look for installable plugins.",
);
expect(enablePluginInConfig).not.toHaveBeenCalled();
expect(writeConfigFile).not.toHaveBeenCalled();