fix(web): stop consultation thinking from pinching the answer

Disable provider thinking so Flash CoT cannot fill max_tokens, raise the
spoken budget to 16384, emit a server-owned step tree, and continue once
when the body ends on length.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-22 21:19:00 +08:00
parent d2a5f0f5bf
commit 0ca7da997f
26 changed files with 1013 additions and 88 deletions
+17
View File
@@ -5355,3 +5355,20 @@
- 复发自:BUG-197(不确定入口恢复后仍用五档时段加备注,备注从未进入扫描窗)
- 修复版本:8ed6118b
## BUG-354 | 咨询 thinking 抢占正文额度,思考过程被清洗成英文碎片且没有回答
- 状态:resolved
- 首次发现:2026-08-22
- 最近更新:2026-08-22
- 影响面:`POST /api/consult``streamAgentResponse`、咨询页思考/分析 UI、组答 `maxOutputTokens`
- 用户现象:咨询页灰色「思考过程」出现断裂英文碎片(如 `Let me at the.``The for`),正文为空;流在技法审计表标题处因 `finish_reason=length` 结束。
- 触发条件:网页个人咨询,尤其是多领域 Level 2 组答;供应商默认打开 thinking,且 `max_tokens` 与可见正文共用。
- 根因:BUG-346 在 8192 可见预算不变的情况下重新打开 provider thinking。Flash 的 `reasoning_content` 占满额度后 `content` 为空。公开 `thinking.delta` 又按 token 清洗英文,把连贯 CoT 剪成碎片。Skill 体积走的是输入上下文,不是这次截断的原因。
- 修复:咨询与纠正组答改回 `thinking: disabled`。组答正文预算改为独立的 16384。计算仍一次完成,不按领域再开模型。服务器用已执行领域、`required_blocks``must_use_layers` 生成 `thinking.section` 步骤树。`finish_reason=length` 且已有正文时关 thinking 续写一次;两次仍空或不增长才 `answer_truncated`,不扣点。咨询页按领域渲染可折叠「思考」和「分析」,不再把模型 CoT 当主思考通道。
- 验证:`frontend/tests/consultation-workflow-contract.test.ts` 锁定 thinking disabled 与 16384 正文预算;`frontend/tests/consultation-agentic-runtime.test.ts` 锁定 `reasoning-delta` 不进公开流、`length` 续写可完成、不增长则截断;`frontend/tests/consultation-thinking-plan.test.ts` 锁定中文步骤树不含工具 id`frontend/tests/chat-stream-layout.test.ts` 锁定思考/分析 UI。
- 防复发:咨询组答不得再打开 provider thinking 来充当思考 UI。打开 thinking 必须同时拆开或加大正文预算,且不得把 `reasoning-delta` 经逐 token 清洗后当作用户可见思考过程。`finish_reason=length` 且半截正文必须续写,不得直接 `run.completed`。步骤树只使用中文产品文案,禁止把 `run-jyotish-*`、JSON 键或 Skill 正文送进思考 UI。
- 相关记录:BUG-277、BUG-305、BUG-340、BUG-345、BUG-346、BUG-347
- 复发自:BUG-305thinking 与正文抢 `max_tokens`)、BUG-3468192 预算不变就重新打开 thinking)
- 修复版本:待发布