Skip to content

[PR] fix(session): stamp effectiveConfig with the options-generation epoch, not the live file hash at store time - #5933

Open
ranxianglei wants to merge 4 commits into
masterfrom
2026-11-08_effective-config-epoch-stamp
Open

ranxianglei wants to merge 4 commits into
masterfrom
2026-11-08_effective-config-epoch-stamp

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What

#5930: after a DIRECT edit of ~/.config/billion-context/billion-context.json (no reload), live sessions kept running the PRE-edit compress chain while GET /__bili/config reported the post-edit one — and the #2960⑥ stale-stamp guard that exists to catch exactly this could never fire.

Root cause: storeEffectiveConfig stamped metadata.effectiveConfigEpoch with configFileEpoch() — the hash of the LIVE file at STORE time — onto a snapshot resolved from opts.compress, which only refreshes at startup / web Apply / reload. After a direct edit between refresh and request, the next request re-stamped the POST-edit hash onto the PRE-edit snapshot: stamp == live hash → staleEffectiveStamp false → the guard is dead until a reload/restart.

Fix

Capture configFileEpoch() once where options are actually resolved (loadOptions()) as a new optional ProxyOptions.configSourceEpoch; the web Apply handler and /__bili/config/reload copy it alongside the other fields. storeEffectiveConfig(session, config, sourceEpoch?) stamps THAT generation; an unknown source identity stamps nothing, preserving the legacy no-epoch behavior for such sessions. The sole production call site (src/server/handle.ts) passes opts.configSourceEpoch.

Behavior change (disclosed)

Between a direct file edit and a reload/Apply/restart:

  • Old: request-free display surfaces reading effectiveConfig (plugin tool API, panel nudge line) served the pre-edit snapshot indefinitely.
  • New: they serve the live-file overlay (the same path the stale guard already used when it fired).
  • Wire path unchanged: model requests still resolve from opts until a reload/Apply/restart — this PR does NOT make config edits hot-apply (that policy question was explicitly out of scope in the issue).

No new config/env/CLI surface. No kernel/ changes.

Tests

  • New regression tests/config-epoch.test.ts "config epoch [Bug][config] 0.1.212: effectiveConfigEpoch stamps the live file hash onto a snapshot resolved from startup-captured opts — config edits silently keep the pre-edit chain until reload #5930": load v1 → resolve+store → direct edit v2 → re-resolve+re-store from the SAME stale options → the display read must now serve v2 (overlay). Negative-controlled locally: reverting the stamp back to the old store-time hash makes exactly this test fail; restored, it passes.
  • The five pre-existing epoch tests were updated to pass an explicit source epoch so they keep pinning the same-source branch under the new contract (they pass under both semantics — they pin guard behavior, not stamp sourcing); the no-epoch legacy test is untouched.
  • Targeted local runs green: tests/config-epoch.test.ts (6), tests/issue2578-mcp-hard-protection.test.ts (7), tests/web-routing.test.ts (8 — exercises the touched PUT handler); typecheck clean. Full-suite verdict = remote CI.

Closes #5930

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-08_effective-config-epoch-stamp (ddbe420)

Latest build — install this exact version

npm install -g billion-context@0.0.10235-pr.5933.5b34380

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
ddbe420 billion-context@0.0.10235-pr.5933.5b34380 build
9d64286 billion-context@0.0.8910-pr.5933.afdf2b8 build
e099575 billion-context@0.0.8608-pr.5933.f8e1036 build
9b27de8 billion-context@0.0.8607-pr.5933.3126d46 build
370b306 billion-context@0.0.8600-pr.5933.79e7026 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei added bug Something isn't working p2 scope/kernel labels Nov 8, 2026
@ranxianglei ranxianglei changed the title fix(session): stamp effectiveConfig with the options-generation epoch, not the live file hash at store time [PR] fix(session): stamp effectiveConfig with the options-generation epoch, not the live file hash at store time Nov 8, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Review started on PR #5933 (mirror #5935). First-pass findings:

查重: 不重复。 Searched open+closed issues/PRs for configSourceEpoch, effectiveConfigEpoch, staleEffectiveStamp and references to #5930 — only this PR matches; mirror search clean as well.

