From 76a42da676f673d30c3f4686069b77dd87b97fb7 Mon Sep 17 00:00:00 2001 From: Lucas Czekaj Date: Thu, 22 Jan 2026 16:58:42 -0800 Subject: [PATCH] fix: suppress spinner in logs --follow mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The progress spinner was being shown for each gateway RPC call during log tailing, causing repeated spinner frames (◇ │) to appear every polling interval. Add a `progress` option to `callGatewayFromCli` and disable the spinner during follow mode polling to keep output clean. Co-Authored-By: Claude Opus 4.5 --- src/cli/gateway-rpc.ts | 5 +++-- src/cli/logs-cli.ts | 16 ++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/cli/gateway-rpc.ts b/src/cli/gateway-rpc.ts index 8f99fb461..568b1a0e2 100644 --- a/src/cli/gateway-rpc.ts +++ b/src/cli/gateway-rpc.ts @@ -23,13 +23,14 @@ export async function callGatewayFromCli( method: string, opts: GatewayRpcOpts, params?: unknown, - extra?: { expectFinal?: boolean }, + extra?: { expectFinal?: boolean; progress?: boolean }, ) { + const showProgress = extra?.progress ?? opts.json !== true; return await withProgress( { label: `Gateway ${method}`, indeterminate: true, - enabled: opts.json !== true, + enabled: showProgress, }, async () => await callGateway({ diff --git a/src/cli/logs-cli.ts b/src/cli/logs-cli.ts index df9a5c435..e5af23af8 100644 --- a/src/cli/logs-cli.ts +++ b/src/cli/logs-cli.ts @@ -41,14 +41,16 @@ function parsePositiveInt(value: string | undefined, fallback: number): number { async function fetchLogs( opts: LogsCliOptions, cursor: number | undefined, + showProgress: boolean, ): Promise { const limit = parsePositiveInt(opts.limit, 200); const maxBytes = parsePositiveInt(opts.maxBytes, 250_000); - const payload = await callGatewayFromCli("logs.tail", opts, { - cursor, - limit, - maxBytes, - }); + const payload = await callGatewayFromCli( + "logs.tail", + opts, + { cursor, limit, maxBytes }, + { progress: showProgress }, + ); if (!payload || typeof payload !== "object") { throw new Error("Unexpected logs.tail response"); } @@ -194,8 +196,10 @@ 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; try { - payload = await fetchLogs(opts, cursor); + payload = await fetchLogs(opts, cursor, showProgress); } catch (err) { emitGatewayError(err, opts, jsonMode ? "json" : "text", rich, emitJsonLine, errorLine); process.exit(1);