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.
This commit is contained in:
can1357
2026-06-18 22:34:01 +02:00
parent 0b684f9929
commit b25d7472e4
+7
View File
@@ -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);