Skip to content

[PR] fix: warn when compress-block keys sit inert on a provider route root | 路由根上的 compress 块键静默无效时补告警 - #3680

Closed
ranxianglei wants to merge 5 commits into
masterfrom
2026-10-18_route-root-compress-warn
Closed

ranxianglei wants to merge 5 commits into
masterfrom
2026-10-18_route-root-compress-warn

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #3675

What

modelContextLimit / outputHeadroomMaxPct — and in general every compress-block key — written on a provider ROUTE ROOT (providers."https://…": { modelContextLimit: … }, or a named entry) was silently dropped by parseRouteEntry: no effect, no warning. This adds the missing load-time warning so misplaced keys surface instead of sitting dead.

Behavior change (old → new)

  • Old: zero warnings when compress-block keys sat at a route root (URL lane or named entry); the keys were inert.
  • New: one [acp-config] providers."<key>" carries compress-block keys [ … ] at the route root — they are inert there (move them under providers."<key>".compress to apply) warning per key-set signature, deduped across reloads via the existing warnNamedProviderOnce.
  • No parsing semantics changed: nothing new is accepted, no existing config behaves differently — purely additive log output.

Scope notes

Tests

New regression tests in tests/named-provider-bind.test.ts: URL route root warns once naming both keys + the .compress hint while the route still parses; bound alias stays inert through the fold and warns; lonely named entry (previously zero warnings) now warns; dialing recipe produces no duplicate loadRoutes warning; reload dedup holds. Targeted suites green locally: named-provider-bind 16/16, issue1815/provider-protocol/compat-drop/compat-roles/issue2260 58/58; typecheck clean. Full-suite verdict from CI.

CI-fix follow-up commit (7e36cb9)

First push red: the new warning references COMPRESS_SETTING_FIELDS before its declaration, and scripts/config-surface-guard.mjs located the field list at the FIRST mention of the name — landing inside this PR's warning template literal and extracting a phantom empty leaf (compress., ), failing the config-surface-guard job and its mirrored test in three shards. That commit re-anchors the guard's extractStringSet on the Set initializer and adds a regression test. Pure CI tooling — no product-code change.

@ranxianglei ranxianglei changed the title fix: warn when compress-block keys sit inert on a provider route root | 路由根上的 compress 块键静默无效时补告警 [PR] fix: warn when compress-block keys sit inert on a provider route root | 路由根上的 compress 块键静默无效时补告警 Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-18_route-root-compress-warn (09f45fc)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4597-pr.3680.c463a7f

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-pr3680.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)

查重: 不重复。 这是 #3675 的修复 PR(Closes #3675,来源链一层内)。按失败签名(「inert」「route root」「compress-block keys」「warnInertRoutingFields」「modelContextLimit」× outputHeadroomMaxPct)检索 open+closed issue 与 PR:除来源链 #3675/#3438 外零命中,无并列修复 PR 在途。

标签: bug + scope/wiring + p2(缺陷类——配置键静默无效属可观测性缺陷;provider 路由解析属协议接线/外部 API 边界;能用但有明显坑、需绕行挪进 .compress,p2)。客户端标签不打:providers 表是客户端无关配置面,正文/路径均不指向特定客户端。

开始独立审核(拉分支、读 diff、定向测试、CI 状态),结论按八问随后给出。

@ranxianglei ranxianglei added bug Something isn't working p2 scope/wiring labels Oct 18, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

红了

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

红了已定位,正在修。一句话:这个 PR 新增的告警函数在源码里比 COMPRESS_SETTING_FIELDS 的声明出现得更早,把 CI 配置面守卫(config-surface-guard)的提取逻辑带偏了——它按「第一次出现的位置」去找字段清单,结果抓到新告警文案里的 [${…}],解析出一个空字段名,于是守卫任务红 + 它的测试套件在 3 个分片上跟着红。本地已复现(compress., 空字段)。

