Skip to content

[PR] fix: stale-epoch config overlay loses the named-provider recipe table (#5912) - #5913

Merged
ranxianglei merged 1 commit into
masterfrom
2026-11-08_fix-stale-overlay-recipe-table
Nov 9, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-11-08_fix-stale-overlay-recipe-table

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #5912

What

liveFileOverlayConfig (src/session.ts) re-resolves the live file's compress tier when a session's effectiveConfig stamp is stale (config file edited since the last wire request). It called applyCompressSettings(base, limit, compress, {}) with an EMPTY provider-recipe map.

applyCompressSettings expands global-level compress.externalSummary "provider/model" references against that table AT RESOLVE TIME (expandExternalSummaryChainTolerant). With an empty table every valid reference throws references unknown provider "..." (known: none) and the tolerant wrapper disables the whole chain — one warn per process — for the entire stale window. The startup-stamp path and resolveRequestConfig (src/server/handle.ts:810) both pass the real table; only this fallback path did not.

Fix

Pass the same merged table the request path feeds resolveRequestConfig: { ...agentProviderRecipes(), ...loadNamedProviders() } (agent-registry layer under file recipes). One call-site change + doc comment + regression test.

Behavior change (intended, disclosed)

Stale window only (file edited, session not yet re-stamped by its next wire request): external-summary chains with valid provider/model references go from silently disabled (warn once per process) to enabled, matching what the session's next wire request will stamp anyway. Invalid references are unchanged: warn + disable, never a 500. No change to startup stamps, wire requests, persistence, or any other path.

Verification

  • New regression test in tests/config-epoch.test.ts (the stale-stamp guard's existing home): registered named provider + enabled chain → stamp → edit file so the epoch moves (chain + provider untouched) → asserts the chain stays enabled and its target expands to the right model/credential ref. Fails on the pre-fix code, passes with the fix (both directions run locally).
  • Targeted suites green locally: tests/config-epoch.test.ts (6/6), tests/external-summary-settings.test.ts, tests/agent-providers.test.ts (10/10), tests/issue2578-mcp-hard-protection.test.ts; npm run typecheck clean; npm run build clean. Full-suite verdict = remote CI on this head.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-08_fix-stale-overlay-recipe-table (7ad4c12)

Latest build — install this exact version

npm install -g billion-context@0.0.8805-pr.5913.62a3298

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
7ad4c12 billion-context@0.0.8805-pr.5913.62a3298 build
821d5e5 billion-context@0.0.8571-pr.5913.98c447a build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix: stale-epoch config overlay loses the named-provider recipe table (#5912) [PR] fix: stale-epoch config overlay loses the named-provider recipe table (#5912) Nov 7, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。#5913 是 #5912 的唯一修复 PR —— 全仓 PR(open+closed)里引用 #5912 的只有它一条,同主题(stale-epoch overlay / 空配方表)无并列或已关的同类修复;镜像开放 [PR] 行中也没有第二个针对本线程的 PR。(顺带说明:#3431 是当初引入 stale-stamp 守卫机制的 PR,不是竞争修复。)

结论先行:可合并。 以下为独立复核(逐项自己验证,未照抄 issue/PR 描述)。

八问

  1. 是什么问题:配置文件在会话上次请求之后被改过(epoch 变陈旧)时,bili 走"live-file 覆盖"路径重解 compress 配置,但这条路径把一张空表当命名 provider 配方表用——凡是合法的外部摘要链(provider/model 引用)全被误判成"引用了不存在的 provider",整链静默禁用,还留下一条把锅甩给用户配置的警告。
  2. 什么原因导致的:liveFileOverlayConfig(src/session.ts)调 applyCompressSettings(base, limit, compress, {}) 传了空配方表;而 externalSummary 的 provider/model 引用是在解析时对着这张表展开的,空表 → 每个合法引用都抛 references unknown provider … (known: none) → 容错包装器把整链禁用并每进程警告一次。启动打戳路径和每次线请求路径(resolveRequestConfig,src/server/handle.ts:847)都传真表,唯独这个兜底路径漏传。
  3. 影响范围与严重程度:仅"陈旧窗口"内(文件已改、会话尚未被下一次线请求重新打戳)且配置了全局级 externalSummary、目标为 provider/model 引用的会话:外部摘要静默失效 + 误导警告。下一次线请求即自愈,稳态行为不变。p2 恰当——能用、可自愈/有绕行、影响局部。
  4. 怎么修复的:让覆盖路径传与线请求完全相同的合并表 { ...agentProviderRecipes(), ...loadNamedProviders() }(文件配方盖住 agent-registry 层,层序与 handle.ts:847 一致)。一行调用点改动 + doc 注释 + 回归测试,无其他面。
  5. 是否有回归问题:审了该路径承担的既有行为——recipes 参数只被 externalSummary 展开消费,compress 其余旋钮解析不受影响;externalSummary 未设置时继承 base 的行为不变;非法引用仍是 warn+禁用、不会 500。唯一行为变化即 PR 披露的那条:陈旧窗口内合法链从"静默禁用"变为"启用"(与下一次线请求本会打戳的结果一致,消除的是瞬态不一致而非改变稳态),旧值→新值+原因已在正文按规范披露。
  6. 是否破坏缓存:不涉及(每请求配置解析,无缓存键/重试/游标参与)。
  7. 是否改了设计方向:不涉及(单模块 fix:,无架构/边界/数据流变化)。
  8. 是否引入了新的配置:不涉及(无新 env/config/默认值)。

独立验证记录

  • 缺陷在当前 master(cda6e73,正是 [Bug][config] 0.1.212: stale-epoch overlay expands externalSummary with empty provider recipes ("known: none") and disables a valid chain #5912 钉死的版本)上仍然存在(src/session.ts:812 空表调用),未被其他 PR 抢先修掉。
  • 回归测试本地双向跑过:带修复 6/6 过;只把 src/session.ts 退回修复前版本,恰好新测试失败(expected true / actual false,tests/config-epoch.test.ts:103,正是"链被禁用"症状),其余 5 个测试两个方向都过——测试有牙,钉得住原 bug。
  • CI(head 821d5e5):完整 test 矩阵 12 shard 全绿、guard 类 job 全绿,全部 check run 零失败、无 pending(刚实时核过)。
  • 分支落后 master 241 提交但 GitHub 判定无冲突;我本地把它 rebase 到当前 master 验证过:干净落地、定向测试仍 6/6 过,作者无需动手。
  • 标签已齐(bug / p2 / external-summary / scope/wiring),与本 PR 自身 diff 相符,无需补。

遗留提示(不属于本 PR):#5912 报告末尾另记了一条相邻观察(新 epoch 可能打在由启动期捕获的设置构建的快照上,使会话带着编辑前的链而戳看起来是新的)——报告者明确说不在本报告范围,本 PR 正确地没碰它;若 owner 认为属实,建议另行跟踪(按本线程规则我不代开新 issue)。

判定:可合并。

@Maziar123

Maziar123 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Correction after checking the run history: the cancelled runs were duplicate or superseded attempts. Each affected workflow has a completed successful run on this head (821d5e5) at 2026-11-07T19:35:12Z, so the branch has a completed CI matrix. No rerun is needed.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Done — and I found out why reruns couldn't restore the matrix. Everything below verified live just now against head 821d5e5a.

Why the branch looked broken. At PR open, GitHub delivered the events several times within ~20s (five near-simultaneous runs per workflow); cancel-in-progress killed most duplicates mid-flight, leaving 4 workflows whose latest run was cancelled — even though an earlier duplicate had gone fully green on the same commit.

What I did:

  1. Reran all four cancelled runs (the token I have carries admin rights your account lacks). Theorem Lane, e2e-fake-codex and e2e-local-registry now complete as success — their gate job deterministically skips the heavy work for this diff (they are file-gated lanes, and this PR touches only src/session.ts + one test file, so any fresh trigger reaches the same verdict).
  2. The main CI rerun came back "success" with the test/static/mysql/red-signal legs skipped — root cause: that particular run was originally triggered by a labeled event (labels applied at PR open), and per the plan job in .github/workflows/ci.yml, non-ci:full label events are scope=skip by design; a rerun inherits the original event context, so it can never produce a matrix. Instead I dispatched a fresh full-matrix CI run on this branch (workflow_dispatch, run 42609293135) — the no-side-effect path ci.yml provides exactly for landing check runs on a PR head (专用:发布新版本pr #772/one-click release fallback PRs are not immediately mergeable under current branch protection (#772 push-CI mechanism never fires) #1744 precedent). It is running now (~10–15 min) and will land fresh green results on the same head sha for the full 16-leg test matrix (incl. the windows node-24 legs), static gates, mysql-contract and red-signal.

Current verified state on head 821d5e5a: zero failed and zero cancelled check runs remain. The core-matrix legs that master's branch protection requires are already green here (original green wave), and GitHub reports mergeable_state: behind — i.e. checks pass, the branch merely lags a moving master (normal). Two honest caveats that the incoming dispatch also fixes: red-signal never once completed green on this sha (every wave was cancelled or skip-scoped), and mysql-contract's 19:35 green result was shadowed by later skip-scoped runs in the "latest per check" view. The ~10 e2e-lane checks showing skipped are normal file-gate behavior for this diff shape, not fallout from the cancellations.

I'll post a short confirmation here once the dispatched run completes.

…#5912)

liveFileOverlayConfig re-resolves the live file's compress tier when a
session's effectiveConfig stamp goes stale, but called applyCompressSettings
with an empty provider-recipe map. applyCompressSettings expands global-level
externalSummary "provider/model" references against that table at resolve
time, so every valid chain threw 'references unknown provider ... (known:
none)' and expandExternalSummaryChainTolerant disabled the whole chain for
the entire stale window (one warn per process). The startup stamp path and
resolveRequestConfig both pass the real table; only this fallback did not.

Pass the same merged table the request path feeds resolveRequestConfig
(agent-registry layer under file recipes, server/handle.ts): invalid
references keep their existing warn+disable policy; valid chains now stay
enabled until the next wire request re-stamps the full cascade.

Regression test in tests/config-epoch.test.ts pins the stale window with a
registered named provider: fails on the old code, passes with the fix.
@ranxianglei
ranxianglei force-pushed the 2026-11-08_fix-stale-overlay-recipe-table branch from 821d5e5 to 7ad4c12 Compare November 9, 2026 12:26
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Update — the full-matrix dispatch you asked for completed, and it surfaced something worth explaining before I moved the branch.

What the dispatch showed. All 14 test legs failed — but not because of this PR or of broken infrastructure: the logs show 4 concrete assertion failures inside the branch's stale tree (e.g. tests/issue2817-crosswire-persona-fold.test.ts:196 8 !== 9, tests/issue5403-watermark-fastpath.test.ts:209 null !== 2, two dsh guard-stamp assertions in tests/issue2446-dsh-mcp-catalog.test.ts:258 / tests/issue2447-dsh-workspace-instructions.test.ts). The same commit had gone fully green on Nov 7, and master's own full-matrix schedule run was green today at 09:37 UTC — so this is classic stale-base drift: the branch is 414 commits behind master (cut Nov 4), and several of those test files were updated on master since then. Re-running the old head could never go green again; only a rebase can.

What I did (per the repo's §7.2 rebase-before-mergeable discipline):

  1. Rebased the PR branch onto current master (4be21b08ed) — clean, no conflicts; the PR keeps its single commit and unchanged diff content.
  2. Verified locally on the rebased head: typecheck + build clean, and targeted runs of the PR's own regression test plus all four previously-failing test files = 16/16 pass.
  3. Force-pushed the branch → new head 7ad4c124a5; GitHub has auto-triggered a fresh CI wave on it (current master's ci.yml, standard core scope). The failed runs from my dispatch lived on the old sha and fall out of the PR's checks view now that the head moved.

So: the branch now has a current head with a current CI matrix running on it (~10–15 min). I'll confirm here once it's green. One disclosure for the record: this changed the PR's head sha (821d5e5a → 7ad4c124a5) — mechanical base-move only, zero diff-content change.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

✅ Confirmed green. The fresh CI wave on the rebased head 7ad4c124a5 completed success: all 11 core test legs (ubuntu 22/24 ×3, windows 22 ×5), both static-gates legs, mysql-contract, red-signal and every guard job pass; zero failures (the handful of skipped checks are normal file-gate verdicts for this diff shape).

One last wrinkle, now being closed out: master's branch-protection required-checks list also contains three test (windows-latest, 24, …) leg names that only execute in full scope, so the PR still shows blocked even though nothing on its current head is red. I've dispatched another full-matrix run on the rebased head (the tree is now master + this one commit, and master's own full-matrix schedule run was green today at 09:37 UTC, so this should land clean). ETA ~15 min — I'll post the final all-clear here when it completes. After that the branch has exactly what you asked for: a current head with a fully completed, all-green CI matrix.

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Verdict: APPROVE — recommendation only. The reviewing account is the PR author, so GitHub blocks a formal Approve from me; please click Approve yourself if you agree with the analysis below.

Clean, minimal fix that addresses the root cause rather than masking the symptom.

What it does. On a stale config-epoch re-read, liveFileOverlayConfig (src/session.ts) rebuilds compress settings but passed an EMPTY provider table {} to applyCompressSettings. A file-declared compress.externalSummary chain then expanded against that empty table, so every valid provider/model ref threw "unknown provider" and the whole chain was silently disabled (warn-once). The fix passes the SAME merged table the request and admin paths already use — { ...agentProviderRecipes(), ...loadNamedProviders() } — shape-identical to src/server/handle.ts:879 and src/server/admin.ts:522. It is a single-source-of-truth alignment, not a payload filter.

Verification I did (independent of CI).

  • Read every applyCompressSettings call site: session.ts was the ONLY one passing {}. The request path (handle.ts:879) and admin path (admin.ts:522) already merge {...agentProviderRecipes(), ...namedProviders}; compress-settings.ts:401 expands the file-declared chain against that table and falls back to base.externalSummary when the file doesn't declare one (that branch is untouched by this diff).
  • Ran the new regression test both directions on the PR head: passes post-fix (6/6), and fails (not ok 4) when line 835 is reverted to {} — real teeth.
  • npm run typecheck clean; kernel + pi-subagents built.
  • CI mirror cache on head 7ad4c124a: all static gates/guards SUCCESS; the full ubuntu/windows × node22/24 test matrix was still completing at review time with zero failures observed (the same content already ran fully green at pre-rebase head 821d5e5a).

Behavior change (disclosed per policy): stale-window case only — valid provider/model refs in a file-declared compress.externalSummary go from silently disabled (warn-once) → enabled. Invalid refs are unchanged (still warn + disable, never 500). No change to startup, wire, persistence, cache, output format, or error handling. This matches what the PR body states.

No small mechanical findings to fix on-spot.


八问审核清单

  1. 是什么问题:stale-epoch overlay(liveFileOverlayConfig)在文件 epoch 变化后重建 compress settings 时,把 compress 段盖到 base 上却给 applyCompressSettings 传了空 provider 表 {},导致文件里声明的 externalSummary chain 用空表展开——每个合法 provider/model 引用都抛「unknown provider」,整条链被静默禁用(warn-once)。
  2. 什么原因导致的:overlay 这条路径漏掉了 provider recipe 表。请求路径(handle.ts:879)和 admin 路径(admin.ts:522)都会先合并 {...agentProviderRecipes(), ...loadNamedProviders()} 再进 resolveRequestConfig→applyCompressSettings;唯独 session.ts 的 stale-overlay 传了 {}。空表 ⇒ expandExternalSummaryChainTolerant 对每个合法引用都 catch ⇒ 整链 disabled。修法是在源头补上同一张合并表,不是在症状层过滤。
  3. 影响范围与严重程度:仅限「stale-window」场景——进程起来后用户在 config 文件里改了会移动 epoch 的字段(如 nudgeGrowthTokens),且文件声明了带 provider/model 引用的 compress.externalSummary。此前该链被静默禁用,现在恢复启用。属「特定条件下有问题」的体验缺陷;非数据丢失、非 500、不碰 wire/persistence/cache。
  4. 怎么修复的:让 overlay 与请求/admin 路径共用同一张 provider 表(文件 recipes 靠 spread 顺序覆盖 agent 层),表达式与既有路径逐字一致——单一事实来源对齐,而非拦截症状。
  5. 是否有回归问题:逐项过既有行为——①文件未声明 externalSummary 时仍回退 base.externalSummary(diff 未触及该分支);②非法引用仍走原 catch 路径 warn+disable、不会变 500;③startup/wire/persistence/cache/output-format/error-handling 均不变;④其余 applyCompressSettings 调用点本就正确。无回归。
  6. 是否破坏缓存:不涉及。config-file cache 以 raw bytes 为 key、epoch 每次 fresh sha256 读取,均不变;provider 表是每次现读(内存 agent 层 + 文件),无持久缓存失效面。
  7. 是否改了设计方向:不涉及架构转向;只是把 overlay 对齐到既有的「合并表」契约,未动 config surface / KDD。
  8. 是否引入了新的配置:不涉及。无新 env / config / 默认值。

判定:APPROVE(无阻断项;根因已修、回归测试双向钉死、行为变更已披露、house conventions 合规)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review complete for PR #5913 (this task's mirror #5915). Verdict: APPROVE — posted as a review comment on the PR (GitHub blocks a formal Approve from the bot because the reviewing account is the PR author, so please click Approve yourself if you concur).

Root cause fixed at source: the stale-epoch overlay in src/session.ts now passes the same merged provider table ({...agentProviderRecipes(), ...loadNamedProviders()}) that the request/admin paths already use, instead of {}. Regression test verified both directions locally (passes post-fix, fails when reverted); typecheck + build clean; all static gates/guards green, full test matrix still completing with zero failures observed. No blocking findings, no small mechanical fixes needed. Full analysis + 8-question checklist are on the PR.

@ranxianglei
ranxianglei merged commit 4372b9e into master Nov 9, 2026
87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][config] 0.1.212: stale-epoch overlay expands externalSummary with empty provider recipes ("known: none") and disables a valid chain

2 participants