From f6f25feb3eb79d17b167850c13d7b7f8b14bc5a5 Mon Sep 17 00:00:00 2001 From: Volodymyr Vreshch Date: Tue, 19 May 2026 10:05:00 +0000 Subject: [PATCH] chore(cli): route daemon version-mismatch notice to stderr console.log in ensureDaemon leaked into stdout when --json or pipe consumers ran a command while the daemon was on a stale version. Routing this operational notice to stderr keeps stdout clean for parseable output. --- src/utils/ensure-daemon.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/ensure-daemon.ts b/src/utils/ensure-daemon.ts index 2337428..d83bc1e 100644 --- a/src/utils/ensure-daemon.ts +++ b/src/utils/ensure-daemon.ts @@ -17,7 +17,10 @@ export const ensureDaemon = async (): Promise => { try { const health = await get('/api/health'); if (health.version !== VERSION) { - console.log( + // Route to stderr — this is an operational notice, not command output. + // Without this, `--json` / pipe consumers get the yellow string mixed + // into their stdout when the daemon is upgraded mid-session. + console.error( chalk.yellow( `Daemon version mismatch (daemon: ${health.version}, cli: ${VERSION}) — restarting...` )