From b72a3674a7d6a01f30f0c3ce987bfc9946e1a3fb Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 23 Jan 2026 01:29:09 +0000 Subject: [PATCH] fix: quiet logs progress output (#1472) (thanks @czekaj) --- CHANGELOG.md | 1 + src/cli/gateway-rpc.ts | 2 +- src/cli/logs-cli.test.ts | 17 +++++++++++++++++ src/cli/logs-cli.ts | 4 ++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 871c19857..a2aeadc5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Docs: https://docs.clawd.bot ### Fixes - BlueBubbles: stop typing indicator on idle/no-reply. (#1439) Thanks @Nicell. +- CLI: suppress progress spinner noise for `logs --follow` and JSON output. (#1472) Thanks @czekaj. - Auto-reply: only report a model switch when session state is available. (#1465) Thanks @robbyczgw-cla. - Control UI: resolve local avatar URLs with basePath across injection + identity RPC. (#1457) Thanks @dlauer. - Agents: surface concrete API error details instead of generic AI service errors. diff --git a/src/cli/gateway-rpc.ts b/src/cli/gateway-rpc.ts index 568b1a0e2..12c738fcf 100644 --- a/src/cli/gateway-rpc.ts +++ b/src/cli/gateway-rpc.ts @@ -25,7 +25,7 @@ export async function callGatewayFromCli( params?: unknown, extra?: { expectFinal?: boolean; progress?: boolean }, ) { - const showProgress = extra?.progress ?? opts.json !== true; + const showProgress = (extra?.progress ?? true) && opts.json !== true; return await withProgress( { label: `Gateway ${method}`, diff --git a/src/cli/logs-cli.test.ts b/src/cli/logs-cli.test.ts index f6d08f9dc..21aa47c82 100644 --- a/src/cli/logs-cli.test.ts +++ b/src/cli/logs-cli.test.ts @@ -82,4 +82,21 @@ describe("logs cli", () => { expect(stderrWrites.join("")).toContain("output stdout closed"); }); + + it("disables progress spinner in json mode", async () => { + callGatewayFromCli.mockResolvedValueOnce({ + file: "/tmp/clawdbot.log", + lines: [], + }); + + const { registerLogsCli } = await import("./logs-cli.js"); + const program = new Command(); + program.exitOverride(); + registerLogsCli(program); + + await program.parseAsync(["logs", "--json"], { from: "user" }); + + const extra = callGatewayFromCli.mock.calls[0]?.[3]; + expect(extra).toEqual({ progress: false }); + }); }); diff --git a/src/cli/logs-cli.ts b/src/cli/logs-cli.ts index e5af23af8..bccb27d77 100644 --- a/src/cli/logs-cli.ts +++ b/src/cli/logs-cli.ts @@ -196,8 +196,8 @@ export function registerLogsCli(program: Command) { while (true) { let payload: LogsTailPayload; - // Show progress spinner only on first fetch, not during follow polling - const showProgress = first && !opts.follow; + // Show progress spinner only on first fetch for non-follow, non-JSON output. + const showProgress = first && !opts.follow && !jsonMode; try { payload = await fetchLogs(opts, cursor, showProgress); } catch (err) {