CLI: load plugins for agents command preaction

This commit is contained in:
Gustavo Madeira Santana
2026-02-25 18:46:48 -05:00
parent d81132c916
commit 3df4df7387
2 changed files with 11 additions and 0 deletions

View File

@@ -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"],

View File

@@ -25,6 +25,7 @@ const PLUGIN_REQUIRED_COMMANDS = new Set([
"message",
"channels",
"directory",
"agents",
"configure",
"onboard",
]);