Repository navigation
fix(server): redacted_thinking arms the #651 reasoning-drop gate - #3196
ranxianglei merged 4 commits into
Conversation
…p gate (ranxianglei#1960) withReasoningDrop only treated a signed reasoning message as signed thinking. redacted_thinking rides as a text message with rawAnthropicBlock, so it never armed the gate; dropping the sibling reasoning run rewrote the latest assistant message -> 400 'thinking or redacted_thinking blocks ... cannot be modified'.
…eal teeth Review fix for PR ranxianglei#3196 (external contribution, aligned per repo review policy). The original test placed the redacted carrier AFTER the reasoning run, where dropCompressReasoning's contiguity walk stops immediately — nothing was ever dropped, so the test passed against the pre-fix code too (verified empirically). Reordered so the redacted block shares the assistant message prefix of the dropped run (the shape coreToAnthropic merges into one rewritten API message), and added a wire-level regression case through anthropicToCore/coreToAnthropic pinning both the kernel side-car shape and the no-rewrite guarantee.
c3c9792 to
06b5a0c
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 无 —— open+closed 的 issue/PR 里按同一错误签名( 我按代码(不是按描述)审了这个 PR。结论:修法方向正确,但你原来加的那个测试是假测试——在没修的情况下它也能通过。我已直接在你的分支上把测试修好(独立标注 commit),并顺手 rebase 到最新 master。细节如下。 审核过程
八问结论
行为变更披露(有意):gate 触发面扩大——旧:仅视图内有带签名 reasoning 才触发;新:有 redacted_thinking 载体也触发。后果:凡出现过 redacted 块的会话不再享受 #651 节省(与 signed thinking 早已接受的权衡一致,且严格降低 400 风险)。 遗留说明(与你 note 一致):没有 failing wire body,无法排除其他改写路径;本 PR 关闭的是读码确认的这个 gap。若后续再报同类 400,需先抓实际 wire body 再定位下一条路径,不建议在无证据下扩大本 PR 范围。 判定:本地定向验证通过、rebase 干净、mergeable,CI 转绿即可由人合并:#3196 |
(ai: vllm-qwen/qwen3.8-27b) CI 结果更新(接上条):pushed head 1. 挂了哪些测试(6 个 job 去重后共 4 个,全是真进程+端口+时序敏感 e2e):
2. 与 PR diff 无关的证据:
3. 处置:按「同一失败域一个 issue」的粒度,已立 #3206 跟踪这组 flake(带来源标记,含两次运行的对照证据与建议方向),不在本 PR 里混修。 更新后的判定:本地 typecheck + 定向测试(含 A/B 复现验证)全绿;CI 红灯全部归因于 #3206 的既有 flake 家族,非本 PR 引入。是否合并由你定:若接受「已知 flake 红、diff 相关 lane 全绿」可直接合;想要干净信号的话 retrigger 一次即可(注意可能再中 flake)。PR:#3196 |
ranxianglei#3222 restructured the ranxianglei#651 drop on master (planReasoningDrop/applyReasoningDrop), so the ranxianglei#1960 redacted_thinking gate now lives in planReasoningDrop; the standalone withReasoningDrop keeps composing it, tests unchanged.
|
(ai: zhipuai-lb/glm-5.3) Thanks for the fix — the gate logic is exactly right ( Heads-up: master had moved under this branch (#3222 restructured The follow-up that builds on this gate lands in #3311 (compress-reasoning flush timing, #3198) — your branch is the base of that stack, so merging this PR unblocks it. |
(ai: vllm-qwen/qwen3.8-27b) 收到,我独立复核了这次手工合入(没有只信报告),结论:合入是干净的,没有破坏任何东西。 1. 手工 merge 复核(3b2da8f)
2. CI 红了 6 个 shard——已逐一定性,都不是这个 PR 的问题
3. master 又前进了 31 个 commit(含 #3266 移除 image-compression、#3080 output-budget-floor):对当前 master(6ee4a2a)冲突探测 = 0,门控区域 churn = 0 → 不需要再次同步,GitHub 可直接合并。 结论:手工合入验证通过,CI 红项均已归因到仓库级既有问题(#3319 / #3206)。此 PR 可以合,合完解锁 #3311/#3198 的后续栈。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.482-master.a046d4e # this exact build
npm install -g billion-context@master # always the newest merged build
|
Problem
Anthropic sessions with extended thinking intermittently fail with:
messages.N.content.M:thinkingorredacted_thinkingblocks in the latest assistant message cannot be modifiedSetting
compress.reasoning.drop: falsemakes it go away, so the #651 drop is the rewriter.Cause
withReasoningDrop(#1658 gate) only treats a reasoning message with a signature as signed thinking.redacted_thinkingblocks ride as atextmessage withrawAnthropicBlock(kernelwire/anthropic.ts), so they never arm the gate. Dropping the sibling reasoning run before a closedcompresscall then rewrites the assistant message holding them.Fix
Gate also trips on
rawAnthropicBlock.type === 'redacted_thinking'. Adds a test intests/reasoning-echo.test.ts; the file passes (59/59).Note: I could not capture a failing wire body, so this closes the gap I found by reading the code. It may not be the only path.