From b25d7472e4be275426d2badd4841d5d16829b1ba Mon Sep 17 00:00:00 2001 From: can1357 Date: Thu, 18 Jun 2026 22:34:01 +0200 Subject: [PATCH] fix(coding-agent): surface thinking for --print-thoughts when hidden Threading printThoughts only into runPrintMode is too late when hideThinkingBlock is set (settings or --hide-thinking): the session is built with hideThinkingSummary=true, so the provider omits reasoning summaries and --print-thoughts prints nothing. Override hideThinkingBlock to false for single-shot print mode before session creation, gated on print mode; an explicit --hide-thinking still wins. --- packages/coding-agent/src/main.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/coding-agent/src/main.ts b/packages/coding-agent/src/main.ts index 521ed719c..30a459db2 100644 --- a/packages/coding-agent/src/main.ts +++ b/packages/coding-agent/src/main.ts @@ -1039,6 +1039,13 @@ export async function runRootCommand( }); } + // --print-thoughts (single-shot print mode) must surface reasoning, so un-hide + // thinking before the session is built — otherwise a passive hideThinkingBlock + // setting makes the provider omit summaries and the flag prints nothing. An + // explicit --hide-thinking below still wins. + if (parsedArgs.printThoughts && !isProtocolMode && !isInteractive) { + settingsInstance.override("hideThinkingBlock", false); + } // Apply --hide-thinking CLI flag (ephemeral, not persisted) if (parsedArgs.hideThinking) { settingsInstance.override("hideThinkingBlock", true);