Repository navigation
[PR] feat: configurable escalation nudge line (compress.nudgeEscalationPct) - #5270
ranxianglei wants to merge 4 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10903-pr.5270.5dd841dThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5270.tgz
npm install -g packageInstall instructions are refreshed on each push. |
aeac710 to
895c571
Compare
(ai: vllm-qwen/qwen3.8-27b) Conflict-rebase done. The PR branch What happened this run:
Verification on the pushed head:
Live status (verified this run, not from memory): mirror cache shows sha 八问
判定:冲突已全部解除(mirror 实测 |
(ai: vllm-qwen/qwen3.8-27b) No action needed this run — the blocker notification was based on a stale snapshot. I re-verified everything against live sources before touching anything:
So the conflict-resolution work from my previous run stands complete and verified end-to-end. I deliberately did NOT re-rebase or force-push again — the branch is clean against current master and pushing again would be pure churn. 八问
判定:冲突已解除 + CI 全绿(实测),无待办;待 owner 验收合并。若后续 master 再前进引发新冲突,下一轮触发时我会重新 rebase。 |
[ework] auto-fix stalled: test (ubuntu-latest, 22, 3), test (ubuntu-latest, 24, 1), test (windows-latest, 22, 4), test (windows-latest, 22, 2), test (ubuntu-latest, 24, 3), test (ubuntu-latest, 24, 2), test (windows-latest, 22, 1), test (ubuntu-latest, 22, 2), test (ubuntu-latest, 22, 1) — stopping for human review |
(ai: vllm-qwen/qwen3.8-27b) Same stale blocker notification, third time — still verified clean, no action taken. Live checks this run: branch head |
[ework] auto-fix stalled: test (ubuntu-latest, 22, 3), test (ubuntu-latest, 24, 1), test (windows-latest, 22, 4), test (windows-latest, 22, 2), test (ubuntu-latest, 24, 3), test (ubuntu-latest, 24, 2), test (windows-latest, 22, 1), test (ubuntu-latest, 22, 2), test (ubuntu-latest, 22, 1) — stopping for human review |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Review verdict: APPROVE (posted as a comment — the API refuses a formal approve event on a self-authored PR; feat-class merges are human-only per §7.4 regardless) — clean, well-scoped, default behavior byte-identical.
What I verified:
- Full path wiring.
compress.nudgeEscalationPct->parseCompressSettings(numberOrPercent validation, src/config.ts) ->mergeCompressdeepest-wins pick (src/compress-settings.ts:74) ->applyCompressSettingsmapsparsePercent(v)onto the host-onlyResolvedKernelConfigrail (src/compress-settings.ts:407) ->resolveRequestConfigcarries it (hasCompressSettingsuses the generic Object.values check, so a single-field config still resolves — no early-return trap) ->ccrLoopConfigshallow-spread keeps it ->resolveNudgeEscalationPct(src/server/budget.ts:65-74) returns the value iff finite and > 0, else the exact 0.7 constant. ALL FIVE evaluation points pass it in: the four lanes'emergencyPressureHeldcall sites plusemergencyNudgeArmed's inner call via the new optional param; grep-verified no hardcoded 0.7 remains anywhere. - Default path byte-identical. Unset -> resolver returns exactly the
EMERGENCY_NUDGE_ESCALATION_PCTconstant, the same value the old default parameter produced. KDD #8 cadence untouched; the field never reaches the kernel (host-only rail, same pattern as preserveRecentTools/externalSummary); both compression modes share this lane code, so both are covered. - Tests are real, not tautological. Two-direction fire-line assertions (usage 0.75 fires under the default 0.7 line, silent under raised 0.85, fires at 0.9), full fallback matrix (absent/null/{}/0/-0.5/NaN/string -> 0.7), percent-string parse, three-level merge, rail carry-through. Re-hardcoding 0.7 or drifting the default would break them.
- House conventions. en+zh configuration.md parity, website seed + regenerated artifacts (I re-ran gen-config-docs: idempotent clean diff), config-surface-guard green, Config-surface section present in the PR body with sign-off basis. No version bump, no kernel/, no wire or persistence-format change.
- CI (mirror cache @ 895c571): 30 checks — 16 success + 14 skipped, 0 failed.
已顺手修:source-issue refs pointed at #5232 — an UNRELATED open PR that the Closes keyword would have auto-closed on merge. Repointed everything to the true source issue #5230 (its suggestion 1 names this field verbatim; its thread names this PR as the knob fix): test file renamed per the name-after-GitHub-issue-number convention, code/doc comments, website seed + regenerated artifacts, and the PR body (incl. the Closes line). Commit fcb969b pushed to the branch; CI re-runs on the new head.
Note for the human merging: #5230's other suggestions (output-headroom default move, panel/acp_status visibility) were deliberately scoped out per that thread. If you want #5230 kept open until those land, drop the closing keyword before merge; the body now says "Closes #5230" per house form because the thread frames the configurability core as resolved by this PR.
八问(中文)
- 是什么问题:宿主侧升级提醒线(escalation nudge line)硬编码在 0.7,没有配置面,想调只能改打包产物。
- 什么原因导致的:这条线是宿主侧独立于内核节奏的触发线,历史上直接写成常量
EMERGENCY_NUDGE_ESCALATION_PCT,从未接入配置系统。 - 影响范围与严重程度:体验瑕疵——功能可用、默认行为正确,但大窗口用户无法把触发线上移;无数据/安全风险。
- 怎么修复的:新增可选字段
compress.nudgeEscalationPct(number|"N%"),走既有 compress 三级合并(global→provider→model,逐字段最深优先),经 ResolvedKernelConfig 宿主侧轨道传到全部 5 个求值点;缺省或非正值回落到原 0.7 常量,默认路径逐字节不变。 - 是否有回归问题:逐项审过——默认 0.7 路径(resolver 回落值 = 旧默认参数值)、内核 nudge 节奏(KDD #8 未动)、两种压缩模式(共用同一 lane 代码)、wire/persistence(字段仅宿主侧、不下发内核)、单字段配置解析(hasCompressSettings 通用检查,无早退陷阱)。均保持,无意回归。
- 是否破坏缓存:不涉及——纯请求内决策参数,不碰缓存/重试/游标/去重键。
- 是否改了设计方向:不涉及——沿用既有配置层级与 rail 传递模式(与 preserveRecentTools/externalSummary 同型),无架构变化。
- 是否引入了新的配置:是。新 key
compress.nudgeEscalationPct,类型 number|"N%",默认 0.7(与旧硬编码一致);可完全缺省,既有配置零迁移;按 #2030 纪律不新增 env 变量。
判定:可合(feat 类 → 按 §7.4 由人工合并)。
(ai: vllm-qwen/qwen3.8-27b) Review done → APPROVE (posted as a review comment on the PR — the API refuses a formal approve event on a self-authored PR; feat-class merges are human-only per §7.4 anyway). Full verification + Chinese 8-question checklist are in that comment. 已顺手修:source-issue refs pointed at #5232 — an UNRELATED open PR the Closes keyword would have auto-closed on merge; repointed all in-repo refs, the test filename, and the PR body to the true source issue #5230 + commit fcb969b (pushed to the branch, CI re-runs on the new head). |
[ework] auto-fix stalled: test (ubuntu-latest, 22, 3), test (ubuntu-latest, 24, 1), test (windows-latest, 22, 4), test (windows-latest, 22, 2), test (ubuntu-latest, 24, 3), test (ubuntu-latest, 24, 2), test (windows-latest, 22, 1), test (ubuntu-latest, 22, 2), test (ubuntu-latest, 22, 1) — stopping for human review |
(ai: vllm-qwen/qwen3.8-27b) Another stale "dirty" trigger — live state shows NO conflict. Verified this run against live sources:
No action taken: rebasing 13 commits of unrelated master movement would be pure churn and would rewrite the freshly-pushed fix-up commit; the PR merges cleanly as-is. Ready for owner merge whenever you get to it. If master moves again in a way that actually conflicts, the next real trigger will get a full rebase run like before. |
[ework] auto-fix stalled: test (ubuntu-latest, 22, 3), test (ubuntu-latest, 24, 1), test (windows-latest, 22, 4), test (windows-latest, 22, 2), test (ubuntu-latest, 24, 3), test (ubuntu-latest, 24, 2), test (windows-latest, 22, 1), test (ubuntu-latest, 22, 2), test (ubuntu-latest, 22, 1) — stopping for human review |
…scalationPct The host-side escalation-nudge line was hardcoded at EMERGENCY_NUDGE_ESCALATION_PCT (0.7) with no config surface (#5232). Add compress.nudgeEscalationPct (ratio or N%), deepest-wins across global/provider/model, riding the host-only ResolvedKernelConfig rail to all four prepare call sites; absent or non-positive values keep the 0.7 default byte-for-byte. Documented in CONFIGURATION.md (en+zh); adds tests/issue5232-nudge-escalation-pct.test.ts. Closes #5232
…te web docs The nudge-escalation commit hand-inserted its CONFIGURATION*.md table row without touching the YAML single source, so config-surface-guard flagged compress.nudgeEscalationPct as undocumented and docs-sync drifted on website/main.js + website/docs/index.html (never regenerated). Add the seed entry to website/config-reference/compress.yaml and regenerate the generator-owned artifacts. Docs-only; no code or behavior change. #5232
Review fix: the source issue for this knob is #5230 (its suggestion 1 names compress.nudgeEscalationPct verbatim; its thread names this PR as the fix). name-after-GitHub-issue-number convention, repoints code/doc comments and the website seed text, regenerates the website artifacts. No logic change.
fcb969b to
24fceb8
Compare
(ai: vllm-qwen/qwen3.8-27b) Conflict-rebase done — this time the conflict was real. Master had moved 630 commits since my last rebase and genuinely conflicted with the PR. Rebased onto current master What happened this run:
Verification on the pushed head:
Live status (verified this run): mirror shows sha 八问
判定:冲突已全部解除(mirror 实测 |
The declaration was 4-space indented while its surrounding block is 8-space (prepare-anthropic/google/openai/responses). Whitespace-only, no semantic change.
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Round-2 review — rebased head: APPROVE (posted as a comment: the platform blocks approving one's own PR; same as round 1).
Re-verified end-to-end after the 2026-11-18 conflict-rebase onto master a446a3c1 (head 24fceb819e):
- Content unchanged from round 1. Sorted +/− line-set diff of the PR diff against the old base (
dc041dd1) vs the new base (a446a3c1): only 4 rebase-artifact lines — thedesc_jaline inwebsite/config-reference/compress.yaml(faithful ja translation of the en/zh text), thedocs/configuration.ja.mdrow, and theprepare-*.tsimport lines that now also carry master'soutputBudgetField/readOutputBudget/writeOutputBudget. All 14 files, +138/−16. No semantic drift. - Round-1 fix intact. Zero
#5232refs on the new head; all#5230refs intact (src/compress-settings.ts:1, src/config.ts:1, src/server/budget.ts:2, tests/issue5230-nudge-escalation-pct.test.ts:7, website/config-reference/compress.yaml:2). PR body stillCloses #5230(3 refs, 0 stray). - CI green on
24fceb819e. 52 check runs, all completed: 38 success + 14 skipped, 0 failed (mirror cache was 8h stale mid-run; verified via a single one-shot check-runs fetch for the head sha, no polling). - Merge state.
mergeable: True, based exactly on current master (merge-base = origin/master). - Scope unchanged. No
kernel/, noversionbump, no config surface beyond the one field declared in round 1. Default behavior byte-identical (unset → exact 0.7 constant = old default param).
One small finding, fixed on the spot: the const nudgeEscalationPct = resolveNudgeEscalationPct(loopConfig); declaration was 4-space indented while its surrounding block is 8-space, in all four lanes (src/server/prepare-anthropic.ts:317, src/server/prepare-google.ts:167, src/server/prepare-openai.ts:250, src/server/prepare-responses.ts:294). Pre-existing from the original PR, not a rebase artifact. Whitespace-only fix pushed as 3555245e14 (new head); CI re-running on it.
8问(中文,供人工复核)
- 是什么问题:升级 nudge 线(usage 越过多少比例后,即使 kernel 周期沉默也注入压缩 nudge)此前硬编码 0.7、不可配置;本 PR 增加
compress.nudgeEscalationPct配置项。 - 什么原因导致的:
emergencyNudge的触发比例是写死的常量EMERGENCY_NUDGE_ESCALATION_PCT = 0.7,配置层没有对应字段。 - 影响范围与严重程度:仅影响想在这条线上偏离 0.7 的用户;默认行为逐字节不变(未设置 → 精确 0.7 常量 = 旧默认参数),无回归面。
- 怎么修复的:配置字段(number 或 "N%")经 parseCompressSettings → mergeCompress(global→provider→model 最深胜出)→ applyCompressSettings 映射到 ResolvedKernelConfig 的 rail(host-only,从不发给 kernel);消费端
resolveNudgeEscalationPct对非法值(非 number / 非有限 / ≤0)回退 0.7 常量;5 个求值点(4 条 lane 的emergencyPressureHeld+emergencyNudge内层经emergencyNudgeArmed)全部接线。 - 是否有回归问题:审过既有行为——默认路径逐字节不变;KDD #8 的 50K 周期不变;旧 kernel 忽略多余 rail key(与 preserveRecentTools/externalSummary 先例一致);plugin/proxy 两种压缩模式共用 lane 代码,两侧一致。无回归。
- 是否破坏缓存:不涉及——不触碰缓存/重试/游标/去重键。
- 是否改了设计方向:不涉及——纯配置面扩展,复用既有 compress 配置层级。
- 是否引入了新的配置:是——
compress.nudgeEscalationPct,number 或 "N%" 字符串,默认 0.7(等效未设置),host-only;已按规范在 docs/configuration.md(en/zh/ja)+ website config-reference(en/zh/ja)声明。
判定:可合(feat 类按 §7.4 走人工合并;merge 会经 Closes #5230 自动关闭源 issue)。
Round-2 review complete — APPROVE (posted to GitHub PR #5270 as review comment 5966155776; the platform blocks a formal self-approve, same as round 1). What changed since round 1: the branch was rebased onto current master Re-verification:
Small finding, fixed on the spot: the Verdict: APPROVE — mergeable once CI is green on 8问(中文)
判定:可合(CI 在 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Round-3 confirmation — head 3555245e14: APPROVE stands.
This head is the round-2-reviewed 24fceb819e plus the whitespace-only indent fix I pushed in round 2. Verified the delta is exactly 4 lines (one per lane: src/server/prepare-anthropic.ts, prepare-google.ts, prepare-openai.ts, prepare-responses.ts — const nudgeEscalationPct = resolveNudgeEscalationPct(loopConfig); re-indented 4→8 spaces to match its block); git diff -w 24fceb819e..3555245e14 is empty, i.e. zero non-whitespace change. No new findings; nothing to fix.
CI on 3555245e14 (mirror cache): 0 failed so far — 5 success + 13 skipped completed, 10 in progress + 2 queued (test shards). The base head 24fceb819e was fully green (52/52: 38 success + 14 skipped), so this run is the formality over a whitespace-only delta.
8问(中文)
- 是什么问题:同 round-2——升级 nudge 线硬编码 0.7 不可配置,本 PR 增加
compress.nudgeEscalationPct。 - 什么原因导致的:触发比例是写死常量
EMERGENCY_NUDGE_ESCALATION_PCT = 0.7,配置层无对应字段。 - 影响范围与严重程度:仅影响想偏离 0.7 的用户;默认行为逐字节不变,无回归面。
- 怎么修复的:配置字段经 parseCompressSettings → mergeCompress(最深胜出)→ applyCompressSettings 映射到 ResolvedKernelConfig rail(host-only);消费端非法值回退 0.7 常量;5 个求值点全部接线。
- 是否有回归问题:无——本 head 相对已审 head 仅 4 行空白(
git diff -w为空),语义零变化;round-2 的既有行为清点(默认路径逐字节不变、KDD #8 周期不变、旧 kernel 忽略多余 rail key、双压缩模式一致)继续成立。 - 是否破坏缓存:不涉及。
- 是否改了设计方向:不涉及。
- 是否引入了新的配置:是——
compress.nudgeEscalationPct(number 或 "N%",默认 0.7,host-only),已在 docs(en/zh/ja)+ website config-reference(en/zh/ja)声明。
判定:可合(CI 在 3555245e14 上转绿后;feat 类走人工合并,merge 经 Closes #5230 自动关闭源 issue)。
Round-3 review complete — APPROVE stands (posted to GitHub PR #5270 as review comment 5966361150). The new head CI on Verdict: APPROVE — mergeable once CI is green on 8问(中文)
判定:可合(CI 在 |
What & why
The host-side escalation nudge line was hardcoded at
EMERGENCY_NUDGE_ESCALATION_PCT(0.7) with no config surface (#5230). Once context usage crossed 70% of the effective window, a compression nudge fired even while the kernel's own cadence stayed silent — and the only way to move that line was to sed the built bundle. This makes it configurable.Config surface
New field:
compress.nudgeEscalationPctnumber | "N%"— ratio (0.85) or percent string ("85%").0.7— unchanged. Absent or non-positive values keep the previous hardcoded behavior byte-for-byte.ResolvedKernelConfigrail and is never sent to the kernel (no kernel field, no wire/message-shape change).maxContextLimitis the forced band (kernel fieldnudge.maxContextLimitPct). This is the separate host-side escalation line below it, which fires while the kernel cadence is still silent. No existing knob mapped to that specific line.maxContextLimit, the kernel pressure band fires first at its lower line, so this one never arms.Behavior change
None by default. With the default
0.7, every request resolves the identical line as before; only an explicitcompress.nudgeEscalationPctmoves the fire line. No kernel change, no wire change, no persistence-format change.Tests
tests/issue5230-nudge-escalation-pct.test.ts: resolver fallbacks, percent-string parse, three-level merge, end-to-end rail carry-through, and the user's exact scenario (usage 0.75 fires under default 0.7 but stays silent under raised 0.85).Closes #5230