fix(cli): load plugin registry for configure and onboard commands (#17266)

(cherry picked from commit 644badd40d)
This commit is contained in:
Marcus Castro
2026-02-23 10:42:05 -03:00
committed by Peter Steinberger
parent 792bd6195c
commit 58ce0a89ec
2 changed files with 27 additions and 1 deletions

View File

@@ -80,6 +80,8 @@ describe("registerPreActionHooks", () => {
program.command("update").action(async () => {});
program.command("channels").action(async () => {});
program.command("directory").action(async () => {});
program.command("configure").action(async () => {});
program.command("onboard").action(async () => {});
program
.command("message")
.command("send")
@@ -125,6 +127,24 @@ describe("registerPreActionHooks", () => {
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
});
it("loads plugin registry for configure command", async () => {
await runCommand({
parseArgv: ["configure"],
processArgv: ["node", "openclaw", "configure"],
});
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
});
it("loads plugin registry for onboard command", async () => {
await runCommand({
parseArgv: ["onboard"],
processArgv: ["node", "openclaw", "onboard"],
});
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
});
it("skips config guard for doctor and completion commands", async () => {
await runCommand({
parseArgv: ["doctor"],

View File

@@ -21,7 +21,13 @@ function setProcessTitleForCommand(actionCommand: Command) {
}
// Commands that need channel plugins loaded
const PLUGIN_REQUIRED_COMMANDS = new Set(["message", "channels", "directory"]);
const PLUGIN_REQUIRED_COMMANDS = new Set([
"message",
"channels",
"directory",
"configure",
"onboard",
]);
function getRootCommand(command: Command): Command {
let current = command;