Repository navigation
fix(session): refuse stale effectiveConfig stamps via config-file epoch - #3431
Merged
Merged
Conversation
…ch (#3430) Every wire request stamps metadata.effectiveConfig, but the stamp only refreshed on the NEXT wire request — tool-path readers (plugin tool API, status panels, nudge re-anchor) kept executing settings the user had already deleted from the config file, and a session on a multi-instance machine could carry a foreign instance's stamp for days (the October externalSummary incident: a user-disabled summary chain kept running). - configFileEpoch() (src/config.ts): sha256 of the live config file content — content-keyed so byte-identical files validate cross-instance while any edit diverges; cost mirrors loadConfigFile()'s per-call read. - storeEffectiveConfig stamps metadata.effectiveConfigEpoch next to the snapshot; forks inherit the key (plugin.ts copy list). - effectiveConfig refuses the snapshot when the epoch no longer matches and re-resolves the live file tier (global compress.*, including externalSummary) onto the fallback; provider/model cascade levels are deliberately re-stamped by the next wire request (they need the request URL). The nudge growth-margin reader takes the same guard. - Legacy snapshots without an epoch keep the old merge semantics. - Goldens re-pinned: metadata digest gains the epoch key only.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4081-pr.3431.894df59This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3431.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
…nt refs at #2960⑥ Review fix-up for the config-epoch guard: the staleEffectiveStamp docstring claimed the epoch hashes the resolved path (cross-instance stamps never validate), which contradicts the implementation (sha256 of file CONTENT — byte-identical files do validate, tests/config-epoch.test.ts case 4) and the configFileEpoch docstring. Also re-point the '#3430' references: that number is the unrelated vscode cancel-flake PR; the incident class is tracked as ⑥ on #2960.
Owner
Author
(ai: vllm-qwen/qwen3.8-27b) PR #3431(code epoch 拒绝过期 effectiveConfig stamp)审核完毕。结论:可合——原 head 结构化八问
独立验证(非照抄 PR 描述)
顺手修的注释缺陷(commit
查重结论(首条回复已给):不重复——本 issue 即 PR #3431 镜像,最近相关项 #2960⑥ 是本 PR 所修的事件记录。 |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.500-master.78d9e4a # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Every wire request stamps the session's resolved config snapshot (
metadata.effectiveConfig), but the stamp was only refreshed on the session's next wire request on the same instance. Consequences:/__bili/plugin/statuspanels, nudge re-anchor) executed settings the user had already deleted from the config file — the October incident: a user-disabledexternalSummarychain kept running for days off one old stamp.The fix
configFileEpoch()(src/config.ts): sha256 of the live config file content. Content-keyed on purpose — byte-identical files validate cross-instance (identical file tier ⇒ a foreign stamp is still a correct resolution), any edit diverges the hash. Cost mirrorsloadConfigFile()'s existing per-call read (page-cache hit).storeEffectiveConfigstampsmetadata.effectiveConfigEpochnext to the snapshot; forks inherit the key (plugin.ts copy list).effectiveConfigrefuses the snapshot when the epoch no longer matches the live file and re-resolves the file tier (globalcompress.*, includingexternalSummary) onto the fallback config. Provider/model cascade levels are deliberately NOT re-resolved (they need the request URL) — the session's next wire request re-stamps the full cascade./__bili/memory-family surfaces are untouched; only the stamp guard changed.Deliberate trade-off
When a stamp goes stale, provider/model-level compress overrides (routes in the config file) are dropped from the tool-path read until the next wire request re-stamps them — the live global tier is re-resolved, so a deleted chain stays deleted (the incident class this fixes) and a globally-configured knob keeps working. Losing a provider-scoped knob for one request window is strictly safer than executing retired settings.
Tests
tests/config-epoch.test.ts(5): same-source stamp wins; edited file refuses the stamp + re-resolves the live tier; retired externalSummary cannot ride a stale stamp (the incident, end-to-end shape); byte-identical file at a different path validates, diverged content refuses; legacy stamps (no epoch) keep old semantics.Fixes the incident class tracked as ⑥ on #2960.