fix: keep status --json stdout clean (#52449) (thanks @cgdusek)

This commit is contained in:
Peter Steinberger
2026-03-22 21:49:24 -07:00
parent 03c4bacbfb
commit 97e4f37171
7 changed files with 72 additions and 36 deletions

View File

@@ -352,8 +352,8 @@ describe("registerPreActionHooks", () => {
});
await runPreAction({
parseArgv: ["agents"],
processArgv: ["node", "openclaw", "agents", "--json"],
parseArgv: ["agents", "list"],
processArgv: ["node", "openclaw", "agents", "list", "--json"],
});
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalled();
@@ -369,8 +369,8 @@ describe("registerPreActionHooks", () => {
});
await runPreAction({
parseArgv: ["agents"],
processArgv: ["node", "openclaw", "agents"],
parseArgv: ["agents", "list"],
processArgv: ["node", "openclaw", "agents", "list"],
});
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalled();

View File

@@ -139,7 +139,6 @@ export function registerPreActionHooks(program: Command, programVersion: string)
commandPath,
...(jsonOutputMode ? { suppressDoctorStdout: true } : {}),
});
<<<<<<< HEAD
// Load plugins for commands that need channel access.
// When --json output is active, temporarily route logs to stderr so plugin
// registration messages don't corrupt the JSON payload on stdout.