Repository navigation
fix: narrow dsh-context host-plugin notice to segment composition/timeline (#3303) - #3312
Conversation
…eline (#3303) #3303 measured (real session, same-instant three-way comparison) that dsh-context's headline "current context" size equals bili's contextTokens — it is anchored on provider usage, not the lossless local log. Only its per-segment composition / timeline derives from the local store, so under active compression the SPLIT (not the headline size) is the pre-compression distribution. The #2865 notice claimed every displayed figure was inaccurate, making users chase a size deviation that does not exist. Scope the notice text plus the module/entry comments to what actually holds: the segment composition / timeline is a pre-compression estimate, the headline tracks the real sent volume, authoritative size via /acp or contextTokens. Add a regression test pinning the narrowed scope.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3862-pr.3312.e000585This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3312.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 本 PR 是 #3303(host-plugin notice 文案过宽)的直接修复;检索 open+closed 相关条目只有原功能 #2861/#2865(引入该 notice)与外部 dsh-context#138/#143(已关闭、方向相反/机制不同),无其他同症状+同机制的在途条目。 本条是 [PR] 唤醒(正文带 ework-agent-pr 标记),对应 PR #3312 —— 前一会话已完成开发并在 #3303 侧给出八问结论。按规范不重做,改为独立 PR 审核:拉分支核对代码、回归审查、测试有效性、diff 整洁度、CI 状态,审完按结构化八问回复。 审核起步事实:分支 |
(ai: vllm-qwen/qwen3.8-27b) 独立 review 结论。声明独立性:以下结论全部由本审核自己产出——逐文件通读了 PR 分支上的三个改动文件、本地重跑了目标测试套件、并把 CI 失败签名与 master 同 base 的 job log 逐一比对过;没有复制 #3303 侧已给出的分析或八问作为审核依据(#3303 只作需求背景读)。 结构化八问
行为变更披露(与 PR 描述一致,我逐字对照 diff 核实过 old→new 无误):
测试有效性:新测试是真测试——直接断言"zh 不得再含『数值不准确』/ en 不得再匹配 not accurate|inaccurate"(旧文案回归立刻变红)+ "必须含分段/构成类 scoping 词"。它钉的是性质而非精确句子,对措辞类修正是对的粒度;配合既有 17 条检测/渲染/dismiss 测试,行为面全覆盖。 diff 整洁度:3 文件 28+/13-,每一行都服务于收窄措辞这一个目的;无无关改动、无空行 churn、无生成物混入。代码整洁硬标准逐项过:无死代码、无重复、注释与实测事实一致且带 #3303 出处、风格与仓库一致。 CI 状态(关键):PR head 上 9/12 test 分片红——不由本 PR 引起。证据链:① 抽样的失败 job log(PR head 与 master @ 同 base 6ee4a2a 各一份)失败测试名完全相同,均为 合并判定:代码层面可合——方向正确(修的是措辞过度断言这一根因而非症状)、无回归、测试有牙、diff 干净;当前 blocked 完全来自已知的存量 storage-render golden 红风暴。建议等 #3314(或等价 rebaseline)落地、分片转绿后再合并,或由你拍板是否先行合并。按 red-storm 防线纪律我不另开重复的修复 issue/PR(已有 #3313/#3314 跟踪)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.473-master.00ea555 # this exact build
npm install -g billion-context@master # always the newest merged build
|
…3312-#3320 batch) - keep #3298 changes on master's post-absorb shapes: relay round-2 rebuild and all four prepare* paths keep withProjectAttribution; absorb imports/ sections dropped with #3309 - storage-render goldens: metadata-section drift after the merge (absorb fields gone from session metadata) — regenerated via scripts/update-storage-render-goldens.ts, wire-body sections unchanged
Fixes #3303
What & why
The host-plugin notice introduced by #2865 told users dsh-context's "displayed/recorded context figures are the pre-compression local meter … so they are not accurate". #3303 measured a real session at the same instant and showed this overreaches: dsh-context's headline "current context" size equals bili's
contextTokens— it is anchored on provider usage (last.prompt + Δtotal), not the lossless local log. Only its per-segment composition / timeline derives from the local store (folds happen outside the DSH event stream,storage: shadow, so dsh-context'smt()never fires). The old notice made users chase a size deviation that does not exist.This narrows the notice to the range where it actually holds.
Behavior change (disclosed)
Web-UI dsh-context notice text, old → new:
The authoritative-size hint line (
/acporcontextTokens) is unchanged and remains the escape hatch. Wording/scope change only — no detection, rendering, or dismiss logic touched.Scope
src/web/i18n.ts— zh + enhostplug.descnarrowed.src/host-plugin-notice.ts— two comments corrected to match the measured fact (split is pre-compression; headline is usage-anchored). Comment-only.tests/issue2861-host-plugin-notice.test.ts— regression test pinning the narrowed scope.Detection logic, rendering, dismiss endpoint, and the i18n key set are untouched.
CLIENTS.md's #2854 general-principle doc is intentionally left as-is: it states a general property of log-derived meters, and dsh-context's usage-anchored headline is the exception, not a refutation.Out of scope (issue item 2, optional)
Emitting
compaction/summaryinto the host event stream on fold is deliberately not done: it would have bili inject synthetic events into dsh's log semantics, crossing the shadow-storage boundary ("bili never writes the host session log"). It mirrors dsh-context#143 refusing to read bili routes. Recorded as a decision point in the thread; if pursued it warrants its own issue + design review rather than riding in this bugfix.Verification
dist-import-annotations: OK).tests/issue2861-host-plugin-notice.test.ts: 18/18 pass.