fix(web): keep rectification emit types compatible with next build
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled

The spoken/thinking splitter must accept sync or async emit, matching the runner input type.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-23 10:20:41 +08:00
parent 8f0fa3b994
commit 22010e81b7
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -5413,7 +5413,7 @@
- 触发条件:生时纠正已读取 Case 且工具成功后,模型把中文过程自述写进 `text-delta`
- 根因:BUG-354 为保住正文预算关闭了纠正 provider thinking。`reasoning-delta` 不再出现,中文自述改走 `text-delta`。契约门只在 Case 未加载或工具失败时把正文改送到 `thinking.delta`;工具成功后全部当作回答。界面上思考折叠和正文也没有咨询页那种「思考 / 回复」分层。
- 修复:保持 `thinking: disabled` 与 16384 正文预算。对已加载 Case 的 `text-delta` 按段落拆成过程自述与口语结论:自述进 `thinking.delta`,结论进 `answer.delta` 并作为落盘正文。界面与咨询对齐:折叠「思考」(13px 次要色,有正文后默认收起)和完整「回复」。
- 验证:`frontend/tests/rectification-spoken-answer.test.ts``frontend/tests/rectification-v9-stream.test.ts``frontend/tests/rectification-agentic-entry.test.ts``frontend/tests/chat-stream-layout.test.ts`
- 验证:`frontend/tests/rectification-spoken-answer.test.ts``frontend/tests/rectification-v9-stream.test.ts``frontend/tests/rectification-agentic-entry.test.ts``frontend/tests/chat-stream-layout.test.ts``tsc --noEmit` 通过。口语/思考拆分的 `emit` 类型必须与 `RunV9AgentTurnInput.emit` 同为 `Promise<void> | void`,否则 Docker `next build` 会在 publish 阶段失败。
- 防复发:纠正组答不得在不拆开正文预算的情况下重开 provider thinking 来充当思考 UI。`answer.delta` 不得承载 skill/schema/batch 过程自述。思考与回复必须分层渲染,不得共用同一段正文样式。
- 相关记录:BUG-345、BUG-354、BUG-356
- 复发自:BUG-345(关 thinking 后自述改走正文)、BUG-354(纠正与咨询一并关闭 provider thinking
@@ -843,7 +843,7 @@ async function publishSplitSpokenAndThinking(
publishedSpoken: string,
answerText: string,
publish: (event: PublicStreamEvent) => Promise<void>,
emit: (event: PublicStreamEvent) => Promise<void>,
emit: (event: PublicStreamEvent) => Promise<void> | void,
finalize = false,
): Promise<{ thinking: string; spoken: string; spokenDelta: string }> {
const split = finalize
@@ -237,6 +237,8 @@ test("usage completes or releases without hiding settlement failures", () => {
assert.match(run, /thinking: "disabled"/);
assert.match(run, /toPublicThinkingDelta/);
assert.match(run, /splitRectificationSpokenAndThinking/);
assert.match(run, /emit\(event: PublicStreamEvent\): Promise<void> \| void;/);
assert.match(run, /emit: \(event: PublicStreamEvent\) => Promise<void> \| void,/);
assert.match(route, /featureKey: "rectification"/);
assert.match(route, /rectification:case:\$\{caseId\}/);
});