diff --git a/packages/coding-agent/src/config/settings-schema.ts b/packages/coding-agent/src/config/settings-schema.ts index ed1623c68..7ba5907a3 100644 --- a/packages/coding-agent/src/config/settings-schema.ts +++ b/packages/coding-agent/src/config/settings-schema.ts @@ -900,6 +900,18 @@ export const SETTINGS_SCHEMA = { }, }, + omitThinking: { + type: "boolean", + default: false, + ui: { + tab: "model", + group: "Thinking", + label: "Omit Thinking summaries", + description: + "Instruct upstream providers to completely omit thinking summaries from responses (where supported)", + }, + }, + "model.loopGuard.enabled": { type: "boolean", default: true, diff --git a/packages/coding-agent/src/main.ts b/packages/coding-agent/src/main.ts index 1f5971f3b..c6cbaa411 100644 --- a/packages/coding-agent/src/main.ts +++ b/packages/coding-agent/src/main.ts @@ -1056,11 +1056,11 @@ 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 + // thinking before the session is built — otherwise a passive omitThinking // setting makes the provider omit summaries and the flag prints nothing. An - // explicit --hide-thinking below still wins. + // explicit --hide-thinking block display option still wins for output display. if (parsedArgs.printThoughts && !isProtocolMode && !isInteractive) { - settingsInstance.override("hideThinkingBlock", false); + settingsInstance.override("omitThinking", false); } // Apply --hide-thinking CLI flag (ephemeral, not persisted) if (parsedArgs.hideThinking) { diff --git a/packages/coding-agent/src/modes/controllers/input-controller.ts b/packages/coding-agent/src/modes/controllers/input-controller.ts index cd21684f5..3cf7cd320 100644 --- a/packages/coding-agent/src/modes/controllers/input-controller.ts +++ b/packages/coding-agent/src/modes/controllers/input-controller.ts @@ -1524,7 +1524,6 @@ export class InputController { toggleThinkingBlockVisibility(): void { this.ctx.hideThinkingBlock = !this.ctx.hideThinkingBlock; this.ctx.settings.set("hideThinkingBlock", this.ctx.hideThinkingBlock); - this.ctx.session.agent.hideThinkingSummary = this.ctx.hideThinkingBlock; for (const child of this.ctx.chatContainer.children) { if (child instanceof AssistantMessageComponent) { diff --git a/packages/coding-agent/src/modes/controllers/selector-controller.ts b/packages/coding-agent/src/modes/controllers/selector-controller.ts index f5e0b2410..925c2fc5b 100644 --- a/packages/coding-agent/src/modes/controllers/selector-controller.ts +++ b/packages/coding-agent/src/modes/controllers/selector-controller.ts @@ -314,9 +314,8 @@ export class SelectorController { } } break; - case "hideThinking": + case "hideThinkingBlock": this.ctx.hideThinkingBlock = value as boolean; - this.ctx.session.agent.hideThinkingSummary = value as boolean; for (const child of this.ctx.chatContainer.children) { if (child instanceof AssistantMessageComponent) { child.setHideThinkingBlock(value as boolean); @@ -327,6 +326,9 @@ export class SelectorController { // InputController.toggleThinkingBlockVisibility). this.ctx.ui.resetDisplay(); break; + case "omitThinking": + this.ctx.session.agent.hideThinkingSummary = value as boolean; + break; case "display.cacheMissMarker": // Rebuild re-runs the usage-based detection under the new setting so // markers appear/disappear; full reset retires any already committed diff --git a/packages/coding-agent/src/sdk.ts b/packages/coding-agent/src/sdk.ts index cd2462163..181ccbd9e 100644 --- a/packages/coding-agent/src/sdk.ts +++ b/packages/coding-agent/src/sdk.ts @@ -2474,7 +2474,7 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {} presencePenalty: settings.get("presencePenalty") >= 0 ? settings.get("presencePenalty") : undefined, repetitionPenalty: settings.get("repetitionPenalty") >= 0 ? settings.get("repetitionPenalty") : undefined, serviceTier: initialServiceTier, - hideThinkingSummary: settings.get("hideThinkingBlock"), + hideThinkingSummary: settings.get("omitThinking"), kimiApiFormat: settings.get("providers.kimiApiFormat") ?? "anthropic", preferWebsockets: preferOpenAICodexWebsockets, getToolContext: tc => toolContextStore.getContext(tc), diff --git a/packages/coding-agent/test/input-controller-thinking-visibility.test.ts b/packages/coding-agent/test/input-controller-thinking-visibility.test.ts index c8383d0c6..432815398 100644 --- a/packages/coding-agent/test/input-controller-thinking-visibility.test.ts +++ b/packages/coding-agent/test/input-controller-thinking-visibility.test.ts @@ -33,7 +33,7 @@ describe("InputController thinking visibility", () => { expect(ctx.hideThinkingBlock).toBe(true); expect(set).toHaveBeenCalledWith("hideThinkingBlock", true); - expect(ctx.session.agent.hideThinkingSummary).toBe(true); + expect(ctx.session.agent.hideThinkingSummary).toBe(false); expect(chatContainer.children).toEqual([pendingUserMessage, assistant, loadingIndicator]); expect(clear).not.toHaveBeenCalled(); expect(addChild).not.toHaveBeenCalled();