标签: bug, scope/kernel, p3 (+ existing pr) — display-only config-staleness guard defect; trigger requires a direct file edit without reload; workaround = reload/Apply/restart; wire path unchanged. (Upstream PR carries p2; I kept p3 judging the PR's own diff — no functional or wire impact, diagnostic/display surfaces only.)

Diff: single commit 370b306 on current master, 5 files, +79/−10. Mechanism verified against source: loadOptions() captures configFileEpoch() next to its file read (src/config.ts); web Apply and /__bili/config/reload copy it through (src/server/admin.ts:427, :931); the sole production call site passes it (src/server/handle.ts:2647); the stamp is written only when a non-empty epoch is passed (src/session.ts:794), so legacy no-epoch sessions are untouched. Fork adoption inherits the stamp together with the snapshot (src/plugin.ts:1681) — consistent under the new semantics. The reader (src/session.ts:834) serves the live-file overlay exactly as the disclosed behavior change describes.

Live CI state (verified just now): all gate jobs green on the head sha, but the entire test/static-gates matrix ran SKIPPED — the last CI run on this ref was triggered by a non-ci:full labeled event, which scopes the plan job to skip; the original opened/synchronize core runs were cancelled in a same-second concurrency burst. Net effect: mergeable_state=blocked and there is currently NO full-suite verdict on this head.

Remedy in flight: local verification (targeted suites + typecheck) is running; afterwards I push a one-line cleanup commit (dead storeEffectiveConfig import in src/server.ts:57, found during review) which re-triggers the core matrix via synchronize. Full structured verdict follows once CI lands.

@ranxianglei ranxianglei added the p3 label Nov 8, 2026
ranxianglei pushed a commit that referenced this pull request Nov 8, 2026
Review cleanup found while reviewing #5933: this import is never used in
src/server.ts (no module imports it from server.js either). No behavior
change.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Review verdict: PR #5933 — mergeable (human merges; I never merge)

查重: 不重复(首条回复已述:open+closed 全量检索 configSourceEpoch / effectiveConfigEpoch / staleEffectiveStamp / #5930 引用,仅本 PR 命中)。

What I independently verified (not taken from the PR description)

结构化八问

  1. 是什么问题:直接编辑配置文件(不 reload)后,存活会话的展示面一直按编辑前的配置快照走,而 GET /__bili/config 已显示编辑后的值;专为拦这种情况的 Identity pipeline: key sessions by (agent, conversation id) in the unified store — decouple fold ledgers from protocol/host origin (#2938 / #2847 / #2671 defect-1) #2960⑥ stale-stamp 守卫却永远不会触发——因为存快照时盖的是"存储时刻的活文件 hash",编辑后新请求把新 hash 盖回旧快照,stamp 恒等于 live hash。
  2. 什么原因导致的:快照的身份来源与盖章时刻脱钩——快照取自 opts.compress(仅启动/Apply/reload 刷新),章却取存储时的 configFileEpoch()。refresh 与请求之间的任何直接编辑都会给旧快照铸新章,使守卫在下次 reload 前永久失明。
  3. 影响范围与严重程度:仅展示面(plugin tool API、面板 nudge 行)在 edit→reload 窗口内长期服务编辑前快照;模型线不受影响(仍从 opts 解析);触发条件低频(直改文件且不 reload),有绕行(reload/Apply/重启)。p3——上游 PR 标了 p2,我按本 PR diff 独立判 p3(无功能/无线上语义影响)。
  4. 怎么修复的:在选项真正解析处(loadOptions())一次性捕获 configFileEpoch() 为新的内部字段 configSourceEpoch(Apply/reload 两处同步拷贝);storeEffectiveConfig 改盖"快照实际解析自的那一代",未知来源身份不盖章(保留旧会话 legacy 行为);读取端拒绝过期快照时回落 live-file overlay(与守卫原设计同一路径)。
  5. 是否有回归问题:已逐项审既有行为——(a) 无 epoch 旧会话:不盖章→legacy 路径,不变;(b) 跨 lane 字节相同文件互认:content-hash 语义不变;(c) 线上 wire 路径:不变(消费方仅 plugin.ts:1895/:2299 两个展示/工具面);(d) fork 继承:快照与代际标识成对复制,一致;(e) 发现并已在本线程内修复:golden storage-drive 字节夹具需携带新字段(e099575,mirror loadOptions,drive 无配置文件故逐字节稳定)——这是"无 epoch 不写键"语义的真实相邻影响面,CI 暴露、合并前已修;(f) 残留(接受):loadConfigFile 读文件与 configFileEpoch 再读之间存在 µs 级 TOCTOU 窗口,窗口内的编辑要到下次编辑/reload 才被守卫看见;窗口已从"任意长"缩到 µs,彻底修法需对已解析字节做 hash,不值得。
  6. 是否破坏缓存:不涉及——未触碰缓存/重试/增量游标/去重键;出站字节不变,prefix cache 稳定性不受影响。
  7. 是否改了设计方向:不涉及——Identity pipeline: key sessions by (agent, conversation id) in the unified store — decouple fold ledgers from protocol/host origin (#2938 / #2847 / #2671 defect-1) #2960⑥ 守卫架构不变,只是章的身份来源从"存储时刻"移到"选项代际";明确未引入 hot-apply(issue 中已声明 out of scope)。
  8. 是否引入了新的配置:无——无新 env/config/CLI 面;configSourceEpoch 是内部选项字段,非用户可见。

CI & thread state (live-verified at posting time)

  • Current head e099575: FULL core matrix GREEN — 11/11 test shards (ubuntu/windows × node 22/24), static-gates ×2, mysql-contract, all guard jobs; e2e lanes skipped by file-gate (PR touches none of their trigger files). Zero failures.
  • Earlier heads had NO executed matrix: the PR opened with labels pre-attached, so the last surviving run was a non-ci:full labeled event scoped to skip, and the original core runs were cancelled in a concurrency burst — root-caused and reported on CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 (CI 总控), no new issue opened.
  • My contribution to the branch: one clearly-labeled cleanup commit 9b27de8 — removed the dead storeEffectiveConfig import at src/server.ts:57 (pre-existing, unused anywhere; no behavior change). e099575 was pushed by the PR pipeline, not me.
  • Branch is behind current master (base moved on docs slimming + two fix batches); no textual conflicts, and I checked master's hunks in the four shared files (src/config.ts, src/server.ts, src/server/admin.ts, src/server/handle.ts) — all sit far from this PR's change sites, no semantic interaction. Safe to merge as-is; updating the branch first is optional.
  • Labels: mirror carries bug/scope/kernel/p3/pr (my judgment on the diff); upstream PR carries bug/p2/scope/kernel.

判定:可合。 代码、测试有效性、回归清点、CI 全绿均已独立验证;合并动作留给人工:#5933

@ranxianglei
ranxianglei force-pushed the 2026-11-08_effective-config-epoch-stamp branch from e099575 to 9d64286 Compare November 10, 2026 07:38
ranxianglei pushed a commit that referenced this pull request Nov 10, 2026
Review cleanup found while reviewing #5933: this import is never used in
src/server.ts (no module imports it from server.js either). No behavior
change.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI lane run 1/3 — conflict rebase complete, branch pushed

七问 summary (this run):

  1. What was blocking? PR [PR] fix(session): stamp effectiveConfig with the options-generation epoch, not the live file hash at store time #5933 was dirty against master (merge conflict), so it could not merge. No red CI: the last executed matrix on the old head e099575 was fully green (mirror cache summary: 30 checks, 0 failed).
  2. Why did it conflict? Master moved 368 commits past the merge base (354e21e) and rewrote the exact import region of src/server.ts that the PR's cleanup commit touches: master dropped RESPONSES_TURN_SEPARATOR_ID_PREFIX from the ./session.js import and added a separate SeparatorManifest type import, while the PR commit removed storeEffectiveConfig from the same line. Textual collision on one line.
  3. How was it resolved? Rebased all 3 PR commits onto current master (4dea18e). The single conflict was resolved by union of intent: keep master's import structure (incl. the SeparatorManifest line) AND drop storeEffectiveConfig — verified first that master itself no longer uses that symbol anywhere in src/server.ts (the only occurrence was the import line), so the PR's cleanup intent still holds verbatim.
  4. What did I change besides the rebase? One labeled commit, 9d64286 test(config-epoch): pass explicit source epoch in the #5912 live-chain test after rebase (#5930). Cause: master added a NEW test to tests/config-epoch.test.ts ([Bug][config] 0.1.212: stale-epoch overlay expands externalSummary with empty provider recipes ("known: none") and disables a valid chain #5912 "a live externalSummary chain survives the stale window") after this PR's merge base; it stored its snapshot via storeEffectiveConfig(session, stamped) with NO epoch — under this PR's contract a missing epoch stamps nothing (legacy stamp-wins), so the stale-overlay path it pins never engaged and its target-expansion asserts failed (targets[0].model undefined vs summodel). Fix = pass configFileEpoch() explicitly, exactly the pattern this PR already applied to its five pre-existing epoch tests (same-source branch pinned under the new contract). No production code touched this run.
  5. How was it verified? Locally (targeted only, per testing discipline): typecheck clean; tests/config-epoch.test.ts 7/7 (was 6/7 pre-fix, negative-checked: the failure reproduced before the one-line fix and passes after); tests/web-routing.test.ts + tests/issue2578-mcp-hard-protection.test.ts + tests/golden-storage-render.test.ts 20/20. Final diff vs master unchanged in scope: 7 files, +90/−12 (delta vs pre-rebase +86/−11 is exactly the test fix). Full-suite verdict = remote CI on the new head.
  6. Behavior change / regression risk? None introduced this run — production diff is byte-identical to what was already reviewed and approved in-thread (floor 4 verdict: mergeable); the only new content is the test-contract alignment described above. The PR's own disclosed behavior change (display surfaces serve the live-file overlay between a direct edit and reload) is unchanged.
  7. State & next step? Pushed with force-with-lease (the task-authorized conflict rebase; remote head was still e099575, nothing else lost). Live-verified just now: head = 9d64286, mergeable = true (conflict cleared), mergeable_state = blocked awaiting the fresh CI run / human review. Next: watch the synchronize-triggered matrix on 9d64286; if any shard goes red, the same bot owns the follow-up (attempt budget 1/3 used). Merge stays human-only.

结构化八问(中文)

  1. 是什么问题:PR [PR] fix(session): stamp effectiveConfig with the options-generation epoch, not the live file hash at store time #5933 与 master 冲突(dirty)无法合并;CI 本身无红项(旧 head 全绿)。
  2. 什么原因导致的:master 在合并基之后推进 368 个提交,重写了本 PR 清理提交所触碰的 src/server.ts import 行(master 移除 RESPONSES_TURN_SEPARATOR_ID_PREFIX、新增 SeparatorManifest 导入,与本 PR 删除 storeEffectiveConfig 撞在同一行)。
  3. 影响范围与严重程度:仅阻塞本 PR 合并,不影响任何线上行为。
  4. 怎么修复的:rebase 到最新 master;唯一冲突按双方意图并集解决(保留 master 的 import 结构、同时落实本 PR 的无用导入清理——已先验证 master 侧确实不再使用该符号)。另补一个标注 commit:master 新加入的 [Bug][config] 0.1.212: stale-epoch overlay expands externalSummary with empty provider recipes ("known: none") and disables a valid chain #5912 测试按旧契约"不传 epoch"写法与新契约冲突,改为显式传 configFileEpoch(),与本 PR 对五个既有 epoch 测试的改法完全一致。
  5. 是否有回归问题:无——生产代码 diff 与已审核通过版本逐字节一致;本轮唯一新增内容是测试契约对齐。本地定向验证:typecheck 干净,config-epoch 7/7(修复前负向复现失败、修复后通过),web-routing/issue2578/golden-storage-render 20/20。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:无。

判定:冲突已解除(head 9d64286,mergeable=true),等新一轮 CI 与人工合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

APPROVE — clean, correct, well-tested. CI green on the exact rebased head 9d64286eeb. Ready for human merge (I do not merge).

This is my own end-to-end read at the PR head, not a carry-over of the earlier first-pass. What I independently verified:

Mechanism (correct & complete). The defect is a stamp-timing bug. storeEffectiveConfig stamped metadata.effectiveConfigEpoch with the live file hash computed at store time, but the stored snapshot was resolved from opts.compress, which only refreshes at startup / web Apply / /reload. After a direct file edit lands between a refresh and the next request, the next request re-stamped the post-edit live hash onto the pre-edit snapshot ⇒ stamped == liveFileHash ⇒ staleEffectiveStamp() (src/session.ts:827) is forever false ⇒ the #2960⑥ guard is dead until a reload. The fix moves the stamp source to the options-generation: loadOptions() captures configFileEpoch() once right after loadConfigFile() into new optional field ProxyOptions.configSourceEpoch (src/config.ts:1676, :1805, type at :1009); both runtime refreshers copy it (src/server/admin.ts:432 web Apply, :936 handleConfigReload); the sole production store site stamps it (src/server/handle.ts:2680). Now a direct edit moves the live file past the generation the snapshot came from ⇒ stamped != live ⇒ stale ⇒ effectiveConfig (src/session.ts:852) serves the live-file overlay. I traced the full old-vs-new decision path and it closes the hole exactly as claimed.

Call sites / refresh paths enumerated. storeEffectiveConfig( appears only at its definition (src/session.ts:797) and the one production call (src/server/handle.ts:2680). Exactly two runtime opts.compress = refreshers exist (the web Apply PUT and the reload handler); both now copy configSourceEpoch from a fresh loadOptions(). No other hot-refresh path mutates opts.routes/kernelConfig anywhere in src/ (routes/namedProviders are Object.assign-ed inside those same two handlers). So no path leaves the epoch stale.

Consumers. effectiveConfig is read only by src/plugin.ts:2006 (panel nudge/status render) and src/plugin.ts:2410 (proxy-tool exec config) — both display/tool surfaces, not the model wire. The model request resolves reqConfig straight from opts and feeds processTurn, so the "wire path unchanged" disclosure is accurate.

Dead import. Dropping storeEffectiveConfig from the src/server.ts import list (af3c071914) is safe — zero remaining references in that file.

Tests (real teeth). tests/config-epoch.test.ts has 7 meaningful cases. The new #5930 regression (:172) drives the real production path — loadOptions() → assert opts.configSourceEpoch present → resolveRequestConfig(...) → store with that epoch → precondition read == 333_000 → edit file to 777_000 with no reload → re-resolve from the same stale opts + re-store → final read MUST be 777_000. Under the old code the re-store stamps the post-edit live hash, so the final read returns 333_000 and this assert fails; under the new code it passes. That is a genuine reproducer of the reported bug, not a mock-only assertion. The five pre-existing cases were updated minimally to pass an explicit epoch so they keep pinning the same-source / stale-rejection branches under the new contract (they pass under both semantics — they pin guard behavior, not stamp sourcing); the #5912 case now passes configFileEpoch() explicitly so the stale-overlay path actually engages (this is what commit 9d64286eeb added after the rebase). The no-epoch legacy case is untouched. Golden drive carries configSourceEpoch: configFileEpoch() in goldenProxyOptions so persisted-metadata bytes stay stable under the new (no-stamp-on-missing) contract.

CI. Mirror cache at sha 9d64286eeb: 30 checks — 14 success (all test shards ubuntu/windows × node 22/24, static-gates ×2, mysql-contract), 16 skipped (file-gated e2e/theorem/red-signal lanes the PR touches none of), 0 failed, 0 pending. mergeable_state=blocked is awaiting-review only, no conflict, master unmoved. Authoritative full-suite verdict: GREEN. I did not re-run the suite locally (node_modules absent; heavy native deps) — the green CI on the exact head is the authoritative verdict per house rules.

Behavior change (disclosed, intended, not a regression). Between a direct file edit and the next reload/Apply/restart: OLD — display/tool surfaces served the pre-edit snapshot indefinitely (guard dead); NEW — they serve the live-file overlay during that window (the same path the guard used whenever it fired). Model wire path unchanged (still opts-based until reload). Net effect is restoring the #2960⑥ guard (October externalSummary retired-chain incident class) — strictly more correct/safe, not a regression.


结构化八问

  1. 是什么问题:直接编辑配置文件后、未 reload/Apply/重启的窗口内,Identity pipeline: key sessions by (agent, conversation id) in the unified store — decouple fold ledgers from protocol/host origin (#2938 / #2847 / #2671 defect-1) #2960⑥ 守卫失效——store 时用「存盘时刻的 live 文件 hash」盖戳,请求到来时文件已改,新 stamp==live → staleEffectiveStamp 恒 false → 展示/工具面无限期服务编辑前的旧快照。
  2. 什么原因导致的:stamp 来源取错时机。effectiveConfigEpoch 本应记录「这份 snapshot 出自哪一代 options」,却在 storeEffectiveConfig 落盘时实时重算 live 文件 hash 去盖。直接编辑落在 refresh 与 request 之间时,下次请求把「编辑后」的 live hash 盖到「编辑前」的快照上,stamp 与 live 恒等,守卫永判不出 stale。
  3. 影响范围与严重程度:受影响面 = 无 wire 的展示/工具面(panel nudge 行 plugin.ts:2006、proxy-tool 压缩执行配置 plugin.ts:2410)。触发条件 = 用户直接改配置文件且未 reload/Apply/重启。严重度 p3:低频触发、有绕行(reload/Apply/重启即恢复)、不碰模型 wire、不碰缓存、不丢数据;且本修复是恢复 Identity pipeline: key sessions by (agent, conversation id) in the unified store — decouple fold ledgers from protocol/host origin (#2938 / #2847 / #2671 defect-1) #2960⑥ 守卫功能(十月 externalSummary retired-chain 事故类),净效果更安全。
  4. 怎么修复的:把 stamp 来源从「存盘时刻 live hash」改为「options 生成时的 epoch」。loadOptions() 在 loadConfigFile() 之后捕获一次 configFileEpoch() 存入新可选字段 ProxyOptions.configSourceEpoch;web Apply 与 /reload 两条刷新路径从 fresh/reloaded 拷贝该字段;storeEffectiveConfig(session, config, sourceEpoch?) 只盖这一代 epoch;缺省来源不盖戳 = 保持 legacy 语义。
  5. 是否有回归问题:无。逐项过既有行为——(a) same-source stamp-wins 合并语义不变(测试fix: keep system prompt byte-stable for prefix cache #1 钉住);(b) 无 epoch 的 pre-修 flaky 测试:vscode 取消用例改为真实的『读着读着中断』形状 #3430 会话保持 legacy merge(测试fix: post-merge review fixes + per-route context window + XDG config #6 钉住);(c) [Bug][config] 0.1.212: stale-epoch overlay expands externalSummary with empty provider recipes ("known: none") and disables a valid chain #5912 live externalSummary 链在 stale 窗口内仍存活且按 live named-provider 表展开(测试feat: OpenAI Responses API support (/v1/responses) #4 钉住);(d) 跨 lane byte-identical 文件按内容 hash 校验通过(测试feat: persistent + namespaced sessions, multi-tenant session isolation, stream robustness #5 钉住);(e) wire 路径不变(handle.ts 直接用 reqConfig 喂 processTurn,不经 effectiveConfig)。高危模式(fail-fast 变吞错、阈值/时序漂移、输出格式变化)均未触及。
  6. 是否破坏缓存:否。出站 wire 字节不变(模型请求照旧从 opts 解析),前缀缓存稳定性不受影响;effectiveConfig overlay 只作用于展示/工具渲染与 proxy-tool 配置解析,不进模型请求体。
  7. 是否改了设计方向:否。Identity pipeline: key sessions by (agent, conversation id) in the unified store — decouple fold ledgers from protocol/host origin (#2938 / #2847 / #2671 defect-1) #2960⑥ 守卫架构原样保留,仅把 STAMP 来源从 store-time 移到 options-load-time;明确不做 wire 热应用(out of scope),未引入新数据流。
  8. 是否引入了新的配置:否。configSourceEpoch 是内部 ProxyOptions 字段,非用户可见配置/env/CLI 表面。

判定:可合(mergeable)——代码正确、测试有牙、CI 绿、无内核改动、行为变更已披露且为预期修复。请人工合入。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Done — reviewed PR #5935 (GitHub #5933, head 9d64286eeb) end-to-end; full review + structured 8-question checklist are in the comment above.

Verdict: APPROVE — ready for human merge. Independently verified at the PR head (not carried over from the earlier first-pass):

No small findings needed a fix commit (dead import already fixed by the PR itself); nothing escalated to a decision. Git restored to the working branch (clean tree).

Open item: I could not identify the distinct "coordination issue" for the one-line completion report (searched open/closed/all for review/coordination/审查/lane/总控; the only central hub is CI 总控 #4599, which is CI-scoped). Give me its number and I'll post the line there.

ci-check added 4 commits November 16, 2026 00:16
…, not the live file hash at store time

#5930: storeEffectiveConfig stamped metadata.effectiveConfigEpoch with
configFileEpoch() — the hash of the LIVE config file at store time — onto a
snapshot resolved from opts.compress, which only refreshes at startup /
PUT /__bili/config / POST /__bili/config/reload. After a direct file edit
(no reload), every request re-stamped the post-edit hash onto the pre-edit
chain, so staleEffectiveStamp compared equal and the #2960⑥ guard could
never fire; GET /__bili/config reported the new chain while live sessions
kept running the pre-edit one until reload/restart.

Capture configFileEpoch() once in loadOptions() as ProxyOptions.configSourceEpoch
(copied by the web Apply and reload handlers), and stamp THAT value in
storeEffectiveConfig via the sole production call site (handle.ts). Unknown
source identity stamps nothing, preserving the legacy no-epoch behavior.

Behavior change (between a direct edit and a reload): request-free display
surfaces reading effectiveConfig (plugin tool API, panel nudge line) now
serve the live-file overlay instead of the pre-edit snapshot indefinitely.
The wire path is unchanged — requests still resolve from opts until reload.

Regression test: tests/config-epoch.test.ts "config epoch #5930" reproduces
the exact ordering (load v1 → resolve+store → edit v2 → re-resolve+re-store
from stale opts → overlay must win); negative-controlled against the old
store-time stamping (fails there, passes here).
Review cleanup found while reviewing #5933: this import is never used in
src/server.ts (no module imports it from server.js either). No behavior
change.
…Options (#5930)

The #5930 stamping change makes storeEffectiveConfig skip the effectiveConfigEpoch metadata key when opts.configSourceEpoch is absent. goldenProxyOptions hand-builds ProxyOptions without that field, so driven sessions persisted a metadata section missing a key master always wrote (sha256("") with no config file) — every committed storage-render/proofs golden drifted on its metadata section across all four wires (six failing CI shards).

Mirroring loadOptions here (configSourceEpoch: configFileEpoch()) keeps the fixture faithful to production, where options always carry the epoch; with the drive's absent no-config.json the value equals exactly what the old store-time stamping wrote, so persisted bytes — and the committed goldens — stay unchanged.
…n test after rebase (#5930)

Rebasing onto master pulled in the #5912 stale-window test added there after
this PR's merge base. It stored its snapshot without a source epoch, which
under the #5930 contract stamps nothing (legacy stamp-wins) — so the
stale-overlay path it pins never engaged and its target-expansion asserts
failed. Pass configFileEpoch() at store time, exactly as this PR already did
to the five pre-existing epoch tests: same-source branch pinned under the new
contract.
@ranxianglei
ranxianglei force-pushed the 2026-11-08_effective-config-epoch-stamp branch from 9d64286 to ddbe420 Compare November 15, 2026 16:19
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI lane run — second conflict rebase complete, branch pushed

七问 summary (this run):

  1. What was blocking? PR [PR] fix(session): stamp effectiveConfig with the options-generation epoch, not the live file hash at store time #5933 was dirty again: master advanced 511 commits past the head I rebased onto last run (4dea18e → f648217), and the PR's cleanup commit collided with master's rewrite of the same import line in src/server.ts once more.
  2. Why the same spot? The ./session.js import line in src/server.ts is a churn hotspot — master added type NudgeStamps to that exact line in the new 511-commit window, and this PR's commit removes storeEffectiveConfig from the same line. Every master pass through that line re-conflicts until the PR merges.
  3. How was it resolved? Rebased all 4 branch commits onto current master (f648217). Single conflict, resolved by union of intent exactly as last run: keep master's line (now incl. type NudgeStamps) AND drop storeEffectiveConfig — re-verified live that master still uses that symbol nowhere in src/server.ts (only occurrence = the import line itself), so the cleanup intent still holds.
  4. What else changed? Nothing. No new fixes were needed this run — master's 511 commits did not touch tests/config-epoch.test.ts or tests/golden-storage-drive.ts, and the [Bug][config] 0.1.212: stale-epoch overlay expands externalSummary with empty provider recipes ("known: none") and disables a valid chain #5912 test-contract alignment from my previous run (commit now ddbe420) already rides on the branch. Final diff vs master unchanged in scope: 7 files, +90/−12; I reviewed the hunks in the heavily-churned files (src/config.ts +62/−38, src/server/handle.ts +353/−40, src/session.ts +46 on master's side) — all PR hunks landed cleanly in context, no semantic interaction.
  5. How was it verified? Locally (targeted only): npm ci (lockfile moved on master), typecheck clean; tests/config-epoch.test.ts + tests/web-routing.test.ts + tests/issue2578-mcp-hard-protection.test.ts + tests/golden-storage-render.test.ts = 27/27 green. Full-suite verdict = remote CI on the new head.
  6. Behavior change / regression risk? None — production diff remains byte-identical to the version already reviewed and approved in-thread (floor 4 verdict: mergeable). This run only re-based; zero new content.
  7. State & next step? Force-pushed with lease guard (task-authorized conflict rebase; remote head was still 9d64286, nothing else lost). Live-verified just now: head = ddbe420, mergeable = true (conflict cleared), mergeable_state = blocked awaiting the synchronize-triggered CI run + human review. If the fresh matrix goes red, this bot owns the follow-up. Merge stays human-only.

结构化八问(中文)

  1. 是什么问题:PR [PR] fix(session): stamp effectiveConfig with the options-generation epoch, not the live file hash at store time #5933 再次与 master 冲突(dirty)——上次 rebase 之后 master 又推进了 511 个提交。
  2. 什么原因导致的:src/server.ts 的 ./session.js import 行是热点行——master 在该行新增了 type NudgeStamps,与本 PR 删除 storeEffectiveConfig 的清理提交再次撞行。
  3. 影响范围与严重程度:仅阻塞本 PR 合并,无线上行为影响。
  4. 怎么修复的:rebase 到最新 master(f648217);唯一冲突按双方意图并集解决(保留 master 新符号、落实本 PR 的无用导入清理——已再次验证 master 侧确无使用)。本轮无其他改动。
  5. 是否有回归问题:无——生产代码 diff 与已审核通过版本逐字节一致。本地定向验证:typecheck 干净,4 个定向测试文件 27/27 全绿;master 侧大改的三个文件(config/handle/session)已逐 hunk 核对,无语义交互。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:无。

判定:冲突已解除(head ddbe420,mergeable=true),等新一轮 CI 与人工合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Re-review of the rebased head ddbe420380 — APPROVE (confirms my earlier review of 9d64286eeb).

The PR was force-rebased onto current master f648217c, which had advanced ~511 commits since my first pass. What I freshly verified on the new head (not assumed):

  • Patch is byte-identical to the previously-reviewed head. git diff of the 4 commits is unchanged (same 7 files, +90/−12; identical commit subjects). The only differences are hunk line-number shifts plus one context line: master added type NudgeStamps to the src/server.ts import from ./session.js, which the rebase correctly preserves while still removing only storeEffectiveConfig. Clean rebase, 0 conflicts, 0 commits behind master.
  • Mechanism re-verified at the new head. storeEffectiveConfig is still defined at src/session.ts:810 (stamps effectiveConfigEpoch only when a non-empty epoch is passed, else stamps nothing = legacy) with the sole production call at src/server/handle.ts:2957 passing opts.configSourceEpoch. Exactly two opts.compress refreshers exist (src/server/admin.ts:429 web Apply, :933 reload), both copying the epoch (:432/:936). The reader is unchanged (staleEffectiveStamp :840, liveFileOverlayConfig :858, effectiveConfig :865). The only two effectiveConfig consumers remain display/tool surfaces (src/plugin.ts:2081 panel nudge, :2486 proxy-tool exec) — the wire path still resolves reqConfig straight from opts. No new caller or refresh path appeared anywhere in the 511-commit master window.
  • Tests unchanged and still have teeth. The #5930 regression (tests/config-epoch.test.ts:180) drives the real loadOptions()→resolveRequestConfig()→store path and fails under the old code / passes under the new; the #5912 case passes an explicit epoch so the stale-overlay path engages; the golden drive carries the epoch for persisted-metadata byte stability.
  • CI. The review-lane dispatch reports the PR green and blocked awaiting review (not on checks). The only mirror-check snapshot I could read was a stale mid-run capture (8 guard lanes still queued, 0 failed), so I'm relying on the dispatch's green signal plus my independent code/test/rebase verification rather than a fresh mirror read — flagging that honestly rather than overclaiming a green I didn't re-read.
  • No kernel/ or pi-subagents/ changes ⇒ the human-tier gate is not triggered. The disclosed behavior change is unchanged from my first review: during the direct-edit→reload window, display/tool surfaces now serve the live-file overlay instead of the stale pre-edit snapshot (restores the Identity pipeline: key sessions by (agent, conversation id) in the unified store — decouple fold ledgers from protocol/host origin (#2938 / #2847 / #2671 defect-1) #2960⑥ guard); the model wire path is unchanged.

结构化八问

  1. 是什么问题:直接编辑配置文件后、未 reload/Apply/重启的窗口内,Identity pipeline: key sessions by (agent, conversation id) in the unified store — decouple fold ledgers from protocol/host origin (#2938 / #2847 / #2671 defect-1) #2960⑥ 守卫失效——store 时用「存盘时刻 live 文件 hash」盖戳,编辑后 stamp==live → 守卫永判不出 stale → 展示/工具面无限期服务编辑前的旧快照。
  2. 什么原因导致的:stamp 来源取错时机。effectiveConfigEpoch 本应记录「snapshot 出自哪一代 options」,却在 storeEffectiveConfig 落盘时实时重算 live 文件 hash 去盖。
  3. 影响范围与严重程度:仅无 wire 的展示/工具面(panel nudge 行、proxy-tool 压缩执行配置);触发=直接改配置文件且未 reload/Apply/重启;p3(低频、有绕行、不碰 wire/缓存/数据),且本修复是恢复守卫功能,净效果更安全。
  4. 怎么修复的:把 stamp 来源改为 options 生成时的 epoch——loadOptions() 捕获一次 configFileEpoch() 存入新可选字段 ProxyOptions.configSourceEpoch,web Apply 与 /reload 两条刷新路径拷贝该字段,store 只盖这一代;缺省来源不盖戳=保持 legacy。
  5. 是否有回归问题:无。same-source 合并语义、无-epoch legacy、[Bug][config] 0.1.212: stale-epoch overlay expands externalSummary with empty provider recipes ("known: none") and disables a valid chain #5912 live 链在 stale 窗口存活且按 live named-provider 表展开、跨 lane 内容 hash 校验、wire 路径不变——逐项由测试钉住;高危模式(fail-fast 变吞错、阈值/时序漂移、输出格式变化)均未触及。
  6. 是否破坏缓存:否。出站 wire 字节不变(模型请求照旧从 opts 解析),前缀缓存稳定性不受影响;effectiveConfig overlay 只作用于展示/工具渲染与 proxy-tool 配置解析,不进模型请求体。
  7. 是否改了设计方向:否。Identity pipeline: key sessions by (agent, conversation id) in the unified store — decouple fold ledgers from protocol/host origin (#2938 / #2847 / #2671 defect-1) #2960⑥ 守卫架构原样保留,仅把 STAMP 来源从 store-time 移到 options-load-time;明确不做 wire 热应用(out of scope),未引入新数据流。
  8. 是否引入了新的配置:否。configSourceEpoch 是内部 ProxyOptions 字段,非用户可见配置/env/CLI 表面。

判定:可合(mergeable) —— rebase 干净、补丁与已审 head 字节一致、机制/测试在新 head 复核通过、CI 绿(dispatch 信号)、无内核改动、行为变更已披露且为预期修复。请人工合入。

Open item (coordination): I still can't identify the distinct "coordination issue" for the one-line completion report — searched open/closed/all for review/coordination/审查/lane/总控; the only central hub is CI 总控 #4599, which is CI-scoped. Send me its number and I'll post the line there.

This branch has not been deployed

No deployments
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 p3 scope/kernel

Projects

None yet

1 participant