fix(nudge): render distinct wording tiers for over-limit vs emergency bands (#312) - #315
Open
ranxianglei wants to merge 1 commit into
Open
ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)In your adapter project: npm install acp-kernel@pr-315Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf acp-kernel-pr315.tgz
npm install ./packageThis comment is automatically updated on each push. |
Owner
Author
[bot] 🏷 PR #315 复核完成(本 agent 处理 #312 时完成的 PR,未重做,拉分支逐行核对代码 + 本地复验 + CI 状态)。 CI 状态 ✅head commit 代码核对(8 文件,+135/-13,diff 干净、无跑题改动)
本地复验 ✅
PR 目前 behind master 但无冲突,GitHub 直接 merge(merge commit)即可,无需先 rebase;若想更干净也可先 rebase 再合,两种方式我都验证过。 一句话中文摘要修复了 nudge 文案在 usage≥0.75(maxContextLimitPct)就渲染 "Context limit reached" 的档位错位——新增 [0.75, 0.95) 压力档中间文案("Context pressure high")、emergency 档保留原话,voice/reason 与渲染档位一致、宿主行为零变化;CI 全绿、本地 typecheck/test/build 及 rebase 到 v0.0.74 复验全部通过,可以合并:https://github.com//pull/315 |
Owner
Author
|
继续 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #312
来源: ranxianglei/billion-context#847 (ranxianglei/billion-context#847) 分析 nudge 文案与阈值语义不一致 时发现
Problem
decideNudgehas three usage bands (gentle < maxContextLimitPct < over-limit < emergencyThresholdPct <= emergency), butrenderNudgeTextonly had two wording tiers:isEmergency = emergencyOverride || overLimit, so usage >= 0.75 rendered "In the #847 incident (usage 76% -> 89%, reason
OVER-LIMIT T1) the nudge kept shouting "limit reached" while valid pending targets existed, amplifying the model's overreaction.Fix (option (a): wording tiers)
isEmergency = !!emergencyOverridefromisOverLimit = isEmergency || !!overLimit.pressureHeader:⚠️ Context pressure high — compress now to stay under the limit. Prioritize consumed tool outputs.— used for [maxContextLimitPct, emergencyThresholdPct).[TIER N ... TRIGGER]/[OVER-LIMIT — TIER N ...] Context pressure high — distill now to reclaim tokens./[EMERGENCY — TIER N ...] Context limit reached — distill NOW ...(emergency line unchanged)."emergency"= pressure band or above) -> host behavior unchanged; reason labels untouched (already correctly tiered).pressureHeaderadded toNudgePromptSectionsandNUDGE_SECTION_KEYS(same tri-state semantics as existing keys).types.tscomment (emergencyThresholdPct "Default 0.98" -> 0.95); DESIGN-prompts.md synced.Option (b) (renaming config keys) rejected: breaking API change for adapters that read the current key names; the names themselves are unambiguous — the rendering was wrong.
Verification
npm run typecheckcleannpm test: 774/774 pass (new: pressure-tier unit tests, no-usage-% assertions, three-way trigger-line tests, pressureHeader tri-state override tests, byte-stability for the new mode, end-to-end processTurn at 80% -> "Context pressure high" and NOT "Context limit reached", at 96% -> "Context limit reached")npm run buildclean修复了 nudge 文案在 usage>=0.75(maxContextLimitPct) 就渲染 "Context limit reached" 的档位错位——新增压力档中间文案、emergency 档保留原话,voice/reason 与渲染档位一致,宿主行为零变化,可以合并。