Skip to content

[PR] test: pin the already-fixed 413 root causes (egress fuse dsh_ exclusion, ingest band default-off) at the relay level - #7488

Merged
ranxianglei merged 1 commit into
masterfrom
test/413-egress-fuse-pins
Nov 23, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
test/413-egress-fuse-pins

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

这是什么

两个已经修好但还没发版的 413 根因,补上 relay 级端到端测试钉住,防止将来回归。本 PR 不改任何 src/ 代码,只有测试。

这两个修复之前只有单元级测试(计量函数本身),没有走真实转发链路的 e2e 钉——计量函数以后被人"顺手"改回去时,现有测试未必挡得住整条 fuse 链路。

改了什么

  1. 新文件 tests/issue7013-egress-fuse-dsh-extensions.test.ts(3 个测试):
    • 8 MiB 顶层 dsh_session_log + ~50 token 真实 prompt:body 不带 model(跳过 preflight)→ relay egress fuse 必须放行 200,且上游真的收到完整 ~8 MiB 体(是转发不是剥离);
    • 同形状带 model → preflight 的 measured 闸(同一个计量器的第二个消费点,armMeasuredBar)也必须放行;
    • 单元钉:非 dsh_ 前缀的顶层扩展字段仍然计入(排除是前缀限定的,不是"所有未知字段都不计"的计量后门)。
  2. 扩展 tests/issue5794-ingest-cap.test.ts(+2 个测试):

测试

  • 新文件 3/3 绿;扩展文件 6/6 绿;相邻既有 raw-body-dsh-extensions 3/3、issue4079-egress-window-fuse 4/4 不变;tsc --noEmit 干净。

风险

零行为风险(纯测试)。若 CI 中某个新 e2e 暴露既有行为与断言不符,说明"已修"结论有误,应以本 PR 的失败为准重新诊断。

Refs #7013 #7189 #7168 #6908 #7426(发版进 tag 后统一关闭)

…on, ingest band default-off) at the relay level

