Skip to content

[PR] fix: egress-shed gate keys on the WS transport tag, not any managed transport (#3701 Finding 1, option a) - #3778

Merged
ranxianglei merged 1 commit into
masterfrom
fix/ws-shed-gate-narrow
Oct 19, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
fix/ws-shed-gate-narrow

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

ai: zhipuai-lb/glm-5.3

#3771 之外无关联 issue;来源 = PR #3706 review 的 Finding 1(owner 评论 issuecomment-6259847978 待拍板项 ①,选项 (a))。

一句话:摘图门从「任何受管自定义传输」收窄到「真 WebSocket 传输」——dsh-inline 的 HTTP 大请求不再被无谓摘图。

问题(#3706 引入的过宽门)

network.wsOutboundBytes 的发送前摘图门判定条件是 currentFetchTransport() !== undefined——而设置受管传输的有两处:

入口 传输性质 该不该摘
src/responses-ws.ts:729 真 Responses-WS ✅ 1009 超大帧判决只在这里观测到
src/inline-engine.ts:253 dsh-inline 的受管 HTTP fetch ❌ HTTP 没有这道门限——同一载荷 16 MiB 走 HTTP 正常送达

后果:dsh-inline 超 10 MiB 的 HTTP 请求,老图被摘成占位符、部分图片被强制缩档——信息白损 + 前缀缓存白断,而 HTTP(硬拒上限 network.outboundBodyBytes=5 GiB)本来能完整送达。

修法(选项 (a),最小改动)

  • src/fetch-transport.ts:markWsLaneTransport() / isWsLaneTransport()(WeakSet 打标)
  • src/responses-ws.ts:729:transport 闭包套 markWsLaneTransport(...)
  • src/egress-shed.ts 门条件:currentFetchTransport() === undefined → !isWsLaneTransport(currentFetchTransport())
  • 文档(CONFIGURATION.md「for the WebSocket lane only」「HTTP lanes are unaffected」)原本就承诺 WS-only——现在行为兑现承诺,零文档改动

测试

行为变化

场景 旧 新
WS 帧 > 10 MiB 摘图减载(#3701 本意) 不变
dsh-inline HTTP > 10 MiB 被误摘 原样送达(回到 #3706 之前的行为)
无受管传输(普通 HTTP/代理车道) 透传 不变

…ransport (#3701 Finding 1)

The network.wsOutboundBytes pre-send image shed fired for ANY request running
under a managed custom fetch transport — including dsh-inline's HTTP lane
(inline-engine.ts), whose large bodies deliver fine (16 MiB observed
succeeding; the close-1009 oversize verdict was never observed there).
Docs already promised WS-only; now the gate actually is: responses-ws.ts
tags its transport with markWsLaneTransport, and shedEgressIfOverBudget
passes through everything else untouched. Regression pin: the managed-HTTP
(dsh-inline shape) transport must pass through byte-identical with zero
sheds.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: fix/ws-shed-gate-narrow (cf794e9)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4466-pr.3778.1d8f25c

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

Option B — Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix: egress-shed gate keys on the WS transport tag, not any managed transport (#3701 Finding 1, option a) [PR] fix: egress-shed gate keys on the WS transport tag, not any managed transport (#3701 Finding 1, option a) Oct 19, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复 —— open+closed 按 wsOutboundBytes / 摘图 / egress shed / #3706 Finding 等签名检索均只命中本 PR;这是 #3706 review Finding 1(选项 a)的唯一实现 PR,无其它追踪 issue。
标签:bug / dsh / opencode / pi / scope/wiring / p2(缺陷修复;行为变化落在 dsh-inline HTTP 车道,WS 车道(opencode V2 / pi codex-responses)是门的保留目标面;协议接线域;能用但特定条件下有明显问题 → p2)。

独立审核进行中:已拉分支(master + 单 commit cf794e9,base 最新)、diff 逐行读完、门控机制在 src/inline-engine.ts:252-256 对码确认;CI 静态门禁全绿、全量 test shards 在跑。结构化八问结论稍后单独发。

先报一个合并前必须处理的问题:PR 描述开头写「Closes #3771」是错的 —— #3771 是「snapshot-render D 车道测试 CI 非确定性红」,仍 open 且正在修(修它的是 #3774),与本 PR 无关;照现状合并会误关 #3771。本 PR 实际没有对应追踪 issue(来源是 #3706 review 线程里的拍板项),这行应删掉或改写。我会在收尾时直接修掉 PR 描述并报备。

@ranxianglei
ranxianglei merged commit 81ebd8e into master Oct 19, 2026
73 of 111 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.596-master.81ebd8e (rolling master tag).

npm install -g billion-context@0.0.596-master.81ebd8e  # 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant