Repository navigation
[PR] fix: annotate the output-headroom effective window on every denominator surface - #4138
ranxianglei wants to merge 2 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g [email protected]This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4138.tgz
npm install -g packageInstall instructions are refreshed on each push. |
57fc8b5 to
cfb2ef1
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 与 output-headroom 家族的在途/已关条目机制不同——#4236/#4198/#4184 改的是「预留多少」的计算(且 #4184 已被 revert),#3328 钉的是判压分母本身,#3850 只改 标签: bug / dsh / scope/ui / p3(纯展示面澄清缺陷,无功能影响,沿用 #4130 定级) 审核进行中,先报状态:
CI 出新 head 结果后我按八问体例给最终结论。 |
…or surface (#4130) The compression engine judges against the effective window (declared window minus the output-headroom reservation, #896), but every persistent display surface showed that denominator bare — a 200K model judging at 150K read as a misidentified window (three rounds of misdiagnosis in the field, #4130). handle() now records the declared pre-reservation window in session.metadata.outputHeadroomBase (cleared when no reservation is active, so a model/protocol switch never shows a stale note); one writer, all modes. The surfaces annotate from that single source: - nudge log line: usage=44% (65256/150000, window 200000 − output reserve 50000) - /acp panel: before-footer line 'Window: judging against 150K effective (200K declared − 50K output reserve)' + additive contextWindowBase JSON field - Web UI session bar: sub-line 'window 200K − output reserve 50K' (+ zh/en i18n) - session report MD/SVG: same note after the context fraction - admin stats JSON: additive contextWindowBase Display-only: the kernel keeps judging against the effective value; no config surface added, no behavior change to compression.
cfb2ef1 to
1d77e5a
Compare
#4393 added a second top-level concurrency: block without noticing the owner-approved one already present further down (skip-scoped labeled runs, schedule-safe cancel-in-progress). The duplicate key makes the file fail GitHub's parser ('concurrency' is already defined), so NO main-CI run starts on any branch or on master since the merge — zero workflow runs on master commit 970bd4d. The pre-existing block already delivers #4393's goal (same-ref supersede cancellation), so the redundant block goes.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 中途更新:发现并顺手修掉一个刚合入 master 的 CI 回归(#4393 遗留),本 PR 已带上修复 commit,等 CI 出全量结论后发八问收尾。 发现了什么:#4393(ci-concurrency-dedup,今天合入 master)在 怎么修的:本分支新增独立标注 commit 当前状态:PR 头 |
Closes #4130
What was wrong
The compression engine judges against the effective window (declared window − output-headroom reservation, #896/#2096), but every persistent display surface showed that denominator bare. A 200K model judging at 150K read as a misidentified window — three rounds of misdiagnosis in the field before the relationship between the card's 200K, the
[window] base=200000line and the panel's 150K could be established from a one-shot deduped[headroom]log line nobody had noticed.Fix (display-only, single source of truth)
handle()records the declared pre-reservation window insession.metadata.outputHeadroomBaseat the same instant it writeseffectiveContextLimit(one writer, all modes); it clears the field whenever no reservation is active, so a model/protocol switch never shows a stale annotation. Every surface annotates from that field:usage=44% (65256/150000)usage=44% (65256/150000, window 200000 − output reserve 50000)Context (...): 45% (89K / 150K)Window: judging against 150K effective (200K declared − 50K output reserve)(human-only slot, LLM-context stripper unaffected)89K / 150K (45%)窗口 200K − 输出预留 50K(zh/en i18n)- context: 89K / 150K (45%)(window 200K − output reserve 50K)notecontextWindowBaseon/__bili/plugin/statusand admin session statsThe denominators themselves are unchanged — they ARE the values the kernel judges against; only the relationship to the declared window becomes visible.
Behavior changes (disclosed)
contextWindowBase, null/absent when no reservation).reserveOutputHeadroom, the nudge/preflight math, the outgoing max_tokens clamp (plugin mode: no hard backstop when the agent ignores the compress nudge — context grows past the window and upstream 400s #453 guarantee) and the kernel are all untouched.Config surface
None added, renamed or re-semantics'd.
compress.outputHeadroomMaxPctkeeps its existing meaning; this PR only makes its effect visible.Tests
New
tests/issue4130-headroom-denominator.test.ts(reuses the #2096 hermetic harness):outputHeadroomBaseguard rejects non-number/NaN/missing;contextWindow: 75000, contextWindowBase: 100000), a reservation-less request on the same session clears both (stale-annotation regression pin).Local verification on rebased head: typecheck clean; targeted suites green (issue4130, session-report, web-sessions, issue2096-clamp-headroom-window, headroom-output-fallback — 49/49). Full-suite verdict from CI.