f6e891d (root-level dsh_* extension fields stop counting in the raw-body
meter) and d351a4d (PR #7443, ingest cost band defaults to 0 for all lanes)
fix #7013/#7189/#7168 and #6908/#7426 respectively, but both are unreleased
and neither had a relay-level end-to-end pin:

- tests/issue7013-egress-fuse-dsh-extensions.test.ts (new): an 8 MiB
  top-level dsh_session_log with a ~50-token real prompt forwards 200
  through the relay egress fuse (no model -> preflight skipped) AND through
  preflight's measured gate (with model); plus a unit pin that NON-dsh_
  top-level fields still count (the exclusion is prefix-scoped, not a
  meter bypass).
- tests/issue5794-ingest-cap.test.ts (extended): a RE-ARMED band still
  refuses the opencode/dsh re-send lanes (the default-off decision is an
  opt-in re-arm, not a lane exemption — the conscious #6908 tradeoff), and
  the /v1/responses lane stays exempt from the band even when re-armed.

Refs #7013 #7189 #7168 #6908 #7426 (all close at the next release, once
the fixes are in a tag).
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: test/413-egress-fuse-pins (4222c55)

Latest build — install this exact version

npm install -g billion-context@0.0.11249-pr.7488.8303695

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
4222c55 billion-context@0.0.11249-pr.7488.8303695 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr7488.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:不重复。 本 PR 是纯测试钉(零 src/ 改动)。与 #7092 同根因家族(#7013)但性质不同——#7092 是根因修复(把计量器改成「只计 prompt mass」),本 PR 钉的是已合入 master 的 f6e891d / d351a4d;两者无文件重叠、不互相阻塞。与已合并的 #7443 也不重复(那是 ingest 默认关的修复,本 PR 补的是它的权衡钉)。

标签:bug / dsh / opencode / scope/wiring / p2(钉 413 缺陷的测试线;dsh 与 opencode 两车道都涉及;闸门在请求边界;缺陷本身已修好故非 p1,但保护的是 p1 级行为故不降 p3)。

前置核实:f6e891d 与 d351a4d 均为 master 祖先;所引 #7013/#7189/#7168/#6908/#7426 五个 issue 均 open 且与 PR 描述一致;既有覆盖确实只是单元级——tests/raw-body-dsh-extensions.test.ts 直接 import 计量函数,无 server/relay/fuse。

八问:

  1. 是什么问题:不是新 bug 也不是新功能——两个「已修好但未发版」的 413 根因此前只有单元级测试(计量函数本身 / knobs 默认值),没有走真实 relay/fuse/ingest 链路的端到端钉;计量器将来若被人「顺手」改回「全计」,现有测试挡不住整条 fuse 链路。本 PR 补这个钉。
  2. 什么原因导致的:两个根因本身——①出站计量把顶层 dsh_* 遥测字段(~8 MiB dsh_session_log)计入出站体 token,真实 ~100K prompt 每轮被 egress fuse 本地 413(f6e891d 排除顶层 dsh_* 已修);②32 MiB ingest 成本闸量的是折叠前入站体,重发车道(dsh/opencode 每轮重发全量历史)会话攒过 cap 后永久 413 自锁(d351a4d 默认 band=0 已修)。本 PR 不改二者,只钉住。
  3. 影响范围与严重程度:零用户面影响(纯测试)。保护的是 p1 级行为(每轮 413 = 会话不可用),但该行为已修好;本 PR 本身是预防性钉,无外部影响。
  4. 怎么修复的:5 个测试——①8 MiB dsh_session_log+小 prompt(无 model,跳过 preflight)须过 relay egress fuse,且上游真收到完整 ~8 MiB 体(是转发不是剥离);②同形状带 model 须过 preflight 的 measured 闸(同一计量器的第二消费点 armMeasuredBar);③单元钉:非 dsh_ 顶层扩展字段仍计入(排除是前缀限定的,不是「所有未知字段都不计」的计量后门);④重新武装 ingest 闸(1 MiB)后 opencode/dsh 重发车道仍被 ingest 413——「默认关」是操作员 opt-in 再武装,不是车道豁免;⑤/v1/responses 车道即使再武装也按协议豁免 ingest 闸。
  5. 是否有回归问题:无。纯测试,未改任何既有行为;测试文件进程隔离干净(BILI_INGEST_BODY_BYTES 存/还原、port 0、finally close),不干扰同 CI lane 其他测试。本地实跑:新文件 3/3、扩展文件 6/6、相邻 raw-body-dsh-extensions 3/3 与 issue4079-egress-window-fuse 4/4 不变,tsc --noEmit 干净。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

测试有效性(关键核查):5 个测试全部「有牙」——我逐个临时还原修复确认其变红,验证后源码全部还原(git status 干净):

  • 还原计量器 dsh_ 排除 → ①② 变红,失败形态正是修复前病理:413 egress_window_fuse,"outbound body measures ~2,006,927 tokens … vs the effective model window 20,000"(同时证明无 model 的测试①真的武装了 fuse,不是空转通过);
  • 把排除扩成「所有未知顶层字段都不计」→ ③ 变红;
  • 给 ingest 闸加 opencode/dsh 车道豁免 → ④ 变红;
  • 去掉 protocol === "responses" ? 0 : 豁免 → ⑤ 变红(413 stage=ingest)。

跨 PR 交互(注意,非阻塞):#7092(open)是同家族根因修复——把计量器改成「只计 prompt mass」(按 wire 的 PROMPT_BODY_KEYS),supersede f6e891d 的「排除 dsh_*」窄修法。#7092 合入后,测试③的断言(非 dsh_ 字段仍计入 .total)可能需要按新计量语义重钉;①② 与两个 ingest 钉不受影响。两 PR 无文件重叠,可任意顺序合并,后者只需同步钉。

CI:30 checks,0 失败,11 运行中,其余绿(static-gates 已绿)。

判定:可合并。 纯测试钉、零行为风险、5 个测试全部有牙、diff 干净(2 文件 +276/-0,全测试相关)、typecheck 干净。唯一留意点是与 #7092 的语义跟进(③ 可能需在其合入后重钉),不阻塞本 PR。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

CI fix: lock-sync red → green. The only failing check was lock-sync (verified live at wake: 1 failure, all other guards green). Root cause: the PR commit bumped kernel/package.json 0.0.201 → 0.0.202 but did not regenerate the lockfiles, so the root package-lock.json (and kernel/package-lock.json) still recorded acp-kernel 0.0.201 — the job's npm install --package-lock-only + git diff --exit-code caught the drift.

Fix: ran the job's exact commands locally (npm install --package-lock-only --ignore-scripts --no-fund --no-audit at root and in kernel/), verified idempotency (re-running produces no further diff), committed the resulting 3-line version-field diff as the final head 74bbb3429f3 (unmarked — this is the branch's one full CI pass), and pushed. No code, config, or behavior changes.

Note: the earlier run's test lanes were skipped because that run was triggered by a label event (plan scope = skip for non-ci:full labels); the push triggered a fresh run where the full core test matrix actually ran.

Verified via the GitHub API (the mirror check-cache poller stalled at 18:18:04Z during the run, so I did a single direct API read of the run rather than loop-polling): ci.yml run for head 74bbb3429f3 is completed success — 27 success / 1 skipped / 0 failure, including lock-sync and all 11 test shards.


