Repository navigation
[PR] fix(agent): name the incompressible media share in the unattributed byte-cap 422 (#7450) - #7454
Conversation
…yte-cap 422 (#7450) The silent-direct byte ceiling (8 MiB) is on TOTAL body bytes, but compression only acts on text. An image-heavy unattributed session that crosses the cap got a 422 that said only 'body larger than the ceiling' with no way to tell whether the incompressible media alone already exceeds it (a dead end) or the text remainder could still be folded. Bill the media share (mediaBytesOfWireBody, the same walk the doom arms use) when the raw body is cheaply at hand, and name it in both the refusal message and the log: - media >= cap -> dead-end wording (fresh session / smaller images; bili routing will not remove the media) - media < cap -> media share named + the text-remainder remedy - media = 0/unknown -> legacy wording, byte-count basis still shown Regression test covers all three rows (dead-end, foldable, pure-text negative) against a 1 MiB cap via BILI_SILENT_DIRECT_MAX_MB.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11194-pr.7454.3903d4fThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7454.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) PR #7454 review — verified live, mergeable. State (just checked): open, mergeable, not draft; head Independent verification (not just the PR's claims):
八问(独立审核,非照抄 issue 侧)
一个提醒(非阻塞):PR 正文写 "Closes #7450",但 #7450 是机制报告(方向 1/2/3),本 PR 只做了方向 3(诊断)。核心机制(方向 1:byte-aware trigger)已单独立项 #7455(open, 结论:可合。 代码正确、定向测试 + typecheck 全绿、CI 全绿、diff 干净、标签齐。合并权在你(agent 不合并 PR)。 |
Fourth merge of master into the v6 re-land lane (master 75ab922, +74 commits: #7465 protectedMass, #7470 dsh-ext intercept, #7437 per-session ingest watermark, #7503 KDD7 doc, #7476 429-governor default-off, #7454 byte-cap, #7423 opencode fork lineage, #7417 tag-echo turn-bleed, plus kernel 0.0.202). Four conflicts, all config-reference docs where both sides added rollout entries at the same table position — resolved as union: lane's watermarkV6MsgId + watermarkV6Render rows kept (grouped with pluginFullResendWatermark), master's passDshExtensions row kept after them. Files: docs/configuration.md, docs/configuration.ja.md, docs/configuration.zh-CN.md, website/config-reference/rollout.yaml. No production-code conflicts; all src/ auto-merged. Typecheck + build clean; targeted suites 170 pass / 0 fail / 1 skip (pf-channel, v6 lane, v5 fastpath, storage, #2929, rollout, msgid-rule-parity, render-snapshot).
Closes #7450
What
The silent-direct byte ceiling (8 MiB,
MAX_SILENT_DIRECT_BODY_BYTES) is on total request-body bytes, but compression can only act on text. An unattributed image-heavy session that crosses the ceiling got a 422 that said only "body larger than the silent-direct byte ceiling" — with no way to tell whether the incompressible media alone already exceeds the ceiling (a dead end no compression can rescue) or whether the text remainder could still be folded under it.This is the observability gap (direction 3) from the #7450 report: the user should be able to see at a glance which lock did not open.
Fix
In the unattributed byte-cap arm (
src/agent/native-intercept.ts):unattributedByteOversizeRefusalnow takes{bytes, cap, mediaBytes?}and names the byte basis (X B > Y B) in the message. When the media share is known:mediaBytesOfWireBody(the same protocol-agnostic walk the doom arms use, DSH's unattributed over-limit gate prices base64 images as text (bytes/4) — media-heavy requests are falsely rejected wi | dsh 无归属超限门把 base64 图片当文本计价(bytes/4)——媒体重的请求被假拒 422,上游本会正常接受 #4111) when the raw body is cheaply at hand (restored prep body / measured raw / string init body). One-time JSON.parse on the refusal path only (rare; the doom arms have the same exposure).; N B inline media, incompressiblewhen the media share is > 0.Behavior change (flagged)
x-bili-gate: oversize-refusal-unattributed-bytesheader, sameretryable: true). Only the diagnostic text changed.Scope
oversizeRefusal/unattributedOversizeRefusal/fallbackOversizeRefusal) already log the media split (native-intercept.ts:1816) and are a different verdict class.Tests
New regression test
install: the unattributed byte-cap refusal names the incompressible media share (#7450)covers all three rows against a 1 MiB ceiling (BILI_SILENT_DIRECT_MAX_MB=1):Targeted:
node --import tsx --test tests/native-intercept.test.ts— 94 pass (incl. the new test). Typecheck clean. Full build OK. Related suites (issue5686-compaction-direct-refusal, issue3304-incremental-direct-send) — 27 pass.