Repository navigation
[PR] fix: collapse orphaned tool blocks; system no longer re-voiced as user (#4400, #4292 residual sub-issue) | fix: 折叠孤儿的 tool 块 system 不再 re-voice 成 user(#4400,#4292 遗留子洞) - #4418
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.5327-pr.4418.df215c3This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4418.tgz
npm install -g packageInstall instructions are refreshed on each push. |
5de6694 to
9ef42aa
Compare
9ef42aa to
2bb5e1f
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复——open+closed issue/PR 检索只有本 PR 命中;它是 #4400 唯一在途修复条目(#4292/#4396 同机制链,已闭环)。 本轮仅验证、未动代码(尊重「留待下个版本」的 owner 决定)。验证动作:拉分支逐文件读完全部 diff(6 文件 +145/-26)、对照 master 基线;重审 #4292 A/B 证据链、WC-022 台账与仓库内全部 tool_addition 流量 fixture;查 CI 与 PR 状态。 CI/状态:head 对方向 D(本 PR 方案)的独立审核:判定大概率无效,不建议按现状合并。 D 的前提——「Anthropic 接受 tool-update system 出现在会话中段任意位置」——与仓库内全部证据相反:
决定性验证格无人跑过:带 beta 头向 api.anthropic.com 发 结构化八问
收工判定:PR 保持 open 至下个版本(不阻塞本版发布,与 owner 决定一致);进入下版合并窗口的前置条件 = ①决定性 A/B 格结果,或 ②讨论后转方向 A;合并前 rebase 到 master。本轮零代码改动。 |
kernel-change: fix #4400 — #4396 的 re-voice 修复对带 tool 块的孤儿 system 换了一种 400,需要 kernel 内豁免
现象(人话)
折叠把宿主发的"工具更新"system 消息(带
tool_addition/tool_removal块)变成孤儿后,#4396 的修复会把它改写成 user 消息再发给 Anthropic —— 但 Anthropic 规定 tool 块只能出现在 system 消息里(WC-022 台账),于是这个会话还是会吃 400、永久打死。和 #4292 原始 bug 同一种死法,只是换了个拒绝理由。根因
kernel/src/wire/anthropic.ts的折叠孤儿守卫([PR] kernel: folding orphaned system messages causes permanent 400 on Anthropic sessions — outbound fold signature guard (#42 | kernel: fold 孤儿 system 致 Anthropic 会话永久 400 — 出站折叠签名守卫 (#4292) #4396)把"紧邻折叠锚的 system"统一 re-voice 成 user;豁免名单里只有 directive-only(空 content + output_config),没有带 tool 块的 system。kernel/tests/issue4292-orphan-system-guard.test.ts当时把这个坏形状当预期钉死了(带 TOOL_ADDITION 的孤儿断言成 user)。修复
tool_addition*/tool_removal*块的 system 不再参与 re-voice:这类消息 Anthropic 本来就允许出现在会话中段(工具更新就是它的用途,passthrough 测试已证明是合法流量),保持 verbatim system 即可,两侧都不会 400。影响面
测试
tests/wire-contract.test.ts+tests/issue4159-client-mid-system-verbatim.test.ts+tests/issue4166-openai-midsystem-pins.test.ts23/23;typecheck 干净。testlanes 为准。备注