Repository navigation
[PR] fix(session): stamp effectiveConfig with the options-generation epoch, not the live file hash at store time - #5933
ranxianglei wants to merge 4 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10235-pr.5933.5b34380This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5933.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review started on PR #5933 (mirror #5935). First-pass findings: 查重: 不重复。 Searched open+closed issues/PRs for 标签: 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: 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- Remedy in flight: local verification (targeted suites + typecheck) is running; afterwards I push a one-line cleanup commit (dead |
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.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review verdict: PR #5933 — mergeable (human merges; I never merge)查重: 不重复(首条回复已述:open+closed 全量检索 What I independently verified (not taken from the PR description)
结构化八问
CI & thread state (live-verified at posting time)
判定:可合。 代码、测试有效性、回归清点、CI 全绿均已独立验证;合并动作留给人工:#5933 |
e099575 to
9d64286
Compare
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.
(ai: vllm-qwen/qwen3.8-27b) CI lane run 1/3 — conflict rebase complete, branch pushed七问 summary (this run):
结构化八问(中文)
判定:冲突已解除(head 9d64286,mergeable=true),等新一轮 CI 与人工合并。 |
[ework] CI fix verified green ✓ |
(ai: vllm-qwen/qwen3.8-27b) APPROVE — clean, correct, well-tested. CI green on the exact rebased head 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. Call sites / refresh paths enumerated. Consumers. Dead import. Dropping Tests (real teeth). CI. Mirror cache at sha 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. 结构化八问
判定:可合(mergeable)——代码正确、测试有牙、CI 绿、无内核改动、行为变更已披露且为预期修复。请人工合入。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Done — reviewed PR #5935 (GitHub #5933, head 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. |
…, 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.
9d64286 to
ddbe420
Compare
(ai: vllm-qwen/qwen3.8-27b) CI lane run — second conflict rebase complete, branch pushed七问 summary (this run):
结构化八问(中文)
判定:冲突已解除(head ddbe420,mergeable=true),等新一轮 CI 与人工合并。 |
[ework] CI fix verified green ✓ |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review of the rebased head The PR was force-rebased onto current master
结构化八问
判定:可合(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. |
What
#5930: after a DIRECT edit of
~/.config/billion-context/billion-context.json(no reload), live sessions kept running the PRE-edit compress chain whileGET /__bili/configreported the post-edit one — and the #2960⑥ stale-stamp guard that exists to catch exactly this could never fire.Root cause:
storeEffectiveConfigstampedmetadata.effectiveConfigEpochwithconfigFileEpoch()— the hash of the LIVE file at STORE time — onto a snapshot resolved fromopts.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 →staleEffectiveStampfalse → the guard is dead until a reload/restart.Fix
Capture
configFileEpoch()once where options are actually resolved (loadOptions()) as a new optionalProxyOptions.configSourceEpoch; the web Apply handler and/__bili/config/reloadcopy 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) passesopts.configSourceEpoch.Behavior change (disclosed)
Between a direct file edit and a reload/Apply/restart:
effectiveConfig(plugin tool API, panel nudge line) served the pre-edit snapshot indefinitely.optsuntil 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
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.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