Repository navigation
[PR] fix: stale-epoch config overlay loses the named-provider recipe table (#5912) - #5913
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.8805-pr.5913.62a3298This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5913.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。#5913 是 #5912 的唯一修复 PR —— 全仓 PR(open+closed)里引用 #5912 的只有它一条,同主题(stale-epoch overlay / 空配方表)无并列或已关的同类修复;镜像开放 [PR] 行中也没有第二个针对本线程的 PR。(顺带说明:#3431 是当初引入 stale-stamp 守卫机制的 PR,不是竞争修复。) 结论先行:可合并。 以下为独立复核(逐项自己验证,未照抄 issue/PR 描述)。 八问
独立验证记录
遗留提示(不属于本 PR):#5912 报告末尾另记了一条相邻观察(新 epoch 可能打在由启动期捕获的设置构建的快照上,使会话带着编辑前的链而戳看起来是新的)——报告者明确说不在本报告范围,本 PR 正确地没碰它;若 owner 认为属实,建议另行跟踪(按本线程规则我不代开新 issue)。 判定:可合并。 |
|
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. |
(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 Why the branch looked broken. At PR open, GitHub delivered the events several times within ~20s (five near-simultaneous runs per workflow); What I did:
Current verified state on head 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.
821d5e5 to
7ad4c12
Compare
(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. What I did (per the repo's §7.2 rebase-before-mergeable discipline):
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 ( |
(ai: vllm-qwen/qwen3.8-27b) ✅ Confirmed green. The fresh CI wave on the rebased head One last wrinkle, now being closed out: master's branch-protection required-checks list also contains three |
ranxianglei
left a comment
There was a problem hiding this comment.
(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
applyCompressSettingscall site:session.tswas the ONLY one passing{}. The request path (handle.ts:879) and admin path (admin.ts:522) already merge{...agentProviderRecipes(), ...namedProviders};compress-settings.ts:401expands the file-declared chain against that table and falls back tobase.externalSummarywhen 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 typecheckclean; kernel + pi-subagents built.- CI mirror cache on head
7ad4c124a: all static gates/guards SUCCESS; the full ubuntu/windows × node22/24testmatrix was still completing at review time with zero failures observed (the same content already ran fully green at pre-rebase head821d5e5a).
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.
八问审核清单
- 是什么问题:stale-epoch overlay(
liveFileOverlayConfig)在文件 epoch 变化后重建 compress settings 时,把compress段盖到 base 上却给applyCompressSettings传了空 provider 表{},导致文件里声明的externalSummarychain 用空表展开——每个合法provider/model引用都抛「unknown provider」,整条链被静默禁用(warn-once)。 - 什么原因导致的:overlay 这条路径漏掉了 provider recipe 表。请求路径(
handle.ts:879)和 admin 路径(admin.ts:522)都会先合并{...agentProviderRecipes(), ...loadNamedProviders()}再进resolveRequestConfig→applyCompressSettings;唯独 session.ts 的 stale-overlay 传了{}。空表 ⇒expandExternalSummaryChainTolerant对每个合法引用都 catch ⇒ 整链 disabled。修法是在源头补上同一张合并表,不是在症状层过滤。 - 影响范围与严重程度:仅限「stale-window」场景——进程起来后用户在 config 文件里改了会移动 epoch 的字段(如
nudgeGrowthTokens),且文件声明了带provider/model引用的compress.externalSummary。此前该链被静默禁用,现在恢复启用。属「特定条件下有问题」的体验缺陷;非数据丢失、非 500、不碰 wire/persistence/cache。 - 怎么修复的:让 overlay 与请求/admin 路径共用同一张 provider 表(文件 recipes 靠 spread 顺序覆盖 agent 层),表达式与既有路径逐字一致——单一事实来源对齐,而非拦截症状。
- 是否有回归问题:逐项过既有行为——①文件未声明
externalSummary时仍回退base.externalSummary(diff 未触及该分支);②非法引用仍走原 catch 路径 warn+disable、不会变 500;③startup/wire/persistence/cache/output-format/error-handling 均不变;④其余applyCompressSettings调用点本就正确。无回归。 - 是否破坏缓存:不涉及。config-file cache 以 raw bytes 为 key、epoch 每次 fresh sha256 读取,均不变;provider 表是每次现读(内存 agent 层 + 文件),无持久缓存失效面。
- 是否改了设计方向:不涉及架构转向;只是把 overlay 对齐到既有的「合并表」契约,未动 config surface / KDD。
- 是否引入了新的配置:不涉及。无新 env / config / 默认值。
判定:APPROVE(无阻断项;根因已修、回归测试双向钉死、行为变更已披露、house conventions 合规)。
[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 |
Closes #5912
What
liveFileOverlayConfig(src/session.ts) re-resolves the live file'scompresstier when a session'seffectiveConfigstamp is stale (config file edited since the last wire request). It calledapplyCompressSettings(base, limit, compress, {})with an EMPTY provider-recipe map.applyCompressSettingsexpands global-levelcompress.externalSummary"provider/model" references against that table AT RESOLVE TIME (expandExternalSummaryChainTolerant). With an empty table every valid reference throwsreferences 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 andresolveRequestConfig(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/modelreferences 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
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).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 typecheckclean;npm run buildclean. Full-suite verdict = remote CI on this head.