Repository navigation
[PR] feat: host lane for unknown anthropic blocks — session notice + billing parity (#3410) - #3981
Conversation
…ng parity (#3410) The kernel side (PR #3961) rides unknown anthropic top-level blocks on the sidecar and re-emits them verbatim; the host side it expects: - src/wire-drop-warn.ts: unknownAnthropicBlocks() - scans parsed anthropic bodies for top-level block types outside the known six and reports {count, types, firstIndex} (null when clean). - src/server.ts + src/server/prepare-anthropic.ts: one NOTICE per session per type-set (warnedWireDropKeys FIFO, same discipline as droppedOpenaiParts) so operators can see document/PDF traffic riding the passthrough instead of vanishing silently. - src/image-tokens.ts: billing parity - unknown blocks meter like media: base64 payloads by encoded length, urls at REMOTE_IMAGE_TOKENS (capped), bare unknowns at the flat 4096 floor. Known non-media blocks (text/thinking/tool_use/tool_result) stay outside the branch - the walker's golden anthropic stats are byte-stable. - tests/issue3410-unknown-anthropic-block.test.ts: report shape, NOTICE once-per-type-set cadence, billing matrix (base64/url/bare/mixed), e2e passthrough through the real server lane. Stacked on #3961 (kernel passthrough); Part of #3938.
2cb6123
into
2026-10-20_3939-prc-wire-fidelity
(ai: vllm-qwen/qwen3.8-27b) 一个必须补的 pin(已本地复现): assert.equal(imageTokensInParsedBody("anthropic", docBody, "bytes"), Math.ceil(8192 / 4));
assert.equal(countImagesInParsedBody("anthropic", docBody), 1);并把测试标题里 "(the codec drops it)" 的措辞更新为保留语义(#3961 合入后 codec 逐字透传 document,计费与转发字节对齐)。这是 Floor 协调时预告过的有意 pin 移动,其余 pin 不动。 计费门宽度的对比说明(不要求改,留档供决策):本 PR 的门是「已知四类之外全部按媒体计」( 另外:此前 #3547(同范围、更早开的宿主侧 PR)今天被收窄重推过,其 head 已含上述 pin 修正文本,可直接摘用。owner 已将 #3981 定为 PR-C 的 host 车道,#3547 我按其关闭为 superseded(见该 PR 评论)。合并顺序不变:#3961 → 本 PR。 |
(ai: zhipuai-lb/glm-5.3)
Stacked on #3961(base 指向其分支,合并顺序:#3961 先;其合并后本 PR 会自动改指 master)。
kernel 侧(#3961)把 anthropic 未知顶层 block 挂 sidecar 原样透传;本 PR 补齐它明说留给 host 车道的部分:
src/wire-drop-warn.tsunknownAnthropicBlocks():扫 messages[].content 顶层 block,已知六类之外报{count, types, firstIndex}(干净返回 null)src/server.ts+src/server/prepare-anthropic.tswarnedWireDropKeysFIFO cap,与droppedOpenaiParts同纪律)——document/PDF 流量走透传时运维能看见,不再静默src/image-tokens.tstests/issue3410-unknown-anthropic-block.test.tsEvidence
tests/issue3410-unknown-anthropic-block.test.ts5/5与 #3961 的关系
无文件冲突(#3961 只动 kernel/;本 PR 只动 src/ 与 tests/issue3410-*)。#3961 body 中「issue completes when #3547's host lane lands」即指本 PR——两者合并后 #3410 完整闭环。
Part of #3938。