You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
本批两个 issue(#5864 + #7331)对应同一根本原因(extended thinking 会话中 assistant 消息坍缩为 [thinking] → Anthropic 400 "the final block in an assistant message cannot be thinking")的两个独立生产者,已由两个在途 PR 分别修复:
Activity
ranxianglei commentedon Nov 20, 2026
[bot] 🏷
根因裁决:thinking-final-block-400
本批两个 issue(#5864 + #7331)对应同一根本原因(extended thinking 会话中 assistant 消息坍缩为
[thinking]→ Anthropic 400 "the final block in an assistant message cannot be thinking")的两个独立生产者,已由两个在途 PR 分别修复:hideConsumedCompressCalls隐藏已消费 compress pair 时不看前驱是否有 signed thinking → pair 被隐藏但 thinking 留下 → 消息坍缩为[thinking]healUnpairedServerToolBlocks(#7270/#7271 新增)丢弃孤立 server-tool 半边时不看消息里是否还留着 thinking 块 → 丢孤儿后消息坍缩为[thinking]已做的动作(本线程交付):
<!-- rcagg:thinking-final-block-400 -->标记行(汇聚板靠它自动识别根因 PR)。root-cause+bug+p2+scope/kernel+claude-code标签(按各自 diff 独立判断,未抄来源 issue)。p2+claude-code+scope/kernel(保留既有root-cause-batch)。为何不另开合并 PR:聚合流程明确允许「修复拆成多个子单各自提 PR」(每个 PR 带 rcagg 标记即可)。两个生产者机制/文件不同(hide pass
kernel/src/hide-consumed.tsvs heal passkernel/src/wire/anthropic.ts:559),#7331 已推荐 option 2a(独立 PR),且两个 PR 均已收敛、CI 绿、review 无阻塞发现。另开第三个合并 PR 会违反 one-PR-per-thread 规则且扩大 gated diff 无收益。当前阻塞:两个 PR 均为 kernel 改动,按 Kernel Boundary 需 owner 人工批准(human-only review tier,no auto-merge)。#5877 已挂起 10 天(11-10 / 11-12 / 11-19 三次决策请求无回应);#7332 按 mechanical-bug exemption(owner policy 2026-11-06)推进但仍需 owner 人工 review。请你对两个 PR 拍板(approve/reject)。
8问
[thinking, compress]或[thinking, server_tool_use]轮次之后。hideConsumedCompressCalls(kernel/src/hide-consumed.ts)无差别隐藏已消费 compress pair,不看前驱是否有 signed thinking([acp-loop] In-turn compress re-request edits the latest assistant message → Anthropic 400 "thinking blocks … cannot be modified" (session stays broken) #1960 教义要求 signed thinking 必须与 tool_use sibling 共存);(b)healUnpairedServerToolBlocks(kernel/src/wire/anthropic.ts:559)丢弃孤立 server-tool 半边时不看消息里是否还留着 thinking 块。两者都导致 assistant 消息坍缩为[thinking]→ 400。Config加可选宿主注入谓词strandedProtectedPredecessor(与isCompressTool同族端口),待隐藏 pair 的 assistant-message run 内仍有 signed thinking /redacted_thinking块时保留该 pair 可见,使 thinking 永不成为 final block;谓词未设 = 字节一致,非 Anthropic wire 不受影响。(b) PR [PR] fix(kernel): heal pass keeps a thinking block out of the final assistant block #7332:heal pass 丢掉块后若最后一个存活块是 thinking-family,追加既有占位文本块"(server tool exchange folded)",使 thinking 永不成为 final block;thinking 块本身字节/签名不动(KDD release v0.1.3 #10)。[thinking, compress]或[thinking, server_tool_use]轮次之后。受影响用户:claude-code + extended thinking + 大会话(频繁压缩,reporter 环境 200k 窗口 ~260k)。谓词未设 / 无 thinking 块 / 非 Anthropic wire 的会话字节一致,不受影响。tests/issue5864-signed-thinking-strand.test.ts(含负向验证:unsigned 路径 [Bug] MCP compress 未接入 reasoning 清理及未完成调用保护 #3222 drop 不受影响);PR [PR] fix(kernel): heal pass keeps a thinking block out of the final assistant block #7332 新增kernel/tests/server-tool-pair-heal.test.ts4 行(3 正:orphaned result after thinking / orphaned server_tool_use after thinking non-last / orphaned result after redacted_thinking;1 负:thinking + 完整 pair 字节一致 Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617)。两者均钉住「thinking 永不成为 final block」的不变量。src/config.ts)正确;(d) 若 owner 打回,bug 持续,reporter 环境(大会话 + 频繁压缩)继续命中;(e) 两个 PR 的 base 均为 6453fee,master 已前进 7 commits(1e357bf2d66),合并前需 rebase 确认无冲突。