Skip to content

[PR] fix: resolve providers.* config for path-style lane requests (#4501) - #4510

Closed
ranxianglei wants to merge 3 commits into
masterfrom
2026-10-24_4501-pathstyle-output-ceiling
Closed

ranxianglei wants to merge 3 commits into
masterfrom
2026-10-24_4501-pathstyle-output-ceiling

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What & why

Path-style lane requests — POST /v1/messages straight at the proxy's default upstream, no /bili/ tunnel, no absolute form, non-MITM — get no route back from resolveUpstream(). Every providers.* lookup in handle() was keyed on route?.rewrittenUrl, so for those requests it was undefined and silently missed:

Fix

Reconstruct the full destination URL once in handle() (providerDestUrl = route?.rewrittenUrl ?? <absolute urlPath> ?? opts.upstream + urlPath) and use it as the single config-matching basis for all of the above. Matching is a longest-URL-prefix against the provider keys, so a host-level key (https://api.deepseek.com) matches any deeper path on that host — exactly what the tunnel form already did.

Also stopped firing the #3438 mid-band warn when a ceiling is known: in the healthy branch a known ceiling implies value >= ceiling (collapse requires value < ceiling), which is a healthy state, not a missing-ceiling gap — the old code lied there.

Behavior changes (old → new, path-style lanes only)

All are corrections of intended-but-broken behavior; tunnel/absolute/MITM forms already had routes and are unchanged:

Surface Before After Why
models.<m>.output ceiling ignored (undefined URL) applied config could never arm the #3438 rescue on path-style
models.<m>.context / operator window tuning ignored applied same undefined-URL miss
registry host lookup undefined reconstructed host price/profile resolution missed
route-scoped passthrough:true never matched matches a passthrough scoped to a path-style route was dead
per-provider compress settings global fallback route settings consistent with the tunnel form
#3438 mid-band warn fired even when a ceiling was known suppressed when a ceiling is known value >= ceiling is healthy, not a gap

No threshold/timing/output-format drift beyond the above; no wire-shape change other than the restored max_tokens value on path-style dsh-lane requests where a ceiling is now readable.

Config surface

Unchanged. No new / renamed / re-semantics'd fields — this makes the existing providers.<url>.models.<model>.output / .context keys actually reach path-style requests, as always intended. Nothing to migrate.

Tests

  • tests/side-request-isolation.test.ts: unit pin that a known ceiling with value >= ceiling no longer fires the mid-band warn (and still fires exactly once with no ceiling).
  • tests/issue4501-pathstyle-config.test.ts (new): end-to-end — a path-style dsh-lane request resolves the declared output ceiling and restores a collapsed mid-band budget up to it; the control case proves the same request without a declared ceiling forwards verbatim and poisons the high-water (the reported impact).

Local: typecheck clean; targeted suites green (side-request-isolation, issue4501, issue3833-cross-model-output-ceiling, headroom-output-fallback, configured-window-outranks-registry, compress-settings, agent-providers, named-provider-bind, runtime-info, launcher, routing, upstream-proxy-routing — 478 pass / 0 fail / 1 pre-existing skip). Full suite delegated to CI.

Closes #4501

@ranxianglei ranxianglei changed the title fix: resolve providers.* config for path-style lane requests (#4501) [PR] fix: resolve providers.* config for path-style lane requests (#4501) Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-24_4501-pathstyle-output-ceiling (6a5b94b)

Latest build — install this exact version

npm install -g billion-context@0.0.5480-pr.4510.7e0426a

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
6a5b94b billion-context@0.0.5480-pr.4510.7e0426a build
c0b2271 billion-context@0.0.5469-pr.4510.bec251f build
827c85a billion-context@0.0.5443-pr.4510.0c2f0a9 build
9c15f04 billion-context@0.0.5430-pr.4510.96859f5 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr4510.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](#4510,分支 2026-10-24_4501-pathstyle-output-ceiling)是 #4501(VK365 报告:路径式 lane 读不到 providers.<url>.models.<model>.output)的唯一修复条目;检索 open+closed 的 issue/PR(output ceiling、resolveKnownOutputCeiling、path-style lane、#3438 mid-band)无同机制的并行条目。#3438 是 mid-band 救援功能项本身,与本条是「功能 vs 其消费侧缺陷」的关系,不构成重复。

标签: bug / dsh / scope/wiring / p2 —— 路径式 lane 配置静默失效属功能性缺陷;有绕行(隧道形态正常),未达 p1「不能用/体验毁灭」级,故 p2。

开始独立 review:按 PR Review 规范逐项核对——原 issue 方向、diff 既有行为清单(plugin/proxy 双模式)、代码与测试有效性、CI 状态,完成后按结构化八问给结论。当前已知:单 commit 9c15f04,触碰 src/server/handle.ts(+~21)、src/server/side-request.ts(±2)、新增 tests/issue4501-pathstyle-config.test.ts、扩展 tests/side-request-isolation.test.ts;CI 已产出构建包(0.0.5430-pr.4510.96859f5)。

@ranxianglei ranxianglei added bug Something isn't working dsh p2 scope/wiring labels Oct 24, 2026
ranxianglei pushed a commit that referenced this pull request Oct 24, 2026
…use providerDestUrl for the #3211 pairing

Review follow-up on #4501/#4510 — two small cleanups on top of the new single
config-matching basis; no behavior change beyond the log text:

- the #661 route-passthrough log line still masked route?.rewrittenUrl, which is
  undefined for path-style matches. Now that #4501 makes those matches possible,
  the line would have logged an empty URL; it names providerDestUrl instead.
- the #3211 calibration pairing recomputed the full destination URL inline; it
  now reuses providerDestUrl (identical value) so the single matching basis stays single.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Review 结论(独立审核,非复读 issue/原 PR 描述):方向正确、机制打到了根因、回归面已逐项清点——可合(等 pushed head 827c85a8c 的 CI 绿)。review 中发现两处小问题,已按「小问题直接修」以独立标注 commit 修进 PR 分支:827c85a8c(+2/-2,见下)。

结构化八问

1. 是什么问题:路径式 lane 请求(直接 POST /v1/messages 打到默认 upstream,无 /bili/ 隧道、非绝对 URL、非 MITM)读不到任何 providers.* 配置——output ceiling、.context、route 级 passthrough:true、per-provider compress 设置全部静默落空,#3438 中档救援无法武装、其「NO known output ceiling」警告无法靠配置消除。

2. 什么原因导致的:handle() 里所有 providers.* 查询以 route?.rewrittenUrl 为匹配基准,而 resolveUpstream() 对路径式请求返回 undefined(只认隧道/绝对/MITM 三形态)→ 基准恒为 undefined → 最长前缀匹配必落空。修法在生产侧补上缺失的匹配基准(一次重建完整目标 URL),不是在各消费点打补丁或过滤症状——根因层面成立。已在报告者构建 v0.1.204 tag 与 master 两处独立核实同一代码形态(版本先行 triage 通过)。

3. 影响范围与严重程度:所有「声明了 providers.<url>.* + 客户端走路径式直连」的请求;dsh desktop 是报告实例(不止 dsh)。特定条件下功能降级:ceiling 不可读 → 饥饿/中档请求原样转发并污染高水位(后续救援只剩 32K 地板)、救援链路未武装;有绕行(隧道形态正常)。p2 定级准确。

4. 怎么修复的:providerDestUrl = route ? route.rewrittenUrl : <绝对 urlPath> ?? opts.upstream+urlPath 算一次,作为 6 个查询点的单一匹配基准(与 forwardUpstreamUrl(#1757)、declaredProtocol(#1909) 既有拼接约定同形);另给 #3438 warn 加 ceiling === undefined 门槛——已核对 restoreOutputBudget 分支结构:健康分支 + 已知 ceiling ⇒ value >= ceiling(collapse 定义要求 value < ceiling),旧代码确实在谎报。

5. 是否有回归问题:无。逐项清点触碰路径的既有行为:

6. 是否破坏缓存:不涉及。不碰前缀缓存接缝、ref/账本、增量游标、去重键;快照渲染车道无感。

7. 是否改了设计方向:不涉及。收敛到既有约定(destUrl 重建同款),无新数据流/边界变化。

8. 是否引入新配置:不涉及。让既有的 providers.<url>.models.<model>.output/.context 真正生效,无需迁移。

验证证据

  • 测试有效性:e2e(issue4501-pathstyle-config.test.ts)有牙——修复前同一请求转发 8192,断言 384000,master 上必红;对照例钉住「无 ceiling 原样转发 + 高水位污染」(报告的 impact-2)。单元钉双向(已知 ceiling 抑制 / 未知恰好一次 / 超顶原样),同样 pre-fix 红。hermetic loopback + port 0 + 真 startServer。小缺口记录在案(不拦):.context 窗口解析的路径式 e2e 未单钉——与 output 同机制、由 configured-window-outranks-registry 等单元套件覆盖。
  • 本地(PR head,定向):typecheck 干净;12 个触碰面套件 513 pass / 0 fail / 1 既有 skip(首跑 agent-providers 文件级失败系 pi-subagents 未构建的环境前置,构建后 10/10 绿,与本 PR 无关)。
  • 基线新鲜度:PR 落后当前 master 10 个提交;git merge-tree --write-tree 判定零冲突,master 侧对 src/server/handle.ts 的改动(Plugin lanes: pin identity to client msgids, render outbound from the server-owned history | 插件车道服务端正史:消息身份钉在客户端 id 上,出站前缀由正史渲染 #4491 rollout 接线,import + handle( 顶部 hunk)与 PR 触碰区不相交。可不 rebase 直接合并(merge 提交上跑 CI),也可先 rebase 再合,二选一即可。
  • CI:全量套件以远程 CI 为准;pushed head 827c85a8c 的构建/测试跑完后看结果(此前 9c15f04 已产出构建包 0.0.5430-pr.4510.96859f5)。

合并判定:§7.4 下属 human-only(出站 wire 值 + fallback 语义变更),请 owner 审后自行合并:#4510 。若认可,我这边无遗留动作;#4501 待此 PR 合并后由你验收关闭。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

收工确认(前两条评论已含查重结论与结构化八问完整审核,此处仅收口):

我这边无遗留动作。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复——按失败签名(docs-sync 红 + 再生成丢 rollout.features.pluginLaneServerHistory 行)检索 open/closed issue 与 PR 无同条目;根因是 #4491 的文档登记缺失,随本 PR 修复,不单独立项。

docs-sync 已修,commit c0b2271c8 已推到 PR 分支(fast-forward)。八问:

  1. 是什么问题:CI docs-sync 红——它从 website/config-reference/*.yaml 种子重新生成 CONFIGURATION.md/.zh-CN.md 等产物再 diff,再生成结果比提交版本少一行(EN/ZH 各一行的 rollout.features.pluginLaneServerHistory)。
  2. 什么原因导致的:master 上 Plugin lanes: pin identity to client msgids, render outbound from the server-owned history | 插件车道服务端正史:消息身份钉在客户端 id 上,出站前缀由正史渲染 #4491 的提交(ad98e7e2c)把这一行手改进了生成区块,没在 YAML 种子里登记;而当时种子 schema 表达不了这行(desc_en/desc_zh 有反引号禁令、default 单元格 EN/ZH 共用,中文行却用了 0(关))。于是任何一次再生成都把该行丢掉 → 每个合入 master 的 PR merge-ref 都红(纯 master 树本地复现同样红),不是本 PR 的代码改动引入的。
  3. 影响范围与严重程度:当前所有待合并 PR 的 docs-sync 全红,且 test/static-gates 依赖它一并受阻;纯文档/工具链问题,零运行时行为影响,不影响终端用户。严重度:CI 可用性缺陷。
  4. 怎么修复的:让该行回到「种子是唯一事实源」的正确位置——① 生成器最小扩展:移除 desc_en/desc_zh 的反引号禁令(这两个字段只渲染进 markdown 表格,反引号是合法 inline code,[docs][website] 配置文档单一事实源:从声明式 schema 生成 CONFIGURATION.md 与网站 /docs/(一步到位) #2107 引入时的禁令已过时)、新增可选 default_zh 支持按语言本地化默认值单元格;② website/config-reference/rollout.yaml 补登该条目,文本与 Plugin lanes: pin identity to client msgids, render outbound from the server-owned history | 插件车道服务端正史:消息身份钉在客户端 id 上,出站前缀由正史渲染 #4491 已提交行逐字节一致(EN+ZH);③ 重新生成文档(param-ref 行 + env-map 行,每语言文件各 +2 行)。
  5. 是否有回归问题:审过生成器既有行为——只重写标记区块;本地 diff 确认除新增 2 行/文件外其余字节不变,website/main.js 与 docs/index.html 零变化(该条目无 id),i18n 键数不变(238),check-coverage 退出 0(新 env 名落入既有的动态名 notice 类,非失败项);并做了试合并验证(master ← PR 分支):三方合并零冲突,合并树上再生成后 git diff --exit-code 为空 = docs-sync 绿。高危模式逐项:无语义漂移、无吞错、无阈值/时序/输出格式变化。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及——恢复而非改变「种子→生成」约定;合并后 master 上的潜在断裂同时修复,后续 PR 的 docs-sync 恢复绿。
  8. 是否引入新配置:无用户可见配置/env/默认值变化(BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY 是 Plugin lanes: pin identity to client msgids, render outbound from the server-owned history | 插件车道服务端正史:消息身份钉在客户端 id 上,出站前缀由正史渲染 #4491 已上线的运行开关,本次只是补齐其文档登记)。

判定:修复完成且本地已复现绿,等新 head 的 CI 全绿即可;无需 owner 决策项。

ci-check added 3 commits October 24, 2026 19:34
Path-style lane requests (POST /v1/messages straight at the proxy's default
upstream — no /bili/ tunnel, no absolute form, non-MITM) get no route back
from resolveUpstream(), so every providers.* lookup keyed on
route?.rewrittenUrl silently missed: models.<model>.output/.context never
applied, the #3438 mid-band collapse rescue stayed unarmed, and its "NO known
output ceiling" warn could not be silenced by declaring the model's max output.

Reconstruct the full destination URL (opts.upstream + path) once in handle()
as providerDestUrl and use it as the single config-matching basis for the
output ceiling, context limit, operator window tuning, registry host,
passthrough routing, and per-provider compress settings. Also stop firing the
#3438 mid-band warn when a ceiling IS known (value >= ceiling is a healthy
state, not a missing-ceiling gap).

Tests: unit coverage of the warn gate in side-request-isolation.test.ts plus
end-to-end proof in the new issue4501-pathstyle-config.test.ts that a
path-style dsh-lane request now resolves the declared output ceiling and
restores a collapsed mid-band budget up to it.
…use providerDestUrl for the #3211 pairing

Review follow-up on #4501/#4510 — two small cleanups on top of the new single
config-matching basis; no behavior change beyond the log text:

- the #661 route-passthrough log line still masked route?.rewrittenUrl, which is
  undefined for path-style matches. Now that #4501 makes those matches possible,
  the line would have logged an empty URL; it names providerDestUrl instead.
- the #3211 calibration pairing recomputed the full destination URL inline; it
  now reuses providerDestUrl (identical value) so the single matching basis stays single.
…rates it

- tools/gen-config-docs.mjs: drop the stale backtick ban on desc_en/desc_zh (these fields render only into markdown tables, where backticks are valid inline code); add optional default_zh for zh-localized default cells.

- website/config-reference/rollout.yaml: add the rollout.features.pluginLaneServerHistory entry reproducing #4491's committed row byte-exactly (EN+ZH).

- Regenerate CONFIGURATION.md / CONFIGURATION.zh-CN.md (param-ref row + env-map row).
@ranxianglei
ranxianglei force-pushed the 2026-10-24_4501-pathstyle-output-ceiling branch from c0b2271 to 6a5b94b Compare October 24, 2026 11:55
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解决:rebase 到当前 master(含 #4524)后强推,新 head 6a5b94bad,GitHub 已判定 mergeable(当前 blocked = 等新 head 的 CI 跑完)。三个 commit 原样保留:主修复 → review 小修 → docs-sync 种子。

结构化八问

1. 是什么问题:PR 分支与 master 文本冲突——双方各自独立修了同一个 docs-sync 红:本 PR 第三个 commit 把 rollout.features.pluginLaneServerHistory 登记进文档种子(与 #4491 已提交行逐字节一致,带反引号 + 中文默认值 0(关));master 刚合入的 #4524 也种了同一行,但是降级形态(无反引号、无本地化默认值)。两版行在 CONFIGURATION.md / CONFIGURATION.zh-CN.md / rollout.yaml 三处同一位置相撞。

2. 什么原因导致的:#4491 把该行手改进了生成区块而没在 YAML 种子登记 → 每个 merge-ref 再生成都丢行、docs-sync 全红;#4524 与本 PR 是对同一根因的两个并行修复,落地时间错开就在同一行上产生冲突。纯文本层冲突——本 PR 的代码 commit(主修复 + 小修)apply 到 master 零冲突。

3. 影响范围与严重程度:仅影响本 PR 可合并性;纯文档/工具链面,零运行时行为影响,不涉及任何用户。

4. 怎么修复的:union-of-intent 取舍——保留本 PR 的种子版本:它与 #4491 已提交行逐字节一致,比 #4524 的降级版更忠实,且与已进 master 的生成器扩展(解除反引号禁令 + default_zh 支持)自洽;#4524 之后 master 侧的其他文档新增全部保留(hunk 级解决,未整文件覆盖)。解完后本地跑 node tools/gen-config-docs.mjs generate:产物与提交版本逐字节相同(即 docs-sync 必绿)、check-coverage 通过。副作用一处:种子 commit 相对新 base 从「新增 7 行」变为「修正 3 行」(#4524 已先种了降级行),diff 更小。

5. 是否有回归问题:无。rebase 不改变 PR 原本披露的行为表(output ceiling/.context/passthrough/compress 设置/mid-band warn 六项)在新 base 下依然成立,定向测试验证;高危模式逐项过完:无语义漂移、无吞错、无阈值/时序/输出格式变化;此前披露的两处顺手小修(route-passthrough 日志空 URL、#3211 pairing 复用单一基准)作为独立 commit 原样保留。

6. 是否破坏缓存:不涉及。

7. 是否改了设计方向:不涉及——仍是「种子是唯一事实源」,只是两个并行修复收敛为忠实版本。

8. 是否引入新配置:无(BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY 是 #4491 已上线的运行开关,本次只补齐其文档登记)。

验证证据(新 head 6a5b94bad)

  • typecheck 干净、build 通过(dist-import-annotations / dist-external OK);
  • 定向套件 tests/issue4501-pathstyle-config.test.ts + tests/side-request-isolation.test.ts 36/36 绿;全量以远程 CI 为准;
  • 最终 diff vs master:8 文件 +207/-18,与 rebase 前内容等价(仅 base 推进)。

收工判定:冲突车道完成,无遗留动作。合并判定不变:§7.4 human-only(出站 wire 值 + fallback 语义变更),请 owner 审新 head 后自行合并 #4510 ;#4501 待合并后由你验收关闭。

ranxianglei added a commit that referenced this pull request Oct 24, 2026
[PR] merge: tier-3 rework train — #4443/#4445/#4430 reworked on master + #4510 content (CI red was a stale-dist mtime guard)
@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

CI 红查明为 #3325 stale-dist 守卫 mtime 误判(非内容问题);内容已在 #4558 落地。本 PR 关单收尾;回滚点为 #4558 单提交 revert。

yanhuojiyusheng pushed a commit to yanhuojiyusheng/billion-context that referenced this pull request Oct 24, 2026
…use providerDestUrl for the ranxianglei#3211 pairing

Review follow-up on ranxianglei#4501/ranxianglei#4510 — two small cleanups on top of the new single
config-matching basis; no behavior change beyond the log text:

- the ranxianglei#661 route-passthrough log line still masked route?.rewrittenUrl, which is
  undefined for path-style matches. Now that ranxianglei#4501 makes those matches possible,
  the line would have logged an empty URL; it names providerDestUrl instead.
- the ranxianglei#3211 calibration pairing recomputed the full destination URL inline; it
  now reuses providerDestUrl (identical value) so the single matching basis stays single.

(cherry picked from commit 1f5d023)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dsh p2 scope/wiring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant