Repository navigation
[PR] feat: hold growth nudges during tool bursts while context has headroom - #1491
ranxianglei wants to merge 5 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1741-pr.1491.5e56624This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1491.tgz
npm install -g packageInstall instructions are refreshed on each push. |
7ab5372 to
9f51975
Compare
[bot] 🏷 Review complete — mergeable once CI is green on the rebased head. Human merges (feat + config surface + default-on = human territory per §7.4). ① Original issue / direction (#1487) ✓ ② Regression audit — existing behaviors on touched paths, each checked against pre-PR code:
③ Code review
One semantic nuance (documented, not a defect): the kernel stamps ④ Test validity — ⑤ Diff cleanliness & actions taken
中文摘要:审查 PR#1491(burstHold 工具批量压缩暂缓)——方向符合 #1487 owner 决策;检测器语义已对照四条 wire codec 与内核 0.0.95 逐一验证,ceiling 数学保证压力带/紧急提示永不被挡;已 rebase 到最新 master(v0.1.160)无冲突,typecheck/tests 2921/build 全绿并推送了 rebase 分支,顺手补上了 PR 描述缺失的 config-surface 章节与触发器时序的精确说明——等 CI 在新 head 上转绿即可合并。 |
[bot] 🏷 Follow-up: CI on the rebased head 9f51975 is 13/13 green — full test matrix (ubuntu 22/24 + windows 22/24), e2e, hermetic registry e2e, and all real-client lanes (codex/opencode/pi/dsh) pass. All pre-flight conditions from my review are now met; ready for human merge. 中文摘要:rebase 后的新 head CI 全绿(13/13),审查结论不变——可以合并。 |
…1491) burst-hold.test.ts pins the gate itself; this pins the WIRING — one lane per protocol (anthropic / openai-chat / google / responses), steady alternation (share 0.5 < 0.55) must still inject the growth nudge while the same token mass in a parallel burst (10 results / 12-message window, share 0.83 >= 0.55, usage ~1% << ceiling) must hold it. Mutation-verified: dropping the holdGrowthNudge factor from any one handler reddens exactly that lane's burst case.
|
深审收尾:src 四轴(门逻辑/接线/配置面/文档)零缺陷,唯一缺口是测试只盖了 burst-hold 门本身(gate),四个
可合并。 |
…1491) burst-hold.test.ts pins the gate itself; this pins the WIRING — one lane per protocol (anthropic / openai-chat / google / responses), steady alternation (share 0.5 < 0.55) must still inject the growth nudge while the same token mass in a parallel burst (10 results / 12-message window, share 0.83 >= 0.55, usage ~1% << ceiling) must hold it. Mutation-verified: dropping the holdGrowthNudge factor from any one handler reddens exactly that lane's burst case.
4b739ab to
979b86d
Compare
…1491) burst-hold.test.ts pins the gate itself; this pins the WIRING — one lane per protocol (anthropic / openai-chat / google / responses), steady alternation (share 0.5 < 0.55) must still inject the growth nudge while the same token mass in a parallel burst (10 results / 12-message window, share 0.83 >= 0.55, usage ~1% << ceiling) must hold it. Mutation-verified: dropping the holdGrowthNudge factor from any one handler reddens exactly that lane's burst case.
979b86d to
6cd4b32
Compare
…1491) burst-hold.test.ts pins the gate itself; this pins the WIRING — one lane per protocol (anthropic / openai-chat / google / responses), steady alternation (share 0.5 < 0.55) must still inject the growth nudge while the same token mass in a parallel burst (10 results / 12-message window, share 0.83 >= 0.55, usage ~1% << ceiling) must hold it. Mutation-verified: dropping the holdGrowthNudge factor from any one handler reddens exactly that lane's burst case.
6cd4b32 to
ecb75bd
Compare
[bot] 🏷 独立复核完成——新测试提交验证通过,且分支已 rebase 到当前 master,CI 13/13 全绿、mergeable_state clean。合并仍由人来(系统规则禁止 agent 合并)。 ① 新测试
② master 在验证期间两次移动,已 rebase 收尾(热文件争用,§7.2)
结论:我上轮 review 指出的唯一缺口(四接线点无回归覆盖)已由有牙的变异敏感测试关闭,代码与行为结论不变。所有审查条件满足,可以合并——请 @ranxianglei 人工合并:#1491 中文摘要:独立复核了新增的四车道接线回归测试(含亲手拔门变异验证,咬合精确),并在 master 两度移动(web-UI 重写、strict-echo、chain-checkpoint)后完成两轮 rebase 与全量重验——最终 head ecb75bd CI 13/13 全绿、状态 clean,可以合并。 |
|
(ai: zhipuai-lb/glm-5.3) 陈旧票清理(第三批动作①):目标 issue #1487 已关。为避免重复劳动关闭本 PR;如判断有误请直接 reopen 并留言。 |
What
#1487: 检测到瞬间需要读大量文件的时候,瞬时放宽压缩.
New tool-burst nudge hold (
compress.burstHold, on by default): while the tail of the resent history is dominated by fresh tool results (the agent mid-batch of reads/greps/globs/bash calls) AND context usage is belowmin(0.7, effective maxContextLimitPct), the proxy holds the GROWTH-based nudge injection so the agent finishes its batch before its working content gets folded. Automates the remedy for the fold→re-read loop reported in #1198/#1277 (dsh discussion #5795) — no recent-zone pinning config needed.Design
src/burst-hold.ts): trailinglookbackMessageswindow (default 12); a burst =toolResults >= minToolResults(5) AND share>= minToolShare(0.55). Calibrated so steady assistant/tool alternation (~0.5 share) never trips while parallel batches (~0.8+) always trip.min(EMERGENCY_NUDGE_ESCALATION_PCT = 0.7, nudge.maxContextLimitPct)(kernel default 0.75). At or above it, nothing is ever held.(shouldInject && !holdGrowth) || emergencyNudge(...)— the kernel pressure-band force-nudge (usage ≥ maxContextLimitPct) and the host emergency nudge (≥ 0.7) always fire, so a context that runs out mid-burst still compresses immediately.compress.burstHold.{enabled,minToolResults,lookbackMessages,minToolShare}— three-level sub-field-wise merge likeabsorb; malformed values reject the whole compress block loudly (existing parse discipline).enabled: falserestores the legacy always-nudge behavior.HOLD T{n}, burst-hold(10/12,share=0.83)instead of INJECT when a growth nudge is held (0.1.69 回归: plugin 模式 nudge 注入被 !pluginMode 静默禁用 — INJECT 日志照打但从不投递, 自动压缩只剩 preflight 应急 #451 log-honesty class).Config surface
Adds one optional sub-object under the existing three-level
compresshierarchy:compress.burstHold.{enabled, minToolResults, lookbackMessages, minToolShare}(sub-field-wise deepest-wins merge, same pattern asabsorb/ccr/search). No new env vars or CLI flags; no existing field renamed or re-semantics'd.protectedTools,neverPreserveRecentTools,preserveRecentTools) or on fold thresholds (maxContextLimitPct,nudgeGrowthTokens). None gate when the proactive nudge fires based on what the agent is doing right now — 检测到瞬间需要读大量文件的时候,瞬时放宽压缩 #1487 is temporal ("let the running batch finish"), not spatial ("protect these results").preserveRecentTools: ["read"](the [Feature] Make the recent-zone tool exclusion (NEVER_PRESERVE_RECENT_TOOLS) configurable #1277 manual remedy) — pins specific tool names persistently instead of adapting to any tool burst; the owner generalized beyond read-family in the 检测到瞬间需要读大量文件的时候,瞬时放宽压缩 #1487 thread. (b)nudgeGrowthTokens— would stretch the cadence for ALL sessions, not just mid-burst ones. (c) providers table / env-var conventions — no temporal-trigger concept exists there.{enabled:true, minToolResults:5, lookbackMessages:12, minToolShare:0.55}per the 检测到瞬间需要读大量文件的时候,瞬时放宽压缩 #1487 owner decision;enabled:falserestores the legacy always-nudge behavior byte-for-byte (the hold term becomes a constant-false factor in the existing expression). Malformed values reject the wholecompressblock loudly (existing parse discipline).⚠ Behavior change (intended — #1487 owner decision)
lastNudgeShownTokensadvances even when the host suppresses the text), so a held trigger is consumed — after the burst ends, the next proactive nudge lands at the kernel's next growth-cadence boundary rather than immediately. Deferral is bounded either way: usage reaching min(0.7, maxContextLimitPct) forces compression through the host-emergency / kernel-pressure-band paths. Pressure/emergency nudges unchanged.Pre-flight
tests/burst-hold.test.ts(14 tests): detector calibration (steady alternation must NOT trip), ceiling math, hold decision matrix, sub-field merge precedence, parser validation rejects.src/server.ts.中文摘要:新增工具批量调用期间的增长型压缩提示暂缓(burstHold,默认开)——agent 批量干活且上下文用量低于 min(0.7, maxContextLimit) 时先让它干完再压,压力带/紧急提示不受影响。
Closes #1487