七问(CI 修复)

  1. 是什么问题:PR [PR] fix(nudge): measured wire-body tokens arm EMERGENCY when usage is frozen behind the egress fuse #7490 的 lock-sync 检查红——根 package-lock.json 与 kernel/package-lock.json 里 acp-kernel 版本还停在 0.0.201,而 PR 已把 kernel/package.json 升到 0.0.202。
  2. 什么原因导致的:PR 提交升了 kernel 版本、改了 kernel 源码,但没有同步重新生成 lockfile;acp-kernel 以 file:./kernel 方式被消费,根 lockfile 会记录 kernel 版本,lock-sync 的幂等重生成 + diff 检查因此报漂移。
  3. 影响范围与严重程度:仅 CI 门禁——PR 被 blocked 无法合并;对运行时零影响,lockfile 只是如实记录已升的版本。
  4. 怎么修复的:本地跑 lock-sync 同款命令重新生成两个 lockfile,确认幂等(再跑无新 diff),以单提交推为最终 head(不带 [ework:ci-held]),触发一次完整 CI。
  5. 是否有回归问题:无。diff 只有两个 lockfile 的版本字段(0.0.201→0.0.202),与 CI 自己重生成的结果逐字节一致;无代码/配置/行为变更。新 head 全量 CI 绿(27 success / 1 skipped / 0 failure,含全部 11 个 test shard)。
  6. 是否破坏缓存:否,无任何运行时代码变更。
  7. 是否改了设计方向:否。

判定:lock-sync 已修复并验证全绿,PR 无剩余红项,可进入合并评审。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

⚠️ 误发说明:上一条(floor 5,CI fix: lock-sync red → green)是发错楼的评论——它属于另一个 PR(GitHub #7490 / 镜像 #7492,nudge measured-body 修复),与本 PR(413 根因测试钉)无关,请忽略。我已把该评论补发到正确的线程(镜像 #7492)。本 PR 的 CI 状态不受该评论影响:其 30 checks 此前已核实 0 失败。

@ranxianglei
ranxianglei merged commit 08783ee into master Nov 23, 2026
87 of 126 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1287-master.08783ee (rolling master tag).

npm install -g billion-context@0.0.1287-master.08783ee  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

ranxianglei pushed a commit that referenced this pull request Nov 23, 2026
…_* intercept

The #7168/#7439 intercept (240a2e5) strips top-level dsh_* from the inbound body by default (rollout passDshExtensions percent:0), so the 8 MiB dsh_session_log no longer rides to the upstream. The test pin (4222c55, #7488) still asserted the pre-intercept ride-along (bytes > 7.9MB) and went born-red once both commits landed on master (08783ee) — a master-level stale test, not a regression in this PR (git diff origin/master..HEAD is empty for the 4 touched files).

Re-pin:
- keep the original fuse-blindness pin as the PASS-THROUGH (release-path) case (BILI_ROLLOUT_PASS_DSH_EXTENSIONS=1 forces the intercept off, the extension rides along, the fuse/measured-bar must not trip);
- add a DEFAULT (strip) case: the extension is dropped, the small real prompt forwards, neither gate trips.
ranxianglei pushed a commit that referenced this pull request Nov 23, 2026
…lict, round 7)

Master moved 0b68ade -> 15f06c6 (kernel 0.0.205, +preflight
emergency-digest default-off #7549, +preflight 413 passthrough #7548,
+sessions reattach #7512, +opencode user-fork detection #5511,
+acp-status uncompressed nudge-align #7536, +preflight gate epoch
exception #7558, +413 egress fuse pins #7488, +Korean README #7551,
+many host/test changes).

Conflicts: 3 version-only files (kernel/package.json,
kernel/package-lock.json, root package-lock.json). Resolved to kernel
0.0.206 (merged kernel = superset of master's 0.0.205 + PR #6720/#6762
changes; kernel/src changed vs master => must bump above master's 0.0.205).

Auto-merged clean: kernel/src/compress.ts (PR markers 13x + master
changes), src/stream.ts (PR markers 3x), src/server.ts, master's new
test files, docs.

Local verification: typecheck ✓, build ✓, kernel 1671 pass / 0 fail,
host nudge/receipt 7 pass / 0 fail, kernel-guard ✓ (SRC_CHANGED=2
BUMPED=1 0.0.205->0.0.206), version-guard ✓ (root 0.1.216 untouched),
lock-sync ✓.
ranxianglei added a commit to mariopasquali/billion-context that referenced this pull request Nov 23, 2026
…pins to the ranxianglei#7470 intercept contract

ranxianglei#7470 (240a2e5) landed after these pins were written in ranxianglei#7488 (4222c55):
DSH top-level dsh_* client extensions are now intercepted before egress,
so the upstream no longer sees them. The old assertions (extension rides
along, ~8 MiB body upstream) went red on master the moment ranxianglei#7470 merged.
Re-pin to the new contract: the small real prompt still forwards (the
dsh_-blind meter holds) AND the upstream body contains no
dsh_session_log. The residual-semantics unit test (non-dsh_ fields still
count) is unchanged and still green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant