Repository navigation
fix(#2029): status readers share provenance-aware input baseline - #2056
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2099-pr.2056.2e603faThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2056.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #2056 审查结论 — 方向正确,实现与 owner 裁决逐条吻合,独立复核全部通过。可合。 独立验证(全部在 PR head
逐关审查:
结构化七问:
review 未发现需顺手修的小问题;范围外无新发现,不立项。 判定:满足 §7.4 auto-merge 标准(单机制 scoped fix、A/B 回归测试钉住原始 bug、CI 15/15 绿、无 config/persistence/wire/cross-repo 变更、纯 fix、diff 干净、Closes #2029、不触 load-bearing infra)。唯一程序性事项:head 落后 master 2 个版本-only 提交(零文件重叠,无冲突)——建议 rebase 到 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.22-master.3a9ec22 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2029
Implements the owner-ruling scope from the #2029 thread (post-#2032 closure; #2032 not revived).
Change
New shared helper
statusInputBaseline(session)in src/session.ts (beside the other session-stat helpers):lastInputTokensSource"usage" or bounded "overflow-arm" →lastInputTokensverbatim (including 0 after credit adjustments drained it)lastUsageGradeTokens([OpenCode v2] Configured model context limit never reaches the proxy (x-bili-plugin-context-window not stamped) - silent registry-peek fallback suppresses proactive nudge and misfires emergency shrink #1569)Wired into all four status-side readers:
src/acp-status.ts— handleAcpStatus nudge recomputesrc/plugin.ts— handlePluginStatus live-nudge recomputesrc/plugin.ts— buildStatusPanel tokenCountsrc/stream.ts— postCompressTail recompute (evidence below)Deliberately NOT touched (per ruling): plugin JSON
contextTokens/contextTokensSource(#2017 merged observation contract — unknown is explicit null/"unavailable" there), failure arms, compression credits, wire bytes, configuration, persistence schema, accumulated billing, and the main request path (effectiveTokenCountunchanged).Why postCompressTail is included (and its test companions)
Behavioral verification was recorded in the #2029 thread before wiring:
bestPending >= minPressureBenefit, which a drained state cannot satisfy, so the stop signal fires under both baselines.Test companions per ruling item 3:
tests/compress-success-tail.test.tscase 3 (compress 成功输出缺剩余范围快照与停止提示(pi 侧 #420/#521 对齐) #1387 tier-suppression contract): fixture stats now stamplastInputTokensSource: "usage"so the contract pins REAL over-limit suppression instead of relying on legacy-shape luck (unflagged values now fall back to anchor/unknown).Behavior changes (old → new)
Verification
tests/issue2029-status-baseline-provenance.test.ts(3 tests / 8-scenario matrix incl. credit-adjusted and trusted-drained-to-zero edges): unit provenance table; acp_status + plugin surfaces assert the EXACT tokenCount handed to processTurn (wrapped core, deepEqual), panel Context-line rendering, and stats/state read-only snapshots before/after each callConfig surface: none added (no new env/config/default values).