From 6171195350889efa34e3fb9d19a6927f0c606b49 Mon Sep 17 00:00:00 2001 From: bielie Date: Thu, 5 Feb 2026 13:46:28 +0800 Subject: [PATCH] Adjust summary prompt labels and budgets --- modules/story-summary/generate/prompt.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/story-summary/generate/prompt.js b/modules/story-summary/generate/prompt.js index fc60149..c5d007f 100644 --- a/modules/story-summary/generate/prompt.js +++ b/modules/story-summary/generate/prompt.js @@ -32,6 +32,7 @@ function canNotifyRecallFail() { // ───────────────────────────────────────────────────────────────────────────── const MAIN_BUDGET_MAX = 10000; // 主装配预算(世界/事件/远期/弧光) +const ORPHAN_MAX = 2500; // 远期上限 const RECENT_ORPHAN_MAX = 5000; // [待整理] 独立预算 const TOTAL_BUDGET_MAX = 15000; // 总预算(用于日志显示) const L3_MAX = 2000; @@ -174,7 +175,7 @@ function formatArcLine(a) { .filter(Boolean); if (moments.length) { - return `- ${a.name}:${moments.join(" → ")}(当前:${a.trajectory})`; + return `- ${a.name}:${moments.join(" → ")}`; } return `- ${a.name}:${a.trajectory}`; } @@ -657,7 +658,7 @@ async function buildVectorPrompt(store, recallResult, causalById, queryEntities const orphans = orphanCandidates .sort((a, b) => (a.floor - b.floor) || ((a.chunkIdx ?? 0) - (b.chunkIdx ?? 0))); - const l1Budget = { used: 0, max: total.max - total.used }; + const l1Budget = { used: 0, max: Math.min(ORPHAN_MAX, total.max - total.used) }; let l0Count = 0; let contextPairsCount = 0; @@ -807,13 +808,13 @@ async function buildVectorPrompt(store, recallResult, causalById, queryEntities if (assembled.orphans.lines.length) { sections.push(`[更早以前] 记忆里残留的老画面\n${assembled.orphans.lines.join("\n")}`); } - // 5. 待整理 → 刚发生的 + // 5. 待整理 → 近期 if (assembled.recentOrphans.lines.length) { - sections.push(`[刚发生的] 还没来得及想明白\n${assembled.recentOrphans.lines.join("\n")}`); + sections.push(`[近期] 清晰但还没整理\n${assembled.recentOrphans.lines.join("\n")}`); } // 6. 人物弧光 → 这些人 if (assembled.arcs.lines.length) { - sections.push(`[这些人] 他们现在怎样了\n${assembled.arcs.lines.join("\n")}`); + sections.push(`[这些人] 他们的弧光\n${assembled.arcs.lines.join("\n")}`); } if (!sections.length) {