From 8ecb95a46e8bcb784a01e01c58fc1ee5288eb950 Mon Sep 17 00:00:00 2001 From: Lakshman Patel Date: Mon, 7 Sep 2026 14:00:14 +0530 Subject: [PATCH] fix: honor --quiet for --print tool-call stderr output --print already honored --quiet for the usage footer (PR #289) and exec now honors it for tool activity (PR #293), but --print's [ToolName] stderr labels were emitted unconditionally. Gate them on !IsQuiet() so --print --quiet is fully clean (machine-parseable stdout and no decoration on stderr), matching exec and the --quiet contract. stream-json output is unchanged. --- cmd/chat_print.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/chat_print.go b/cmd/chat_print.go index 0e34ddfc..35aab773 100644 --- a/cmd/chat_print.go +++ b/cmd/chat_print.go @@ -105,7 +105,7 @@ func runPrint(text string) error { case "tool_use": if outputFormat == "stream-json" { writePrintEvent(sessionID, "tool_use", "", ev.ToolName) - } else { + } else if !IsQuiet() { _, _ = fmt.Fprintf(os.Stderr, "\n%s\n", auditTint("["+ev.ToolName+"]", infoSky)) } case "tool_result": @@ -116,7 +116,7 @@ func runPrint(text string) error { } if outputFormat == "stream-json" { writePrintEvent(sessionID, "tool_result", content, ev.ToolName) - } else { + } else if !IsQuiet() { _, _ = fmt.Fprintf(os.Stderr, "%s %s\n", auditTint("["+ev.ToolName+"]", infoSky), content) } case "usage":