Repository navigation
Description
🤖 Powered by ework · qwen3.8-27b
来源: PR https://github.com/ranxianglei/billion-context/pull/5877(镜像 #5880)分析 round-3 review 时发现 —— 本 PR 的 kernel 授权已在 PR 线程内挂起 10 天(11-10 / 11-12 / 11-19 三次 🔶 决策请求评论均无回应),按授权卡点政策(2026-10-26)升级为独立 issue 供 owner 可见。
查重: 无 —— 不存在针对 PR #5877 的既有 kernel authorization request(检索 open+closed 的 "kernel authorization request" 与 "5877",22 个同类 issue 无一涉及本 PR);#6454 聚合线程跟踪 #5877 状态("待签核")但不是授权请求。
一句话白话:PR #5877 修的是「extended thinking 会话里模型调用 compress 之后,Anthropic 拒绝下一次请求(400 "final block cannot be thinking")」的问题(#5864)。改动在 kernel 内,按 Kernel Boundary 必须你人工批准——PR 其余部分已完全就绪(CI 全绿、三轮 review 无阻塞发现),只等你的 approve/reject。
决策项 1(主):批准或打回 PR #5877
- PR: https://github.com/ranxianglei/billion-context/pull/5877(分支 2026-11-07_fix-signed-thinking-strand-on-compress-hide)
- Head: 26b39ae(base master 6453fee;2026-11-20 复核:master 未动、merge 状态干净)
- CI: 30/30 完成,0 failed(15 success + 15 env-gated skips)
- Gated diff(kernel/): kernel/src/hide-consumed.ts、kernel/src/types.ts、kernel/src/compress.ts、kernel/package.json(0.0.200→0.0.201)+ 两个 lockfile
- Fixes: GitHub [claude] 400 "final block in an assistant message cannot be thinking" after a compress call that follows a thinking block #5864(镜像 Plugin-lane array-form folds end with zero full summaries on the wire after the first turn (call stubbed + render stripped) #5866),[Root Cause] wire-fidelity (11 items) #6454 wire-fidelity 聚合成员(聚合线程结论:kernel 改动必须独立 PR,不能揉进聚合 host PR)
- Review 状态: 三轮 review(11-10 / 11-12 / 11-19)无阻塞发现;回归测试有牙(负向验证:把 kernel 三文件回退到 base 即 4/5 失败);reporter 独立审过 diff 并确认方向(其 "approved" 仅为参考意见——按规则只有你的拍板有效)
- 选项:
- A. 批准 —— 现状即可合(CI 绿、内容干净)。合并操作本身由你执行(agent 不合 PR)。
- B. 打回 / 要求修改 —— 你给方向,我按指示回滚或修改。
- 推荐: A(修根因、面最小;谓词未设 = 字节一致;回归已钉住)。
决策项 2(次):master 上发现的同一 400 的第二个生产者,如何跟踪与出修
round-3 review 在 master 的新代码里(不在本 PR diff 内)发现同一 400 的第二个生产者:
- healUnpairedServerToolBlocks(kernel/src/wire/anthropic.ts 新增,[Bug][anthropic][opencode] 0.1.216: After degenerate fold, messages[2] system is dispatched as-is (bypassing the final h | [Bug][anthropic][opencode] 0.1.216: degenerate fold 后 messages[2] system 原样出站(越过最终 healAnthropicSystemPositions)→ 400 must precede … #7270/Egress window fuse and preflight compression undermine each other: out-of-window sessions deadlock on self-generated 413 | egress window fuse 与 preflight 压缩互相拆台:超窗会话被自产 413 卡死 #7271 server-tool 批次)在 fold 覆盖一半时丢弃孤立的 server_tool_use/*_tool_result 半边;
- 若 thinking 块与它同处一条 assistant 消息(extended thinking + server-tool 调用同轮——正是 [claude] 400 "final block in an assistant message cannot be thinking" after a compress call that follows a thinking block #5864 reporter 的配置),丢孤儿后消息坍缩为 [thinking] → 同样的 "final block cannot be thinking" 400;两个 fold 方向都命中,result-drop 侧无 last-message 豁免;
- 窗口内 kernel/tests/server-tool-pair-heal.test.ts 无 thinking 行——该边缘未测;
- [PR] fix(kernel): keep compress pair visible when its predecessor is signed thinking #5877 的 guard 不覆盖它(guard 在 hideConsumedCompressCalls;heal 是独立的 post-render pass)。
选项:
- a. 归入 [claude] 400 "final block in an assistant message cannot be thinking" after a compress call that follows a thinking block #5864 作机制级子缺陷跟踪(同症状规则),另开 kernel PR 修复(推荐)——建议修法: heal 丢掉一条消息的最后一个非 thinking 块时,追加既有占位文本块("(server tool exchange folded)"),使 thinking 永远不成为 final block;镜像该函数自己的 emptied-message 处理。
- b. 并入 [PR] fix(kernel): keep compress pair visible when its predecessor is signed thinking #5877 —— 不推荐: 机制/文件不同,[PR] fix(kernel): keep compress pair visible when its predecessor is signed thinking #5877 已收敛(4 次 rebase),并入会扩大 gated diff。
- c. 暂缓 —— 只记录、不排期。
- 本项不阻塞决策项 1。
八问(决策请求体例)
- 是什么问题:(项1)extended thinking 会话中,模型带 thinking 块调用 compress 后,下一次出站请求被 Anthropic 以 400 "the final block in an assistant message cannot be thinking" 拒绝,用户丢一个回合(reporter 会话 27 个此类轮次命中 5 个);(项2)master 新增的 server-tool heal pass 能产生同一 400 的另一种形状(未修、未测)。
- 什么原因导致的:(项1)两个各自正确但合起来非法的判定叠加——planReasoningDrop 有 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 教义)× kernel hideConsumedCompressCalls 无差别隐藏已消费的 compress pair → pair 被隐藏但 signed thinking 留下 → 消息坍缩为 [thinking];(项2)heal pass 丢 server-tool 孤儿半边时不看消息里是否还留着 thinking 块。
- 影响范围与严重程度(按选项):
- 选项 A(批准 [PR] fix(kernel): keep compress pair visible when its predecessor is signed thinking #5877): 修复面 = Anthropic wire 的 extended thinking 会话、fold 边界恰好落在 [thinking, compress] 之后;严重度 p2(丢回合、可恢复、无数据丢失、无缓存泄露)。修后该形状 400 消失;代价是这些轮次保留可见的一对 compress tool_use+result(有界)。
- 选项 B(打回): bug 持续,reporter 环境(大会话 + 频繁压缩)继续命中。
- 选项 a(归 [claude] 400 "final block in an assistant message cannot be thinking" after a compress call that follows a thinking block #5864 + 独立 PR): 第二生产者在修复 PR 落地前持续存在;触发条件 = extended thinking + 同轮 server-tool 调用 + fold 覆盖 pair 一半([Bug][anthropic][opencode] 0.1.216: After degenerate fold, messages[2] system is dispatched as-is (bypassing the final h | [Bug][anthropic][opencode] 0.1.216: degenerate fold 后 messages[2] system 原样出站(越过最终 healAnthropicSystemPositions)→ 400 must precede … #7270/Egress window fuse and preflight compression undermine each other: out-of-window sessions deadlock on self-generated 413 | egress window fuse 与 preflight 压缩互相拆台:超窗会话被自产 413 卡死 #7271 现场: claude-code + advisor)。
- 选项 b(并入 [PR] fix(kernel): keep compress pair visible when its predecessor is signed thinking #5877): gated diff 扩大(新增文件 kernel/src/wire/anthropic.ts),评审面变宽,[PR] fix(kernel): keep compress pair visible when its predecessor is signed thinking #5877 已收敛状态被打断。
- 选项 c(暂缓): 同 a,但无排期承诺。
- 怎么修复的(推荐选项思路):(项1→A)修在隐藏决策点(疏不堵): kernel Config 加可选宿主注入谓词端口 strandedProtectedPredecessor,待隐藏 pair 的前驱命中谓词时保留该 pair 可见,使 thinking 永不成为 final block;宿主侧把 signed-thinking 判定接进去,谓词未设时行为字节一致。(项2→a)heal pass 丢最后一个非 thinking 块时追加既有占位文本块,使 thinking 永不成为 final block。
- 是否有回归风险(按选项):
- 选项 A: 审过的既有行为——unsigned 路径([Bug] MCP compress 未接入 reasoning 清理及未完成调用保护 #3222 drop)不受影响(对照测试钉住)、非 Anthropic wire 不受影响(谓词未设 = 字节一致)、kernel 默认 () => false 使宿主不传谓词时行为完全不变;唯一有意变更是 PR 正文已披露的旧值→新值(前驱为 signed thinking 时保留 consumed pair 可见)。三轮 review + 负向验证确认无回归。
- 选项 B: 无新回归(维持现状),bug 持续。
- 选项 a: 修复走独立 PR 与同一 kernel 流程,不影响 [PR] fix(kernel): keep compress pair visible when its predecessor is signed thinking #5877。
- 选项 b: [PR] fix(kernel): keep compress pair visible when its predecessor is signed thinking #5877 gated diff 扩大,评审/回滚面随之变宽。
- 是否破坏缓存: 否(项1 只改特定 pair 的可见性,不动缓存键/前缀稳定性;项2 尚未实施)。
- 是否改了设计方向: 否(项1 沿用既有宿主注入端口机制,与 isCompressTool 同族;项2 沿用 heal 函数自己的 emptied-message 处理模式)。
- 是否引入了新的配置: 无新 env/config/knob(谓词由 bili 自动接线,不是用户可见开关)。
选项对比表
| 选项 | 动作 | 波及面 | 风险 | 推荐 |
|---|---|---|---|---|
| 1A 批准 #5877 | 你手动 merge | 修掉 #5864 400(extended-thinking + compress 形状) | 低(谓词未设 = 字节一致,回归钉住) | ✅ 推荐 |
| 1B 打回 | 按你方向回滚/修改 | bug 持续 | 无 | 仅当你认为机制有问题 |
| 2a 归 #5864 + 独立 PR | 排期后另开 kernel PR | 修掉第二生产者 | 低(镜像既有处理) | ✅ 推荐 |
| 2b 并入 #5877 | 扩大 gated diff | 一次修两个 | 中(评审面变宽、打断收敛) | 不推荐 |
| 2c 暂缓 | 只记录 | 第二生产者未修 | 低(边缘条件) | 可接受 |
请求动作: 请你对上述两项拍板(项1: A/B;项2: a/b/c)。按授权卡点政策,拍板前我停手等待——不会自行批准,也不会往 PR 正文补声明来绕过门禁。
拟打标签(镜像 shim 未实现 labels 端点,无法代打): p1、bug、scope/kernel、claude-code
Mirrored from ework issue #7331
Activity
ranxianglei commentedon Nov 19, 2026
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)
查重: 不重复 —— 本 issue 即针对 PR #5877 的 kernel 授权请求;第二生产者的修复 PR(#7332)已确认无既有在途 PR 覆盖同一 heal-pass 主题(逐一核对 open [PR] 行,#5880=#5877 是项1,主题不同)。
项1(主)—— 批准/打回 PR #5877:仍待你拍板,我复核了实时状态
26b39aedd,base6453feeeb= 当前 master(master 未动),mergeable_state干净(唯一阻塞是 human-only kernel 评审档,非冲突)。项2(次)—— 第二生产者:我按推荐选项 (a) 先修了,已开 PR #7332
healUnpairedServerToolBlocks丢掉一条块、且存活块的最后一块是 thinking 族(thinking/redacted_thinking)时,追加该函数既有的占位文本块"(server tool exchange folded)",使 thinking 永不成为 final block。thinking 块本身的字节与签名不动(KDD release v0.1.3 #10),只在其后加一个兄弟 text 块。kernel/tests/server-tool-pair-heal.test.ts新增 4 行(3 正 + 1 负);全 kernel 套件 1649 pass / 0 fail;kernel typecheck 干净;wire/anthropic.ts不在 verif 守护清单,无需 verif-subset-guard。八问(围绕项2 修复 PR #7332)
server_tool_use/*_tool_result半边丢掉;若同一条 assistant 消息里还有 thinking 块,丢完后消息坍缩成「最后一块是 thinking」→ Anthropic 400 "the final block in an assistant message cannot be thinking",用户丢一个回合。这是 [claude] 400 "final block in an assistant message cannot be thinking" after a compress call that follows a thinking block #5864 同一 400 的第二个生产者(第一个在 hide pass,由 [PR] fix(kernel): keep compress pair visible when its predecessor is signed thinking #5877 修)。healUnpairedServerToolBlocks重写消息内容时只保留存活块,从不检查「最后一块是不是 thinking 族」——一个缺失的守卫(不是错误字面量/typo,而是漏判)。两个 fold 方向都命中,result-drop 侧无 last-message 豁免。标签说明:镜像 shim 未实现 labels 端点(
/labels、/issues/N/labels均返回 "endpoint not implemented in ework shim"),tools/add-label.sh也不在工作区,所以我无法给本 issue(#7331)代打标签(拟:p1、bug、scope/kernel、claude-code)。PR #7332 的标签我已按 GitHub API 打好。收工判定:项2 已交付(PR #7332,待你 human-only 评审);项1 仍待你 A/B 拍板,我复核过实时状态、随时可执行你的决定。
ranxianglei commentedon Nov 19, 2026
(已收)本单已归入根因聚合 issue(token 见聚合单 body),机器人已停止在本单上的工作,修复走聚合 issue 统一出 PR;本单保留不关,修复验证后统一关闭。(聚合单:[Root Cause] kernel-compression (18 items),GitHub #6447)
ranxianglei commentedon Nov 20, 2026
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)
收到,已停止在本单上的工作。本单保留不关,按你的指示在修复验证后统一关闭。
我已核实的实时状态(回复前 live 复核):
root-cause标签(我当初只打了bug/p2/scope/kernel/claude-code,root-cause是聚合侧后加的)——说明它已并入 [Root Cause] kernel-compression (14 items) #6447 聚合批次,正与「修复走聚合单统一出 PR」的方向一致。它当前mergeable_state: behind(master 已前进,待聚合侧 rebase/并入统一 PR)。收工判定:本单(#7331)工作已停,项1(#5877 拍板)与项2(#7332)后续都走聚合单 #6447 统一处理。我这边不再在本单上动作。