Repository navigation
[PR] fix(fastpath-v6): tunnel-origin requests without the identity channel are cohort exclusions, not faults (#5760) - #5773
Conversation
… are cohort exclusions, not faults (#5760) The v6 identity hard gate assumes lane traffic comes from a native shim that stamps the pf-* handshake. That premise holds only off-tunnel: /bili/ prefix/attach traffic is a plain HTTP client with no in-process fetch interception, so an absent x-bili-pf-tail-ids there is structural — pre-fix every turn 400'd (five refusals then a 60-min park, repeating), making attach-mode sessions unusable whenever the watermarkV6MsgId rollout is forced on. The gate now passes such requests to the v5/legacy lanes as a silent cohort exclusion (same treatment as the carrier-absent exclusion). Non-tunnel traffic keeps the hard refusal byte-identically; tunnel traffic that DOES carry the channel (a shimmed host routed through /bili/) enters the gate unchanged, and present-but-bad channels stay faults for all origins.
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复 —— 91 个在途 [PR] 里只有这一个针对「fastpath-v6 tunnel-origin 排除」这一修复;其余 fastpath-v6 相关 PR(lane 本体 / render-snapshot 演进 / scan-resume)scope 各异,无并列重复。 对象:GitHub PR #5773(head 八问
一处非阻断观察:排除落在 判定:可合。属人工合并(identity/cohort 逻辑 + 协调的 lane 分支收口序列,非自动合并候选)。本地未跑全量(CI 为准),已逐行核源码 + 读 CI 状态。 |
|
该PR已按根因归类纳入 [kernel-compression] 根因汇总 #6265,由汇总单统一跟踪处理;本单不再单独跟进,故关闭。如认为归类有误或问题仍未解决,请直接回复,会重新打开。 |
|
状态更正(自动化脚本误操作): 本单此前被「纳入根因聚合」流程误关闭, 现重新打开。机器人工作已停, 本单由根因聚合线程统一跟踪, 根因修复落地后请手动关闭或在本单回复「close」。 |
|
更正说明:本单此前被归类聚合流程误关闭。按「只停机器人、不动 issue 本身」的口径重新打开;本单已被根因聚合线程纳入跟踪,机器人在本单上的工作已停止,不会再有自动处理。归类或纳入有误请直接回复指出。 |
|
重新打开:此前被归类聚合脚本误关。按 owner 口径,纳入根因聚合的 issue 只停机器人、不关闭,由根因聚合线程统一跟踪,根因修复落地后统一关闭。 |
|
(更正)此前按"清理"口径误关闭;按 owner 口径纠正:被根因聚合纳入的 issue 只停机器人、不关闭。本 issue 重新打开,机器人工作已停。 |
(ai: vllm-qwen/qwen3.8-27b) 说明:本单已无待办,我处于「等你回复」的空等状态,进程因长时间无动作被看门狗重启了两次——不是卡死或报错。 当前状态(已在上两条说清,这里收口):
无需你再触发我。如需调整归类或我留的两点(修复在 host 侧 |
Closes #5760
What this fixes
With the
watermarkV6MsgIdrollout forced on (rollout.features.watermarkV6MsgId: true/BILI_ROLLOUT_WATERMARK_V6_MSG_ID=1; default 0% off), dsh sessions using URL-prefix / attach mode (profile points at<origin>/bili/<upstream>) get EVERY model request refused with 400pf_v6_identity_fault:The v6 identity hard gate (
src/server/fastpath-v6.ts) is fail-loud by design on the premise "lane traffic always comes from a native shim that stamps the pf-* handshake in-process". That premise holds only OFF-tunnel:/bili/prefix/attach traffic is a plain HTTP client with no in-process fetch interception, so the handshake can never be present there — the lane's entry conditions were met while the gate's premise was false for this population. Result: every turn 400s (five refusals → 60-min park → repeat after hold expiry); fresh processes/stores reset the breaker, which is why the e2e attach run fails stably. The A/B evidence in #5760 (byte-identical 400 on a build containing none of #5732's changes) pins this as inherent to the v6 lane line — hence this lands as a supplement against the lane branch, same pattern as #5721/#5732.Fix
One structural cohort exclusion in the gate's absent-channel branch: when the request arrived over the
/bili/tunnel (route.tunnel, resolved once from the incoming URL in handle.ts and plumbed through prepareOpenai into the v6 input), an ABSENT identity channel passes silently to the v5/legacy lanes — the same treatment as the carrier-absent exclusion. Nothing else changes:/bili/): enters the gate unchanged, full validation;Plumbing:
route?.tunnel === true(handle.ts — single assignment from the incoming URL) → new optional trailing parameter ofprepareOpenai→input.tunnelOriginonevaluateWatermarkV6(defaultundefined⇒ legacy semantics for every existing caller/test).Behavior change (flagged per policy)
x-bili-plugin-conversationbut nox-bili-pf-tail-ids→ always 400pf_v6_identity_fault, regardless of how they arrived./bili/tunnel are excluded from the v6 cohort and served by the v5/legacy lanes (no 400, no breaker count, one debug-level log line).watermarkV6MsgIdrollout is > 0% (default 0% ⇒ zero impact on shipping installs); within that population, only tunnel-origin requests without the channel. This unblocks any >0% rollout wave for prefix/attach users, which When the v6 msgid fast path is forcibly enabled, every turn of dsh sessions using the /bili/ prefix (attach/prefix mode) | v6 msgid 快通道强制开启时,dsh 走 /bili/ 前缀(attach/prefix 模式)的会话每一轮都被 400 拒掉 #5760 calls out as mandatory before the first wave.Tests
New
tests/issue5760-v6-tunnel-origin-exclusion.test.ts(hermetic sqlite-sidecar harness mirroringfastpath-v6-msgid.test.ts), both directions per #3617 gate discipline:false) + absent channel → 400 fault, breaker fed once per refusal (regression pin);Existing
tests/fastpath-v6-msgid.test.ts+tests/fastpath-v6-tail-window.test.tspass unchanged (22/22 across the three files locally); typecheck + build green. Full-suite verdict: CI on this head.Base is the lane branch
2026-11-04_fastpath-v6-msgid(master has no fastpath-v6 lane yet); merge order: this PR → lane branch, then #5652 carries everything to master.