feat(coding-agent): supported omitting thinking summaries

- Added `omitThinking` setting to allow instruction of upstream providers to omit thinking summaries.
- Decoupled UI-level thinking block visibility from backend data retrieval.
- Updated session creation to use `omitThinking` for configuring provider-side summaries.
This commit is contained in:
can1357
2026-06-20 08:14:54 +02:00
parent 571eb5c4db
commit 282963ee2f
6 changed files with 21 additions and 8 deletions
@@ -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,
+3 -3
View File
@@ -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) {
@@ -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) {
@@ -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
+1 -1
View File
@@ -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),
@@ -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();