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

@ -1650,11 +1650,13 @@ export class AgentSession {
if (!apiKey) {
throw new Error(`No API key for ${model.provider}`);
}
const branchSummarySettings = this.settingsManager.getBranchSummarySettings();
const result = await generateBranchSummary(entriesToSummarize, {
model,
apiKey,
signal: this._branchSummaryAbortController.signal,
customInstructions: options.customInstructions,
reserveFraction: branchSummarySettings.reserveFraction,
});
this._branchSummaryAbortController = undefined;
if (result.aborted) {