From 3df4df7387a092e1e050cfa70fe73e49604100a8 Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Wed, 25 Feb 2026 18:46:48 -0500 Subject: [PATCH] CLI: load plugins for agents command preaction --- src/cli/program/preaction.test.ts | 10 ++++++++++ src/cli/program/preaction.ts | 1 + 2 files changed, 11 insertions(+) diff --git a/src/cli/program/preaction.test.ts b/src/cli/program/preaction.test.ts index bf4184d362a..caa9dd24869 100644 --- a/src/cli/program/preaction.test.ts +++ b/src/cli/program/preaction.test.ts @@ -80,6 +80,7 @@ describe("registerPreActionHooks", () => { program.command("update").action(async () => {}); program.command("channels").action(async () => {}); program.command("directory").action(async () => {}); + program.command("agents").action(async () => {}); program.command("configure").action(async () => {}); program.command("onboard").action(async () => {}); program @@ -145,6 +146,15 @@ describe("registerPreActionHooks", () => { expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1); }); + it("loads plugin registry for agents command", async () => { + await runCommand({ + parseArgv: ["agents"], + processArgv: ["node", "openclaw", "agents"], + }); + + expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1); + }); + it("skips config guard for doctor and completion commands", async () => { await runCommand({ parseArgv: ["doctor"], diff --git a/src/cli/program/preaction.ts b/src/cli/program/preaction.ts index 6a9abc3e99e..6a232386b14 100644 --- a/src/cli/program/preaction.ts +++ b/src/cli/program/preaction.ts @@ -25,6 +25,7 @@ const PLUGIN_REQUIRED_COMMANDS = new Set([ "message", "channels", "directory", + "agents", "configure", "onboard", ]);