Repository navigation
[PR] fix: disable the 32 MiB ingest cost band by default for all lanes (#7426) - #7443
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11171-pr.7443.e0557dbThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7443.tgz
npm install -g packageInstall instructions are refreshed on each push. |
) #5794's ingest band proxied 'beyond every model window' by raw decoded bytes, which is invalid on the re-send lanes (opencode/dsh re-send the whole raw ledger every turn and bili folds it) — it 413'd a 33.5 MB opencode turn whose folded context was tiny. Default -> 0 (unlimited, all lanes); the sibling receive (5 GiB) / decode (10 GiB) transport guards still bound pathological bodies. BILI_INGEST_BODY_BYTES re-enables the band. Supersedes #6933.
bfb1de3 to
d351a4d
Compare
…ANGELOG entry (#7426) Drive-by: three code comments still described the 32 MiB band as the active default (content-encoding.ts, config.ts, handle.ts) — comments that disagree with the code are defects; reworded to 'disabled by default since #7426, set a byte value to re-enable'. Added the [Unreleased] Changed entry for the default flip (32 MiB -> 0, all lanes) per the per-PR CHANGELOG convention.
(ai: opencode/qwen3.8-27b) 查重: 不重复 —— 本线程即 PR #7443 的镜像,修的是 #7426(opencode 车道长会话被 32 MiB ingest 带永久 413);同主题的前置方案 #6933(只豁免 dsh 车道)已关闭未合并、被本 PR 取代,无并行重复工作(镜像 open [PR] 行中本线程仅此一条)。 标签: bug + opencode + scope/wiring + p1(缺陷修复;受影响车道 opencode;ingest 闸在请求接收边界;长会话永久 413 = 用户不能用 → p1) 审核结论:PR #7443 —— 可合(两处收尾我已修进分支)⓪ 独立性:以下全部基于我自己读的 diff、代码与 CI 状态,不是复述 PR 描述。 ① 方向(原 issue):#7426 的根因成立且已逐行核验——ingest 闸( ② 回归审查——diff 触碰路径的既有行为逐项清点:
③ 代码:改动面极小且干净——knobs 默认值+注释、1 个新单测(双向断言:默认 0 + env 重启用,符合 #3617 负向断言纪律)、4 份文档同步。测试有牙:精确断言 0 与 33554432,回归时抓得住。 ④ 我修掉的两个问题(已 push 到 PR 分支):
⑤ diff 整洁度:干净,每行都与本 PR 目的相关;无锁文件/生成物噪音( 验证(本地,定向):typecheck 通过; 八问
判定:可合(CI 新 head 全绿后收工;PR 合并由你操作)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1250-master.98fa957 # this exact build
npm install -g billion-context@master # always the newest merged build
|
把 ingest 成本带默认关掉(所有车道,不再限制)
这是什么
把 #5794 的 32 MiB「ingest 成本带」默认对所有车道关闭(
DEFAULT_INGEST_BODY_BYTES从 32 MiB 改成 0)。也就是:进来的请求体不再因为超过 32 MiB 就在
stage: ingest被 413 拒收。想重新启用时,把
BILI_INGEST_BODY_BYTES(或network.ingestBodyBytes)设成具体字节数即可(0 = 关闭)。为什么要关
那个 32 MiB 带本意是「可解析的 32 MiB+ 文本体已经 ≈800 万 token、超过一切真实模型窗口,
解析它注定失败还烧事件循环」——这对一次性会话成立,但对重发车道不成立:
opencode / dsh 每轮把整段原始台账重发进来、bili 会折叠它,此时「原始入站字节数」跟真实(折叠后)的
上下文大小没有对应关系。
#7426 就是这个错伤:一个 opencode 会话折叠后上下文很小,但原始重发体 33.5 MB,
于是每轮都被 ingest 带 413(
stage: ingest),永远发不出去。用户拍板:任何车道都放宽,放宽到不限制。所以直接把默认关掉(而不是像 #6933 那样只豁免插件车道)。
关掉之后还有什么兜底
ingest 带是三段闸里最靠后的一段。前两段还在、且远高于任何真实会话,所以「不限制」的实际上限是:
receive(收件原始字节)默认 5 GiBdecode(解码后字节)默认 10 GiB这两段是内存 / DoS 的传输层保护,不是 token 窗口保护,正常会话远远够不到。
所以关掉 ingest 带后,#7426 的 33.5 MB 请求完全畅通;只有真正病态的超大体才会被这两段拦。
改动
src/knobs.ts:DEFAULT_INGEST_BODY_BYTES32 MiB → 0(+ 注释说明 [Bug][opencode][ingest/0.1.216] Long sessions on the opencode lane are permanently 413'd by the 32 MiB ingest hard limit | [Bug][opencode][ingest/0.1.216] opencode 车道的长会话被 32 MiB ingest 硬闸永久 413(且 #6908/#6933 的修复只豁免 dsh 车道,opencode 仍在外) #7426 + 如何重新启用)。tests/issue5794-ingest-cap.test.ts:新增单测,锁「默认 = 0(不限)且BILI_INGEST_BODY_BYTES能重新启用」。原有 3 个 e2e(开带→413 / 未超→200 / 带图豁免)都显式设了 1 MiB 测试带,不受影响、照常通过。
docs/configuration.{md,zh-CN.md,ja.md}+docs/lifecycle.md):默认值 33554432 → 0,说明改成「默认关闭([Bug][opencode][ingest/0.1.216] Long sessions on the opencode lane are permanently 413'd by the 32 MiB ingest hard limit | [Bug][opencode][ingest/0.1.216] opencode 车道的长会话被 32 MiB ingest 硬闸永久 413(且 #6908/#6933 的修复只豁免 dsh 车道,opencode 仍在外) #7426),设值可重新启用」。
验证
tests/issue5794-ingest-cap.test.ts4 pass / 0 fail;build 通过(dist 标注 / external 均 OK)。取代
本 PR 取代 #6933(那只豁免插件车道的方案)。ingest 带默认关闭后,#6933 的豁免已无意义,关闭它。