Merge 7caf1239ad429e702248ecba51da7ab291adea51 into 598f1826d8b2bc969aace2c6459824737667218c

This commit is contained in:
Tomi 2026-03-21 03:15:10 +00:00 committed by GitHub
commit 139ed2cfbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
import { routeLogsToStderr } from "../logging.js";
import { listAgentIds } from "../agents/agent-scope.js";
import { formatCliCommand } from "../cli/command-format.js";
import type { CliDeps } from "../cli/deps.js";
@ -179,6 +180,11 @@ export async function agentViaGatewayCommand(opts: AgentCliOpts, runtime: Runtim
}
export async function agentCliCommand(opts: AgentCliOpts, runtime: RuntimeEnv, deps?: CliDeps) {
// When --json is set, route all logs to stderr so only the JSON result appears on stdout.
if (opts.json) {
routeLogsToStderr();
}
const localOpts = {
...opts,
agentId: opts.agent,