处置:修守卫脚本的提取锚点(锚定到 const … = new Set([ 初始化处,不再吃「首次提及」)+ 补一个回归测试钉住这个失败形态,推到这个 PR 分支。全量 CI 重跑后我再给完整八问结论。另有一个分片(windows 22 shard 2)挂的是 lane-decisions-matrix 的超时类 flake(promise 未决、与配置无关),等重跑确认。

…3680)

The route-root warning added in this PR references COMPRESS_SETTING_FIELDS before its declaration. scripts/config-surface-guard.mjs located the field list at the FIRST mention of the name and stopped at the first closing bracket, so it scanned the new warning's template literal and extracted one empty string -> phantom leaf 'compress., ' -> config-surface-guard job red + tests/config-surface-guard.test.ts red in every shard carrying it.

extractStringSet now anchors on 'const <name> = new Set([' and matches the closing bracket string-aware. Regression test pins the use-before-declaration + bracketed-template shape.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

审核完成。先交代处置过程:你 ping「红了」后定位到的是本 PR 引入的一个 CI 工具链缺陷(非产品代码),已修复并推到分支(7e36cb9)——config-surface-guard job 及其在三个测试分片里的镜像测试现已全绿。当前分支剩余的红色全部来自 master 自身的既有红风暴(#3870 / #3871 / #3711),与本 PR 无关。

八问

  1. 是什么问题:modelContextLimit / outputHeadroomMaxPct on the provider route root are silently ineffective (inert keys, zero warnings) | provider 路由根上的 modelContextLimit / outputHeadroomMaxPct 静默无效(惰性键、零告警) #3675——把 modelContextLimit / outputHeadroomMaxPct(以及任意 compress 块键)写在 provider 路由根上时,parseRouteEntry 白名单不含它们,键被静默丢弃且零告警。本 PR 补上加载期告警。
  2. 什么原因导致的:解析层与可观测层脱节。parseRouteEntry 白名单只接受路由语义字段,compress 字段在路由根本来就不被解析(设计如此);但既有的两个「放错位置」告警都够不到这个场景——One-shot: named providers as real lanes — bind + compactionOptIn + agent-side switch, landing in a single PR (replaces #1466 staging) #1469 的 inert-routing-fields 告警不覆盖 URL 路由根且字段集不含 compress 键,[config] misplaced/unknown top-level keys are silently ignored — root-level promptPack does nothing without any warning #1815 的顶层未知键告警只管顶层。路由根因此是唯一零信号死角。
  3. 影响范围与严重程度:体验级。把 compress 键误放路由根的用户此前得不到任何提示,配置静默无效([bug] DSH lane: client-side max_tokens collapse lands in the 200–25K band and slips past the ≤200 restore trigger — 3 finish=length empty turns, reasoning ate the whole budget (0.1.197) | DSH 车道:max_tokens 落在 200–25K 中间带、漏过 ≤200 救援阈值,3 轮 finish=length 空轮… #3438 里 outputHeadroomMaxPct 不生效即此类)。不丢数据、不改任何解析行为。严重度 p2(标签已打)。
  4. 怎么修复的:方案 A(告警而非接受)。新增 warnCompressOnlyFieldsAtRouteRoot,识别集 = COMPRESS_SETTING_FIELDS 全集(与 parseCompressSettings 同步维护);在 loadRoutes ingest 里、bind 分支之前触发(绑定别名上这些键同样无效,fold 带不过去);复用 warnNamedProviderOnce 跨重载去重;dialing recipe 跳过(其解析器已对未知根字段大声报错,避免双信号)。函数注释固化不变量:此告警存在期间不得把这些键加进 parseRouteEntry 白名单。方案 B(路由根接受并 fold 进 lane compress 默认值)属配置面扩张,保持 owner-gated,未实施。
  5. 是否有回归问题:无。逐项审过 diff 触碰路径的既有行为:URL 路由解析(不变)、named+bind fold(不变,fillRouteGaps 兜底)、One-shot: named providers as real lanes — bind + compactionOptIn + agent-side switch, landing in a single PR (replaces #1466 staging) #1469 inert 告警(不变)、[config] misplaced/unknown top-level keys are silently ignored — root-level promptPack does nothing without any warning #1815 顶层提示(不变)、recipe 大声拒绝(不变)、web config API 往返(不受影响,纯日志增量)、rejectLegacyRoute 顺序(保持在前)。master 漂移(JSONC JSONC doc examples vs bare JSON.parse loader — copying the docs silently drops the config | 文档示例是 JSONC(含 // 注释),loader 却用裸 JSON.parse——照文档抄配置会静默失效 #3572 / mitm domains native lanes suspected of not reusing instances: one proxy per process, instances only grow (v0.1.197 / opencode v2) | [Bug?] native 车道疑似不复用实例:一进程一代理,实例只增不减(v0.1.197 / opencode v2) #3436 / update stagger Automatic staggered rollout: default random upgrade interval of 15 min – 48 h + GitHub remote policy file (emergency kil | 自动升级撒点:默认 15 分钟~48 小时随机升级 + GitHub 远程策略文件(紧急刹车/按版本调速),给事故留响应窗 #3619)与触碰函数零交集。CI 侧另修了一个本 PR 引入的守卫工具缺陷(见下节)。
  6. 是否破坏缓存:不涉及(未触碰任何缓存/重试/增量游标路径)。
  7. 是否改了设计方向:没有。仍守「路由根只认路由字段,compress 归 compress 块」的既有边界;Option B 未动。
  8. 是否引入了新的配置:没有新配置面。行为变更披露(旧→新):旧 = compress 块键写在路由根(URL lane 或 named entry)零告警、静默无效;新 = 每个「键+字段集」签名一条 [acp-config] providers."<key>" carries compress-block keys [ … ] at the route root — they are inert there (move them under providers."<key>".compress to apply),经既有去重机制跨重载稳定。解析语义零变化:不新接受任何键,既有配置行为不变,纯日志增量。

CI 红处置(你 ping 的那次)

  • 根因:新告警函数在源码里比 COMPRESS_SETTING_FIELDS 的声明出现得更早,而 scripts/config-surface-guard.mjs 的 extractStringSet 按「名字第一次出现」定位字段列表,落进了告警文案的模板字面量 [${misplaced.join(", ")}],提取出空串幻影叶子 compress., → 守卫 job + 三个分片的镜像测试红。
  • 处置:extractStringSet 改锚到 Set 初始化器(const X = new Set([)并做字符串感知的右括号匹配;补回归测试钉住该形状(fixture 复刻「声明前引用 + 带方括号的模板字面量」,旧实现在其上返回 [""],可证伪)。commit 7e36cb9,纯 CI 工具链,无产品代码变更。本地实测:守卫 147 个叶子字段全过(坏版本只有 118);定向 7 套 80/80 绿;typecheck 干净。
  • 推送方式说明:沙箱 git 传输持续 connection reset,改走 GitHub Git Data API 提交(blob→tree→ref,fast-forward、force=false),远端 tree 与本地 commit 逐字节一致(同 tree sha 1ae587d)。

剩余红(均非本 PR 引入,已有跟踪,不再重复立项)

审核中另发现(已单独立项 #3876)

externalSummary 被 parseCompressSettings 接受(src/config.ts:2570)但不在 COMPRESS_SETTING_FIELDS 里 → 它写在路由根时新告警覆盖不到(#1815 顶层提示也缺归属建议)。修法需同步补文档种子(配置面变更,owner-gated),故未塞进本 PR,已立 #3876(带来源标记、含查重声明)。

判定:代码与测试本身可合——方向、回归清单、测试有效性、diff 整洁度(两文件 +99/-0,外加本次 CI 修复 commit,每行都在目的内)均已独立复核。合并时机等 #3871 解除 master 静态门禁、CI 转绿之后;合并由你操作。

@ranxianglei

Copy link
Copy Markdown
Owner Author

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

给本分支加了一个 commit:fix: recognize externalSummary in route-root compress warning (#3876)(66219d4)。

背景:分析 #3876 时发现,本分支路由根警告所用的识别集合 COMPRESS_SETTING_FIELDS 漏了 externalSummary——不补的话,本分支合入后 providers."<key>": { externalSummary: … } 写在路由根仍然零信号静默无效。主修复(集合补字段 + website yaml 种子 + 顶层提示回归测试)在 PR #3880;本分支这里只加了同一行集合修改 + 两条定向回归测试(正例:路由根写 externalSummary → 告警且该字段不进 compress 块;反例:正确放在 compress 下 → 无路由根抱怨)。本分支上定向套件 18/18 绿。

两边携带的是同一行集合修改,任意合并顺序都能干净合并。

Commit 66219d4 added externalSummary to COMPRESS_SETTING_FIELDS on this
branch; the config-surface guard then fails HERE (leaf compress.externalSummary
lacks a seed entry) until #3880's seed lands on master - i.e. merge order
mattered: merging this PR first would have put a NEW red on master's own
config-surface-guard. This mirrors #3880's exact seed entry (byte-identical,
so either PR may merge first and the duplicate is a clean no-op) plus the
generator output for it (5 added lines, 0 removed), making this branch
self-contained green for both config-surface-guard and docs-sync once the
pre-existing master static-gate red (#3870/#3871) clears.
Commit 66219d4 added externalSummary to COMPRESS_SETTING_FIELDS on this
branch; the config-surface guard then fails HERE (leaf compress.externalSummary
lacks a seed entry) until #3880's seed lands on master - i.e. merge order
mattered: merging this PR first would have put a NEW red on master's own
config-surface-guard. This mirrors #3880's exact seed entry (byte-identical,
so either PR may merge first and the duplicate is a clean no-op) plus the
generator output for it (5 added lines, 0 removed), making this branch
self-contained green for both config-surface-guard and docs-sync once the
pre-existing master static-gate red (#3870/#3871) clears.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

收到(同一通知重复转发了三次,只回一次)。66219d4e 已独立复核,并发现一个合并顺序隐患——已在本分支修掉。

对 66219d4 的复核

处置:已推 09f45fc3(docs: seed compress.externalSummary + regenerate config docs)

把 #3880 的种子条目逐字节镜像进本分支(website/config-reference/compress.yaml +10),并带上生成器输出(CONFIGURATION.md / CONFIGURATION.zh-CN.md 各 +1、website/docs/index.html +1、website/main.js +2,共 +15/-0,纯新增无删除)。效果:两个 PR 携带完全相同的种子行,任意合并顺序都干净且 CI 安全(先合的那个自带完整文档面,后合的是无操作重复)。本 head 的 CI 已确认 config-surface-guard 转绿。

透明说明:推送过程中产生了一个空 commit 4c01c394(推送工具解析文件清单出错,重推修正;零 diff,不影响任何内容)。

给 #3880 侧的协调提示

#3880 同样只带了种子没带生成器输出——等 #3871 解除 master 静态门禁后,它的 docs-sync 会因缺那 5 行再生成而保持红。请该侧在 #3880 分支补同一个再生成 commit(或我这边代为补推,说一声即可);我没有动它的活跃分支。

本轮八问(增量)

  1. 是什么问题:COMPRESS_SETTING_FIELDS is missing externalSummary — this field, when placed at the route root, is silently ignored with | COMPRESS_SETTING_FIELDS 漏了 externalSummary — 该字段写在路由根仍静默无效且无告警 #3876 的集合补字段进了本分支但种子留在 [PR] fix: recognize externalSummary in COMPRESS_SETTING_FIELDS so misplaced placement warns | 配置识别集合补上 externalSummary——放错位置终于有提示 #3880,造成守卫门禁的顺序依赖红。
  2. 什么原因导致的:配置面变更被拆到两个 PR 时,「集合成员」与「文档种子」必须同树出现才能过 config-surface-guard,拆分时漏了这一点。
  3. 影响范围与严重程度:仅 CI/开发流程——本 PR 若先合会给 master 新增一条守卫红;用户侧零影响。
  4. 怎么修复的:逐字节镜像 [PR] fix: recognize externalSummary in COMPRESS_SETTING_FIELDS so misplaced placement warns | 配置识别集合补上 externalSummary——放错位置终于有提示 #3880 的种子 + 生成器输出进本分支,使两 PR 各自自洽、顺序无关。
  5. 是否有回归问题:无。种子与再生成均为纯新增行(+15/-0),未触碰任何既有键的行;config-surface-guard 由红转绿是唯一状态变化。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:没有。
  8. 是否引入了新的配置:没有新字段——externalSummary 本就是 parseCompressSettings 接受的既有字段,本次只是补齐它的文档种子(配置面文档化,非新增面)。

剩余红不变:docs-sync / unused-exports = master 既有红风暴(#3870,修复 #3871 在途),ci-gate-plugins = 基础设施既有问题(#3711)。判定维持:可合,等 #3871 解除静态门禁后 CI 全绿再合;合并由你操作。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

已并入合并列车 #4572(master 合并,merge commit 保留原作者署名)。本 PR 关单收尾;回滚点为 #4572 单提交 revert。

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

Labels

bug Something isn't working p2 scope/wiring

Projects

None yet

1 participant