mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-17 10:50:47 +00:00
fix(cli): trim plugin preloads for setup-safe commands
This commit is contained in:
@@ -122,6 +122,7 @@ describe("registerPreActionHooks", () => {
|
||||
.command("agent")
|
||||
.requiredOption("-m, --message <text>")
|
||||
.option("--local")
|
||||
.option("--json")
|
||||
.action(() => {});
|
||||
program
|
||||
.command("status")
|
||||
@@ -214,15 +215,15 @@ describe("registerPreActionHooks", () => {
|
||||
|
||||
vi.clearAllMocks();
|
||||
await runPreAction({
|
||||
parseArgv: ["message", "send"],
|
||||
processArgv: ["node", "openclaw", "message", "send"],
|
||||
parseArgv: ["agents", "list"],
|
||||
processArgv: ["node", "openclaw", "agents", "list"],
|
||||
});
|
||||
|
||||
expect(setVerboseMock).toHaveBeenCalledWith(false);
|
||||
expect(process.env.NODE_NO_WARNINGS).toBe("1");
|
||||
expect(ensureConfigReadyMock).toHaveBeenCalledWith({
|
||||
runtime: runtimeMock,
|
||||
commandPath: ["message", "send"],
|
||||
commandPath: ["agents", "list"],
|
||||
});
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledWith({ scope: "all" });
|
||||
processTitleSetSpy.mockRestore();
|
||||
@@ -393,8 +394,8 @@ describe("registerPreActionHooks", () => {
|
||||
|
||||
it("routes logs to stderr in --json mode so stdout stays clean", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["message", "send"],
|
||||
processArgv: ["node", "openclaw", "message", "send", "--json"],
|
||||
parseArgv: ["agent"],
|
||||
processArgv: ["node", "openclaw", "agent", "--message", "hi", "--json"],
|
||||
});
|
||||
|
||||
expect(routeLogsToStderrMock).toHaveBeenCalledOnce();
|
||||
@@ -473,8 +474,8 @@ describe("registerPreActionHooks", () => {
|
||||
});
|
||||
|
||||
await runPreAction({
|
||||
parseArgv: ["message", "send"],
|
||||
processArgv: ["node", "openclaw", "message", "send", "--json"],
|
||||
parseArgv: ["agent"],
|
||||
processArgv: ["node", "openclaw", "agent", "--message", "hi", "--json"],
|
||||
});
|
||||
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalled();
|
||||
|
||||
Reference in New Issue
Block a user