fix(rectification): ask spoken collect questions in the agent body
The standalone collect prompt bar reused the choice-card chrome and duplicated the question. Visibility now comes from the spoken reply, with an empty-body fallback that posts the persisted focus prompt. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+4
-4
@@ -6756,13 +6756,13 @@
|
||||
- 状态:resolved
|
||||
- 首次发现:2026-08-30
|
||||
- 最近更新:2026-08-30
|
||||
- 影响面:GET `current_question`、`applyCaseSnapshot`、`openQuestionFromPersistedFocus`、`agentVisibleLatestProjection`、`stableFollowupQuestionId`、POST `/api/rectification/agent` 出卡判定、Agent 系统提示第 4 条
|
||||
- 影响面:GET `current_question`、`openQuestionFromPersistedFocus`、`agentVisibleLatestProjection`、`stableFollowupQuestionId`、POST `/api/rectification/agent` 出卡判定与空正文兜底、Agent 系统提示第 4 条
|
||||
- 用户现象:助手正文只写「接下来看下面这一问。」,界面没有任何问题。GET 里 `choice_card` 为 null,`current_question` 已是合法口述采集题(`kind=collect_spoken`、prompt 非空),问题只存在于数据库和 API。
|
||||
- 触发条件:方法覆盖回落到不带 choice_frame 的口述采集焦点;Agent 按选择卡承接措辞说话;前端只解析 `choice_card`。
|
||||
- 根因:三段同时成立。(1) 前端从不渲染 `current_question`:`applyCaseSnapshot` 只解析 `latest_result` / `choice_card` / `case`,`kind=collect_spoken` 在界面上没有承载位置。(2) 面向 Agent 的两套投影自相矛盾:`projectTurnDecision` 给出 `current_question.kind=collect_spoken` 与 prompt;记完证据后的 `agentVisibleLatestProjection` 取自 `openQuestionFromPersistedFocus`,后者对 collect focus 一律返回 null。Agent 收到打架信号,退回「卡片会显示」的措辞。(3) `stableFollowupQuestionId` 在 followup 既无 semantic_key 也无 probe_year 时退到 `${method_id}:${ask_theme}`;`persistPlanFocus` 传入的 active_focus 计划正好两者都没有,questionId 退化成 `active_focus:active_focus`。
|
||||
- 修复:P0:新增 fail-closed `parseRectificationSpokenCollect`,只接受 `kind=collect_spoken` 且 prompt 通过既有裁剪规则的对象。`applyCaseSnapshot` 解析 `current_question`;`choice_card` 为空且非 busy/readonly/regenerating 时,在最后一条助手消息下用现有选择卡轻量样式展示题干,不出 A/B/C/D。消失由服务端 `current_question` 变 null 驱动,不用正文文本判断是否已问过。P1:`openQuestionFromPersistedFocus` 对 collect focus 返回带 `kind=collect_spoken` 的同形结果;`choiceReady` / 出卡判定改为 `isRenderableChoiceOpenQuestion`,只对 `kind=choice` 为真,collect 不得触发「请点选」。`current_probe` 与 `inference.next_probe` 仍只对可渲染选择题放行。系统提示改为口述题干由界面提示条展示,正文不复述;「请点选」「看下面这一问」只允许在有选择卡时使用。P2:collect 在无 semantic_key / probe_year 时用 `collect:<domain>:<intent>`;`active_focus:active_focus` 不得与新 id 互相 already_open。Skill 保持 10.0.13,未放宽 confirmation gate。
|
||||
- 验证:`frontend/tests/rectification-spoken-collect.test.ts` 锁解析器 fail-closed、卡片优先不渲染口述条、collect openQuestion 不为卡片、probe 在 collect 下为空、active_focus 派生 questionId 带 domain。BUG-440 collect-stall 全绿,D12 同领域计分卡仍优先于家人口述题。`npx tsc --noEmit` 通过;eslint 改动文件 0 error。指定套件 `tests/rectification-*.test.ts tests/birth-time-rectification-contract.test.ts tests/agentic-rectification-*.test.ts` 679 项、0 失败。全量 `tests/*.test.ts` 2273 项、0 失败。失败集合未扩大到产品逻辑。
|
||||
- 防复发:服务端落下的问题必须有可见承载,不得只靠 Agent 正文。同一焦点在所有面向 Agent 的投影里形态必须一致。「请点选」类措辞只允许在有选择卡时使用。不得用正文文本判断助手有没有问出来。collect questionId 不得退化为 `active_focus:active_focus`。
|
||||
- 修复:P1/P2 仍在:`openQuestionFromPersistedFocus` 对 collect focus 返回带 `kind=collect_spoken` 的同形结果;`choiceReady` / 出卡判定只对 `kind=choice` 为真;`current_probe` 与 `inference.next_probe` 仍只对可渲染选择题放行;collect 在无 semantic_key / probe_year 时用 `collect:<domain>:<intent>`,`active_focus:active_focus` 不得与新 id 互相 already_open。P0 独立提示条已撤回:前端不再解析或渲染 `current_question`;口述采集题改由 Agent 用自己的话在正文里问出来,一次一问,不得照抄服务端 prompt 原文,但意思和时间范围不得改。「请点选」「看下面这一问」仍只允许在确实有选择卡时使用。服务端 collect focus 继续持久化,GET 仍返回 `current_question`。`runV9AgentTurn` 返回后若 `result.ok` 且 `answerText` 为空、且存在 `kind=collect_spoken` 的 active focus,则补一条普通助手消息(内容等于 focus prompt)并在关流前发出;`answerText` 非空一律不补。Skill 保持 10.0.13,未放宽 confirmation gate。
|
||||
- 验证:`frontend/tests/rectification-spoken-collect.test.ts` 锁:GET `collect_spoken` 不再渲染独立块、`.rectification-spoken-collect-prompt` 不存在、选择卡分支仍在、提示词要求正文提问、空正文落 focus prompt、非空正文不补。collect openQuestion 不为卡片、probe 在 collect 下为空、active_focus 派生 questionId 带 domain。BUG-440 collect-stall 全绿,D12 同领域计分卡仍优先于家人口述题。
|
||||
- 防复发:服务端问题的可见性由正文与确定性兜底保证,不得为无选项的问题新造视觉容器,更不得借用选择卡的样式类。同一焦点在所有面向 Agent 的投影里形态必须一致。「请点选」类措辞只允许在有选择卡时使用。不得用正文文本判断助手有没有问出来。collect questionId 不得退化为 `active_focus:active_focus`。
|
||||
- 相关记录:BUG-404、BUG-411、BUG-432、BUG-437、BUG-440
|
||||
- 复发自:BUG-432(无选择卡的问题曾要求由 Agent 正文问出,前端仍不渲染 `current_question`)
|
||||
- 修复版本:待发布
|
||||
|
||||
Reference in New Issue
Block a user