Compaction: avoid duplicate merge focus header

This commit is contained in:
Rodrigo Uroz
2026-02-24 16:38:42 +00:00
parent 267084ea2d
commit 831eee9ef8
2 changed files with 24 additions and 2 deletions

View File

@@ -335,8 +335,9 @@ export async function summarizeInStages(params: {
timestamp: Date.now(),
}));
const mergeInstructions = params.customInstructions
? `${MERGE_SUMMARIES_INSTRUCTIONS}\n\nAdditional focus:\n${params.customInstructions}`
const custom = params.customInstructions?.trim();
const mergeInstructions = custom
? `${MERGE_SUMMARIES_INSTRUCTIONS}\n\n${custom}`
: MERGE_SUMMARIES_INSTRUCTIONS;
return summarizeWithFallback({