diff --git a/packages/coding-agent/docs/settings.md b/packages/coding-agent/docs/settings.md index 219f5d5f..acf036e2 100644 --- a/packages/coding-agent/docs/settings.md +++ b/packages/coding-agent/docs/settings.md @@ -69,6 +69,7 @@ Edit directly or use `/settings` for common options. | Setting | Type | Default | Description | |---------|------|---------|-------------| | `branchSummary.reserveTokens` | number | `16384` | Tokens reserved for branch summarization | +| `branchSummary.skipPrompt` | boolean | `false` | Skip "Summarize branch?" prompt on `/tree` navigation (defaults to no summary) | ### Retry diff --git a/packages/coding-agent/src/core/settings-manager.ts b/packages/coding-agent/src/core/settings-manager.ts index b3cd8863..7cdd1048 100644 --- a/packages/coding-agent/src/core/settings-manager.ts +++ b/packages/coding-agent/src/core/settings-manager.ts @@ -12,6 +12,7 @@ export interface CompactionSettings { export interface BranchSummarySettings { reserveTokens?: number; // default: 16384 (tokens reserved for prompt + LLM response) + skipPrompt?: boolean; // default: false - when true, skips "Summarize branch?" prompt and defaults to no summary } export interface RetrySettings { @@ -607,12 +608,17 @@ export class SettingsManager { }; } - getBranchSummarySettings(): { reserveTokens: number } { + getBranchSummarySettings(): { reserveTokens: number; skipPrompt: boolean } { return { reserveTokens: this.settings.branchSummary?.reserveTokens ?? 16384, + skipPrompt: this.settings.branchSummary?.skipPrompt ?? false, }; } + getBranchSummarySkipPrompt(): boolean { + return this.settings.branchSummary?.skipPrompt ?? false; + } + getRetryEnabled(): boolean { return this.settings.retry?.enabled ?? true; } diff --git a/packages/coding-agent/src/modes/interactive/interactive-mode.ts b/packages/coding-agent/src/modes/interactive/interactive-mode.ts index 6e448524..43012dc8 100644 --- a/packages/coding-agent/src/modes/interactive/interactive-mode.ts +++ b/packages/coding-agent/src/modes/interactive/interactive-mode.ts @@ -3448,31 +3448,34 @@ export class InteractiveMode { let wantsSummary = false; let customInstructions: string | undefined; - while (true) { - const summaryChoice = await this.showExtensionSelector("Summarize branch?", [ - "No summary", - "Summarize", - "Summarize with custom prompt", - ]); + // Check if we should skip the prompt (user preference to always default to no summary) + if (!this.settingsManager.getBranchSummarySkipPrompt()) { + while (true) { + const summaryChoice = await this.showExtensionSelector("Summarize branch?", [ + "No summary", + "Summarize", + "Summarize with custom prompt", + ]); - if (summaryChoice === undefined) { - // User pressed escape - re-show tree selector with same selection - this.showTreeSelector(entryId); - return; - } - - wantsSummary = summaryChoice !== "No summary"; - - if (summaryChoice === "Summarize with custom prompt") { - customInstructions = await this.showExtensionEditor("Custom summarization instructions"); - if (customInstructions === undefined) { - // User cancelled - loop back to summary selector - continue; + if (summaryChoice === undefined) { + // User pressed escape - re-show tree selector with same selection + this.showTreeSelector(entryId); + return; } - } - // User made a complete choice - break; + wantsSummary = summaryChoice !== "No summary"; + + if (summaryChoice === "Summarize with custom prompt") { + customInstructions = await this.showExtensionEditor("Custom summarization instructions"); + if (customInstructions === undefined) { + // User cancelled - loop back to summary selector + continue; + } + } + + // User made a complete choice + break; + } } // Set up escape handler and loader if summarizing