From de12d3ba9e3b4cb196e2f8838277107efd9878bb Mon Sep 17 00:00:00 2001 From: xhgit <1+xhgit@noreply.git.xhmcl.com> Date: Sat, 14 Nov 2026 15:05:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(ai):=20=E8=A7=84=E5=88=92=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E8=AF=8D=E8=A1=A5=E5=9B=9E=E7=94=A8=E6=88=B7=E8=A6=81=E6=B1=82?= =?UTF-8?q?=E2=80=94=E2=80=94=E6=8C=87=E4=BB=A4=E6=AD=A4=E5=89=8D=E4=BB=8E?= =?UTF-8?q?=E6=9C=AA=E5=8F=91=E9=80=81=E7=BB=99=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 严重回归:PR #3 重写提示词时遗漏了「用户要求」段落,instruction 参数 从未写入提示词。模型只看到项目数据与规则,只能从对话历史里间接 推断用户意图,导致大量「未收到具体的中文剪辑要求」空方案。 本次把用户指令以独立段落写回提示词,并加测试断言指令必须出现。 --- desktop/core/providers.mjs | 3 +++ tests/providers.test.mjs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/desktop/core/providers.mjs b/desktop/core/providers.mjs index 49e7f58..1262ee3 100644 --- a/desktop/core/providers.mjs +++ b/desktop/core/providers.mjs @@ -162,6 +162,9 @@ remove {"type":"remove","id":"已有片段 ID"}。 9. 片段描述是采样观察结果,可能不完整;不确定时优先选择 score 更高的片段,并在 summary 中说明取舍。 10. 用户指令中的「这个 / 那个 / 现在 / 全部」等指代必须结合对话记录理解;只要对话记录中有可执行的要求,就不得以「未收到具体要求」为由返回空方案。只有确实无法执行时才返回空 operations。没有台词转写数据时,不要虚构字幕台词。 +用户本次要求(需要执行的剪辑指令,必须据此操作): +${instruction} + ${styleBlock} ${targetBlock} ${historySection} diff --git a/tests/providers.test.mjs b/tests/providers.test.mjs index d174d8a..8b94592 100644 --- a/tests/providers.test.mjs +++ b/tests/providers.test.mjs @@ -39,6 +39,8 @@ test('规划提示词:按评分筛选片段、丢弃占位描述、区分新 ]}}); const p={settings:{width:1920,height:1080,fps:30},media:[mk('a',90),mk('b',40)],clips:[{id:'c1',mediaId:'a',track:'video',start:0,in:0,out:5,speed:1,volume:1,motion:[{time:0,zoom:1,x:.5,y:.5}],text:'旧字幕'}]}; const fresh=plannerPrompt(p,'制作一个旅行短片',{fresh:true,target:45,style:getStyle('cinematic'),budget:9000}); + assert.ok(fresh.includes('用户本次要求')); + assert.ok(fresh.includes('制作一个旅行短片'),'用户指令必须出现在提示词中'); assert.ok(fresh.includes('海滩日落')); assert.ok(fresh.includes('城市夜景')); assert.ok(!fresh.includes('尚未进行语义或动作识别')); -- 2.54.0