Repository navigation
fix: stop advertising DEAD refs in the nudge decision directive and /acp panel (#3204) - #3213
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3693-pr.3213.24df40aThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3213.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(bot) (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 —— 这是 #3195 的指定续作,不是并行重复工作:
开始独立审核:拉取分支核对 diff、验证「与 #3195 逐字节相同」声明、检查测试有效性、看 CI。结论稍后按八问体例给出。 |
…3204 third line) Review of #3213 found a third production line of the same #3192 root mechanism this PR's scope missed: the default prose nudge (useDecide=false, i.e. nudgeModelDecided off) renders formatRanges(turn.nudge.compressibleRanges) straight into the injected nudge text, and formatRanges merges positionally adjacent ranges across missing slots — so a dropped middle message's span gets bridged into one big span bracketing the dead ref (reproduced: m0001–m0030 bracketing dead m00015). - Consolidate the dead-filter at each lane's early top mutation point (viable -> excludeDeadRefRanges), ahead of every consumer: decision prompt+directive, prose nudge, emergency override, preflight length gates. Removes the now-redundant per-decide wrappers from this PR's first commit. - Behavior change (disclosed): when ALL candidates are dead, emergencyNudge override and the server immediate-forward / preflight empty-ranges gates now see an honestly-empty set and refuse/forward instead of proceeding into doomed folds. Decision-directive and panel semantics unchanged from the first commit. - Test: new e2e scenario drives the default prose path through the real pipeline; red without the fix (post-drop nudge offered m0001–m0030), green with it.
(ai: vllm-qwen/qwen3.8-27b) 审核结论:方向正确、与 #3195 分工干净、合并顺序声明成立;但审核中发现同机制的第三条产线(默认 prose nudge),已在 PR 分支补一个标注 commit( 八问:
合并顺序验证:pr3195 ↔ pr3213 双向模拟合并(merge-base = 当前 master CI 状态(重要):两个 head 目前都红,但失败全部来自既有的 #3212 CI 端口区红风暴(已有跟踪;PR #3215 的 test-only 修复在途、其自身 CI 全绿):zone-live / performSelfRestart(#3044)×4、hook e2e pinned-port(#2877 attachPolicy 翻转的过期断言)×2——失败测试与本 PR 管线零交集。每个 head 另有一个独立单腿 flake(旧 head:error-delivery proxy-openai-sse ×1,发生在不含我任何提交的原始 head 上;新 head:plugin-terminal-usage ×4,本地定向跑 9/9 全绿)——均与本 diff 无关。按红风暴防线规则不重复立项,#3212/#3215 已覆盖。 收工判定:代码就绪可合——方向、分工、实现、测试均成立;CI 门禁当前被无关的 #3212 红风暴挡住,#3215 落地后自然转绿(或请求重跑)。合并请你操作:#3213 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.438-master.c37ad25 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #3204
是什么
#3195 把「失败回执 / acp_status / post-compress tail」三条面的 DEAD-ref 过滤补上了,但还有两条产线拿同一份未过滤的
nudge.compressibleRanges对外宣称(同 #3192 根因:资格视图不消费state.deadRefs):compress.nudgeModelDecided=true,opt-in):决策提示词把可压缩 span 列表直接发给模型,模型答 yes 后注入的指令是命令式的("Call your compress tool on exactly this span")。列表里罩着 DEAD ref 的 span 被照做必被闸门拒收(cannot be anchored),白烧一次 compress 调用并累加 breaker 连续失败计数;nudge arm 反复触发时反复踩同一个坑。compressibleRanges字段 + 面板文本里的 span 列表):读同一份 live processTurn 结果、无 dead 过滤。fix: stop advertising DEAD refs as compressible in receipts and acp_status #3195 合并后acp_status工具输出不再列这类 span 而面板还列——两个面重新分裂(Compression failure recovery hints advertise protected or already covered refs as immediately compressible #2778 要消灭的那类不一致)。怎么修
复用 #3195 已落的
excludeDeadRefRanges()(src/acp-status.ts):excludeDeadRefRanges(turn.nudge.compressibleRanges ?? [], session.state.deadRefs)(openai / anthropic / google / responses);src/plugin.ts在 live 重算得到nudge后对其compressibleRanges包一层——一个过滤点同时覆盖面板文本(内核buildStatusPanel)与 JSON 字段,两面不可能再分叉。纯宿主侧;无配置面变更;无 kernel 变更。
与 #3195 的关系(合并顺序说明)
本 PR 的
excludeDeadRefRanges与 #3195 加入src/acp-status.ts的同名函数逐字节相同(同位置、同注释)。两个 PR 谁先合入,另一个合并时 git identical-hunk 自动收敛为单份拷贝,无重复、无冲突。行为变更披露
nudgeModelDecided=true会话):罩住 DEAD ref 的 span 不再出现在决策提示词里,注入指令也不会以它为 Target;模型若仍引用此类 span,resolveDecisionRange找不到包含它的存活区间 → 跳过注入(而非下达注定失败的命令)。旧行为:照常宣告并命令式指路 → 必然闸门拒收 + breaker 计数污染。新行为:不宣告、不指路。这是本修复的预期效果。compressibleRanges字段与面板文本不再列出罩住 DEAD ref 的 span,与acp_status工具输出(fix: stop advertising DEAD refs as compressible in receipts and acp_status #3195)对齐。无阈值 / 时序 / 默认值漂移。测试
新增
tests/issue3204-dead-ref-nudge-panel.test.ts(真实管线 e2e,两条产线各一):state.deadRefs(与 fix: stop advertising DEAD refs as compressible in receipts and acp_status #3195 回归测试同一 seam)。断言第二轮决策提示词与任何注入指令的 Target span 均不罩死 ref。compressibleRanges字段与面板文本均不列罩死 span。红绿验证:未改代码两测均红(
post-drop decision prompt must not offer the m00015-bracketing span m0013–m0016/panel field must not list m00013–m0016 spanning m00015);修复后 pass 2/fail 0。本地定向:typecheck clean + 本文件 + nudge-model-decided + plugin-status-provenance 全绿(5/5);全量套件交给 CI。Review addendum(commit 69eb01b)
审核发现本 PR 范围漏掉的第三条产线(同 #3192 根机制),已在本分支独立 commit 修复:
默认 prose nudge 面(
useDecide=false,即未开nudgeModelDecided的会话——多数用户的默认路径):renderNudgeText把formatRanges(turn.nudge.compressibleRanges)直接渲染进注入的 nudge 文本;且formatRanges按位置合并相邻区间(gap ≤ 1 slot),被丢消息的空槽会被桥接,罩住 DEAD ref 的 span 因此合并成一个大区间(实测复现:dead m00015 被桥进 m0001–m0030)。此面影响面大于决策指令面(opt-in)。修法:把 dead 过滤收敛到各 lane 早段 top mutation 点(
viableRanges(...)→excludeDeadRefRanges(viableRanges(...), session.state.deadRefs)),一个过滤点覆盖全部下游消费者——决策提示+指令、prose nudge、emergency override、preflight 长度门;同时移除首 commit 的逐 decide wrapper(语义等价,单一过滤点)。行为变更披露(新增):当所有可压缩候选都被 DEAD ref 罩住时,
emergencyNudgeoverride 与 server 侧 immediate-forward / preflight 空区间门现在看到「诚实为空」的集合 → 拒绝 override / 直接放行,而不是像旧行为那样继续进入注定失败的 fold。决策指令与面板两面语义与原描述不变。测试:
tests/issue3204-dead-ref-nudge-panel.test.ts新增 prose 面 e2e scenario(不修则红:post-drop prose nudge must not offer the m00015-bracketing span m0001–m0030;修后 3/3 绿)。本地定向验证:typecheck clean + 本文件 + 11 个 nudge 面套件(58/58)+ 8 个 panel/gate/preflight 套件(62/62);全量交 CI。另已实测正文「合并顺序说明」:master b2868ca 上双向模拟合并 pr3195 ↔ pr3213,零冲突,identical hunk 自动收敛为单份拷贝。
措辞小勘误(不阻塞):正文称模型引用 dead span 时
resolveDecisionRange「跳过注入」——实际是回退到最大存活区间仍注入(仅当无任何存活区间才跳过);系既有语义,安全性质(永不以 dead span 为 Target)不受影响。