Use AgentMessage in BranchPreparation and add BranchSummarySettings

- BranchPreparation now uses AgentMessage[] instead of custom type
- Reuse getMessageFromEntry pattern from compaction.ts
- Add BranchSummarySettings with reserveFraction to settings.json
- Add getBranchSummarySettings() to SettingsManager
- Use settings for reserveFraction instead of hardcoded value
This commit is contained in:
Mario Zechner 2025-12-29 21:33:04 +01:00
parent 08fab16e2d
commit 839a46e6fe
3 changed files with 110 additions and 107 deletions

View file

@ -8,6 +8,10 @@ export interface CompactionSettings {
keepRecentTokens?: number; // default: 20000
}
export interface BranchSummarySettings {
reserveFraction?: number; // default: 0.2 (fraction of context window reserved for summary)
}
export interface RetrySettings {
enabled?: boolean; // default: true
maxRetries?: number; // default: 3
@ -38,6 +42,7 @@ export interface Settings {
queueMode?: "all" | "one-at-a-time";
theme?: string;
compaction?: CompactionSettings;
branchSummary?: BranchSummarySettings;
retry?: RetrySettings;
hideThinkingBlock?: boolean;
shellPath?: string; // Custom shell path (e.g., for Cygwin users on Windows)
@ -255,6 +260,12 @@ export class SettingsManager {
};
}
getBranchSummarySettings(): { reserveFraction: number } {
return {
reserveFraction: this.settings.branchSummary?.reserveFraction ?? 0.2,
};
}
getRetryEnabled(): boolean {
return this.settings.retry?.enabled ?? true;
}