fix(rectification): show spoken collect questions in the chat UI
Spoken collect prompts lived only in GET current_question. The chat never parsed that field, Agent projections returned null after evidence writes, and active_focus followups collapsed the questionId. Render the parsed prompt, keep choiceReady on real cards, and give collect focuses a stable domain-scoped id. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6751,3 +6751,19 @@
|
||||
- 复发自:无
|
||||
- 修复版本:待发布
|
||||
|
||||
## BUG-441 | 口述采集题已落库但界面看不到,助手只说看下面这一问
|
||||
|
||||
- 状态:resolved
|
||||
- 首次发现:2026-08-30
|
||||
- 最近更新:2026-08-30
|
||||
- 影响面:GET `current_question`、`applyCaseSnapshot`、`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`。
|
||||
- 相关记录:BUG-404、BUG-411、BUG-432、BUG-437、BUG-440
|
||||
- 复发自:BUG-432(无选择卡的问题曾要求由 Agent 正文问出,前端仍不渲染 `current_question`)
|
||||
- 修复版本:待发布
|
||||
|
||||
|
||||
Reference in New Issue
Block a user