Repository navigation
[PR] pi inline mode: add Codex WebSocket channel — local loopback WS bridge + relaxed toggle value constraints | pi inline 模式补上 codex WebSocket 通道:本地回环 WS 桥 + 开关取值放宽 - #4527
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.5487-pr.4527.9039b11This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4527.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 本 PR 对应 issue #4526(inline 模式 codex WS 绕过压缩),open/closed 里无同机制的其他 PR。但发现一处跨 PR 重叠:本 PR 第 2 个 commit( 开始按 PR 规范审核:①原 issue 方向 → ②回归审查 → ③代码 → ④测试有效性 → ⑤diff 整洁度,结论用结构化八问回复。 |
…ge in pi inline mode (#3278 follow-up) Inline mode froze state.origin to the never-dialable INLINE_ORIGIN and skipped installNativeWebSocketIntercept entirely, so codex WS traffic went DIRECT and bypassed compression with no ACP session. The inline engine now boots the same ws-bridge the spawned server serves, bound to 127.0.0.1:0 (loopback-only admission, tunnel guard, unref'd), the WS wrapper prefers state.wsOrigin over the pseudo-origin, and a failed or wedged bridge degrades that lane DIRECT (warned, 20s bound) while HTTP compression keeps running in-process. planNativePi now treats any non-empty BILI_PI_INLINE except 0/false/no/off as on: on/yes/TRUE used to miss the 1/true set and silently spawn a proxy server — the 'inline does not work' report.
…store the missing pluginLaneServerHistory seed (#4491 drift) docs-sync regenerates CONFIGURATION*.md from website/config-reference yaml seeds — hand edits to the generated blocks drift. The #4491 row was hand-added without its seed, so every generate run (incl. docs-sync in CI) wanted to delete it; seeding it keeps the row and the env index entry. Backticks are forbidden in seed descs, hence the de-ticked row text.
…n guard fired on restored artifacts The #4377 cache skip left kernel/dist with save-time mtimes while the checkout rewrote kernel/src mtimes; kernelDistStale() compares mtimes, so the first real cache-HIT PR (this one — no kernel changes) made the golden-storage drives refuse to run on 5 legs. Touch the dist tree on every HIT (metadata-only; bytes are already marker-verified).
… this branch (other branches do create runs)
27e81a4 to
81e34b8
Compare
81e34b8 to
28ab76d
Compare
(ai: vllm-qwen/qwen3.8-27b) 一句话:这个 PR 的合并冲突已经解决了,本次冲突 lane 无需 rebase / push。 现在挡住合入的不是文本冲突,而是 CI 红——而且红的主体是 master 自身的存量红,不是本 PR 或这次 rebase 带进来的。 冲突维度证据(为什么无需动作)
结构化八问
建议(供 owner / reviewer 定夺,我不越界去动 load-bearing 路径)
收工判定:冲突已解决、无 rebase 可做;PR 暂不可合的原因已从「冲突」澄清为「master 存量 CI 红 + 本 PR 一处测试类型小坑」。冲突 lane 到此收工。 |
(ai: vllm-qwen/qwen3.8-27b) 审核完成(针对 rebase 后的分支 tip 标签: bug, pi, codex, scope/wiring, p2(pi inline 车道的 codex WS 压缩绕过缺陷;能用但 inline+codex 用户丢压缩,有绕行,非数据丢失类) 结构化八问
行为变更披露(旧值→新值 + 原因)
发现清单A.[拦路·与本子无关]master 本身红。本分支 rebase 到当前 master 后继承其红,失败签名全部落在本 PR 未触碰的文件上,且与 master 自己的 CI 运行(12:22Z)逐条同签名:
B.[需拍板]commit 3(CI mtime 修复)与在途 PR #4549 重复:两者修同一个 #4548(pretest-cache HIT 后 dist mtime 陈旧触发 #3325 golden guard)。建议从本 PR 移除该 commit(保单 scope,让 #4549 专修 CI),或反向关掉 #4549 留在这里——二选一。 C.[一行修复·耦合 B] D.[噪音]两个空 retrigger commit( E.[非阻塞 P3 小疵,不影响正确性]:① F.[首条回复的重叠项,已自动消解]#4534(pluginLaneServerHistory seed):rebase 后该 seed 已在 master( G. 作者注明的本地假红警告已核实: 收工判定暂不合。代码本身(主修复 + docs seed + zh 再生成)质量达标,可以合;先决条件三件:① master 红(A)由你定夺处置;② B 的重复 commit 二选一;③ 按 B 的结果落 C 的那一行 |
|
(ai: zhipuai-lb/glm-5.3) 收尾清理:同 issue 存在更新的 PR #4559。关单;误判请 reopen。 |
…inline lane's pseudo-origin rewrite was dying on real DNS (#4527) The native intercept rewrites model URLs to ${INLINE_ORIGIN}/bili/<upstream> and hands them DOWN its send() to the inline transport link. But the inline link's patched wrapper runs inside the #1662 depth protocol: depth===1 means 're-entry', so it skipped its own dispatch and the pseudo-origin URL fell through to the raw fetch — ENOTFOUND billion-context.inline. Every model AND management fetch in the real inline lane failed this way since #3278 (no e2e ever exercised the two links stacked like the production arm). Fix: each link's send() now stamps the exact downstream function it calls (chainHop AsyncLocalStorage); a patched wrapper entered with the hop pointing at ITSELF is a legitimate descent from the bili link directly above and runs its dispatch one level deeper. A foreign wrapper in between re-issues the call as its own hop, so the identity match fails and #1662 truncation keeps protecting the descent exactly as before. Adds the missing composition test: inline link + native intercept installed in production order; a plain model URL must land on the engine and the real upstream must stay untouched.
…inline lane's pseudo-origin rewrite was dying on real DNS (ranxianglei#4527) The native intercept rewrites model URLs to ${INLINE_ORIGIN}/bili/<upstream> and hands them DOWN its send() to the inline transport link. But the inline link's patched wrapper runs inside the ranxianglei#1662 depth protocol: depth===1 means 're-entry', so it skipped its own dispatch and the pseudo-origin URL fell through to the raw fetch — ENOTFOUND billion-context.inline. Every model AND management fetch in the real inline lane failed this way since ranxianglei#3278 (no e2e ever exercised the two links stacked like the production arm). Fix: each link's send() now stamps the exact downstream function it calls (chainHop AsyncLocalStorage); a patched wrapper entered with the hop pointing at ITSELF is a legitimate descent from the bili link directly above and runs its dispatch one level deeper. A foreign wrapper in between re-issues the call as its own hop, so the identity match fails and ranxianglei#1662 truncation keeps protecting the descent exactly as before. Adds the missing composition test: inline link + native intercept installed in production order; a plain model URL must land on the engine and the real upstream must stay untouched.
Fixes #4526
修什么
开
BILI_PI_INLINE后,codex 的 Responses WebSocket 流量原来直连上游、完全绕过压缩(原因分析见 issue)。本 PR 三件事:src/inline-ws.ts):inline 引擎启动时在127.0.0.1:0起一个只服务 WS 升级的监听,复用现有ws-bridge.ts的全套安全检查(只认本机回环来源、会话头校验、隧道目的地防 SSRF、unref()不拖住进程生命周期)。codex WS 改写到这个真端口,由进程内引擎照常压缩。state.wsOrigin传给 WS 包装器,只影响 inline 模式,spawn/attach 模式行为不变。BILI_PI_INLINE除0/false/no/off外任何非空值都算开(原来只认1/true,on/yes会静默落回起 server——这就是"inline 不管用"的一个真实来源);inline 生效时打 info 日志"inline 模式,不另起 proxy",失效原因从此可见。改动文件
src/inline-ws.ts(新):回环 WS 桥启动器src/inline-engine.ts:引擎启动时一并起桥,暴露wsOrigin;HTTP 形管线驱动dispatchHttp(给桥的会话信封用,裸驱动,不再包自己的传输层——会话外层已包 WS 出口)src/agent/native-ws-intercept.ts:快路径优先state.wsOrigin;pending 的桥启动有 20 秒上限,超时按"没桥"降级,不会把连接卡在 CONNECTINGsrc/agent/native-intercept.ts:NativeInterceptState加可选wsOrigin字段src/agent/pi-native.ts:inline 分支挂wsOrigin、不再跳过 WS 包装器、修正错误注释、放宽取值、加 info 日志tests/pi-inline-ws.test.ts(新):全链路(假 codex WS 上游 → 包装器 → 回环桥 → 假引擎管线 → 三帧响应逐帧核对)、桥口纯 HTTP 426、桥失败降级直连、取值矩阵tests/pi-inline.test.ts:假引擎补两个新字段CONFIGURATION.md:取值表和说明更新测试
tsc --noEmit0 错误;unused-export 门 cleanBILI_PROVIDER_REWRITES等残留环境变量会让 pi-native 的模块级用例假红,清掉再跑(与 CI 无关)