mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 07:03:25 +00:00
feat: add branchSummary.skipPrompt setting to skip summarization prompt (#1792)
When enabled, /tree navigation skips the 'Summarize branch?' prompt and defaults to no summary, reducing friction for users who never want branch summaries. Closes #1791
This commit is contained in:
parent
b4f9986d23
commit
f710c2705d
3 changed files with 33 additions and 23 deletions
|
|
@ -69,6 +69,7 @@ Edit directly or use `/settings` for common options.
|
||||||
| Setting | Type | Default | Description |
|
| Setting | Type | Default | Description |
|
||||||
|---------|------|---------|-------------|
|
|---------|------|---------|-------------|
|
||||||
| `branchSummary.reserveTokens` | number | `16384` | Tokens reserved for branch summarization |
|
| `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
|
### Retry
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ export interface CompactionSettings {
|
||||||
|
|
||||||
export interface BranchSummarySettings {
|
export interface BranchSummarySettings {
|
||||||
reserveTokens?: number; // default: 16384 (tokens reserved for prompt + LLM response)
|
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 {
|
export interface RetrySettings {
|
||||||
|
|
@ -607,12 +608,17 @@ export class SettingsManager {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
getBranchSummarySettings(): { reserveTokens: number } {
|
getBranchSummarySettings(): { reserveTokens: number; skipPrompt: boolean } {
|
||||||
return {
|
return {
|
||||||
reserveTokens: this.settings.branchSummary?.reserveTokens ?? 16384,
|
reserveTokens: this.settings.branchSummary?.reserveTokens ?? 16384,
|
||||||
|
skipPrompt: this.settings.branchSummary?.skipPrompt ?? false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getBranchSummarySkipPrompt(): boolean {
|
||||||
|
return this.settings.branchSummary?.skipPrompt ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
getRetryEnabled(): boolean {
|
getRetryEnabled(): boolean {
|
||||||
return this.settings.retry?.enabled ?? true;
|
return this.settings.retry?.enabled ?? true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3448,31 +3448,34 @@ export class InteractiveMode {
|
||||||
let wantsSummary = false;
|
let wantsSummary = false;
|
||||||
let customInstructions: string | undefined;
|
let customInstructions: string | undefined;
|
||||||
|
|
||||||
while (true) {
|
// Check if we should skip the prompt (user preference to always default to no summary)
|
||||||
const summaryChoice = await this.showExtensionSelector("Summarize branch?", [
|
if (!this.settingsManager.getBranchSummarySkipPrompt()) {
|
||||||
"No summary",
|
while (true) {
|
||||||
"Summarize",
|
const summaryChoice = await this.showExtensionSelector("Summarize branch?", [
|
||||||
"Summarize with custom prompt",
|
"No summary",
|
||||||
]);
|
"Summarize",
|
||||||
|
"Summarize with custom prompt",
|
||||||
|
]);
|
||||||
|
|
||||||
if (summaryChoice === undefined) {
|
if (summaryChoice === undefined) {
|
||||||
// User pressed escape - re-show tree selector with same selection
|
// User pressed escape - re-show tree selector with same selection
|
||||||
this.showTreeSelector(entryId);
|
this.showTreeSelector(entryId);
|
||||||
return;
|
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;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// User made a complete choice
|
wantsSummary = summaryChoice !== "No summary";
|
||||||
break;
|
|
||||||
|
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
|
// Set up escape handler and loader if summarizing
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue