From 68418f4ec35da11b7881b62c094379c45962112c Mon Sep 17 00:00:00 2001 From: kicer Date: Fri, 25 Sep 2026 19:44:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8C=E8=80=85?= =?UTF-8?q?=E6=8A=8A=E3=80=8C=E8=B7=B3=E8=BF=87=E9=A1=BE=E9=97=AE=E3=80=8D?= =?UTF-8?q?=E8=AF=BB=E6=88=90=E3=80=8C=E8=B7=B3=E8=BF=87=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E3=80=8D(=E4=B8=8D=E6=94=B9system-prompt.txt,=E9=94=9A?= =?UTF-8?q?=E7=82=B9=E6=B6=88=E6=81=AF=E4=B8=BA=E6=89=A7=E8=A1=8C=E4=BE=A7?= =?UTF-8?q?=E5=94=AF=E4=B8=80=E6=8C=87=E4=BB=A4=E4=BD=8D):task=5Fbrief?= =?UTF-8?q?=E9=94=9A=E7=82=B9=E7=A1=AC=E6=8C=87=E4=BB=A4=E5=8C=96=E2=80=94?= =?UTF-8?q?=E2=80=94Missing/=E5=BE=85=E7=A1=AE=E8=AE=A4=E9=80=90=E9=A1=B9?= =?UTF-8?q?=E5=85=88=E9=97=AE=E7=94=A8=E6=88=B7=E7=AD=89=E7=AD=94=E5=A4=8D?= =?UTF-8?q?,=E7=82=B9=E5=90=8D=E3=80=8C=E7=94=A8=E6=88=B7=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E7=9A=84=E5=8F=AA=E6=98=AF=E9=A1=BE=E9=97=AE=E9=98=B6?= =?UTF-8?q?=E6=AE=B5=E4=B8=8D=E6=98=AF=E7=A1=AE=E8=AE=A4=E7=8E=AF=E8=8A=82?= =?UTF-8?q?=E3=80=8D,=E5=94=AF=E7=94=A8=E6=88=B7=E6=98=8E=E8=AF=B4?= =?UTF-8?q?=E5=88=AB=E9=97=AE=E6=89=8D=E5=8F=AF=E7=94=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=94=E9=A1=BB=E5=88=97=E5=87=BA=E5=BE=85=E6=A3=80,?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E6=94=B9=E5=86=99=E4=B8=BA=E6=8C=89=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=89=A7=E8=A1=8C;handoff=E5=B7=A5=E5=85=B7=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E5=8E=BB=E6=AF=92=E7=A4=BA=E4=BE=8Bjust=20do=20it?= =?UTF-8?q?=E2=86=92just=20move=20on=E5=B9=B6=E5=A3=B0=E6=98=8Euser=5Fskip?= =?UTF-8?q?=E5=8F=AA=E8=B7=B3=E9=A1=BE=E9=97=AE=E5=AF=B9=E8=AF=9D=E4=B8=8D?= =?UTF-8?q?=E8=B1=81=E5=85=8D=E5=90=8E=E7=BB=AD=E7=A1=AE=E8=AE=A4,?= =?UTF-8?q?=E6=94=B6=E5=B0=BE=E8=A6=81=E6=B1=82=E9=9D=9Eready=E7=9A=84brie?= =?UTF-8?q?f=E5=BF=85=E9=A1=BB=E5=B8=A6Missing=E6=B8=85=E5=8D=95;advising?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=8D=E5=90=8C=E6=AD=A5=E3=80=8C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=B7=B3=E8=BF=87=E7=9A=84=E6=98=AFplanning=20chat?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E8=BF=99=E4=BA=9B=E9=97=AE=E9=A2=98=E3=80=8D?= =?UTF-8?q?=E3=80=82=E6=A0=B9=E5=9B=A0:=E6=89=A7=E8=A1=8C=E8=80=85?= =?UTF-8?q?=E7=9C=8B=E4=B8=8D=E5=88=B0=E9=A1=BE=E9=97=AE=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?,brief=E6=AD=A3=E6=96=87=E9=87=8C=E7=9A=84=E8=AF=A2=E9=97=AE?= =?UTF-8?q?=E5=8F=AA=E6=98=AF=E4=BF=A1=E6=81=AF=E6=97=A0=E7=BA=A6=E6=9D=9F?= =?UTF-8?q?=E5=8A=9B,=E7=BA=A6=E6=9D=9F=E5=BF=85=E9=A1=BB=E6=B4=BB?= =?UTF-8?q?=E5=9C=A8=E8=BF=90=E8=A1=8C=E6=97=B6=E9=94=9A=E7=82=B9=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E4=B8=8E=E4=BA=A4=E6=8E=A5=E8=AF=AD=E4=B9=89=E9=87=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/server/engine.js | 3 ++- app/server/templates/advising-system.txt | 5 +++-- app/server/tools/definitions.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/server/engine.js b/app/server/engine.js index 7b2052c..3085e14 100644 --- a/app/server/engine.js +++ b/app/server/engine.js @@ -304,7 +304,8 @@ function enterExecuting(sessionId) { saveMessage(sessionId, { role: 'user', type: 'task_brief', content: '【任务书】顾问阶段结束,会话已进入执行模式。以下任务书快照(task.md)是唯一目标依据;' - + '之前的顾问对话已存档、不再发送。若正文列有 Missing/未澄清事项,先向用户提问确认再动手;' + + '之前的顾问对话已存档、不再发送。若任务书列有 Missing/待确认事项:开工前逐项向用户提问并等待答复——' + + '用户跳过的只是顾问阶段,不是确认环节,不得据此自行拍板;只有用户明确说过「别问,直接做」才可用默认值,且须把每个默认决定列出供用户检查;禁止把待确认项改写成「按默认执行」。' + '执行中可修订 task.md(以文件现状为准);上一轮任务书归档在 .task-history/,仅限用户明确要求时查阅。\n\n' + snapshot, }); db.prepare("UPDATE sessions SET phase='executing', updated_at=? WHERE id=?").run(now(), sessionId); diff --git a/app/server/templates/advising-system.txt b/app/server/templates/advising-system.txt index 8efca44..3c80fbf 100644 --- a/app/server/templates/advising-system.txt +++ b/app/server/templates/advising-system.txt @@ -38,8 +38,9 @@ Therefore: - If planning was skipped or key facts are still missing, keep the brief minimal: state the goal in the user's own words and list every unknown under a "Missing" section instead of guessing or writing generic advice. The executor - will ask the user for these directly. Do not turn a skipped-planning brief - into a methodology document. + will ask the user about these directly before doing the work — the user + skipped the planning chat, not these questions. Do not turn a + skipped-planning brief into a methodology document. - Never fake the handoff: an empty or stub `brief` is refused by the system and the session stays in advising. Only your handoff call commits. diff --git a/app/server/tools/definitions.json b/app/server/tools/definitions.json index 87958df..efebb16 100644 --- a/app/server/tools/definitions.json +++ b/app/server/tools/definitions.json @@ -109,7 +109,7 @@ "type": "function", "function": { "name": "handoff", - "description": "Hand off from the advising phase to the execution phase. Call this when the task brief is ready. The system stores your `brief` as the task brief and switches to execution. There are three cases:\n\n- ready: The requirement is clear enough to execute.\n- user_skip: The user explicitly asks to skip planning (\"just do it\", or similar). Do not call this on tone or mood alone — only on explicit signals.\n- user_stuck: You have asked 2-3 rounds and the user is still not providing key information, and they seem to want to move on.\n\nWhen reason is not \"ready\", pass the user's own words as `brief` and leave it at that. Do not invent a methodology or generic plan. The executor will ask the user for missing information directly.", + "description": "Hand off from the advising phase to the execution phase. Call this when the task brief is ready. The system stores your `brief` as the task brief and switches to execution. There are three cases:\n\n- ready: The requirement is clear enough to execute.\n- user_skip: The user explicitly asks to stop planning with you (\"just move on\", or similar) — this skips only the advising conversation, it never waives the user's later confirmations. Do not call this on tone or mood alone — only on explicit signals.\n- user_stuck: You have asked 2-3 rounds and the user is still not providing key information, and they seem to want to move on.\n\nWhen reason is not \"ready\", the `brief` must carry the user's own words plus every open question under a Missing section — the executor is required to ask the user these before acting. Do not invent a methodology or generic plan.", "parameters": { "type": "object", "required": [