Skip to content

[PR] fix: scope-gate (requireRecommendation) refusals no longer arm the compress breaker (#7197) - #7209

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-11-19_7197-scope-gate-breaker
Open

ranxianglei wants to merge 1 commit into
masterfrom
2026-11-19_7197-scope-gate-breaker

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

⚠️ MODEL-FACING TEXT CHANGE
Scope-gate (compress.requireRecommendation) refusal receipts no longer carry the "COMPRESS CIRCUIT BREAKER: ARMED — STOP calling compress now: do not try other ranges, do not re-issue any previous range, and do not poll acp_status." paragraph. The core refusal wording is unchanged. Consumption chain: the model sees the refusal + advice ("Call acp_status for the current compressible ranges and stay within them") and follows it with an in-recommendation retry — the recovery the removed paragraph forbade. No number/ref/position the model propagates moves; the receipt-level test asserts the exact model-visible string.

Closes #7197

Problem

With compress.requireRecommendation: true, three wrong range guesses armed the session-level compress circuit breaker (3-strike, #2146). The armed receipt (loopNoisePauseParagraph) tells the model "STOP calling compress now: do not try other ranges, do not re-issue any previous range, and do not poll acp_status." But the scope gate does NOT consult the breaker: an in-recommendation call still compresses normally, and a success clears the streak. The breaker wording therefore forbade the only recovery the code still allowed — an obedient model lost compression for the whole session while a disobedient one recovered on the next call.

Root cause

#6753 (fix for #6728) added noteCompressLoopFailure to BOTH policy-gate branches (nudge + scope). Correct for the nudge gate (its recovery is "wait for a nudge" — the model cannot self-recover), wrong for the scope gate: the scope gate is a range-correctness gate ("your span was wrong"), not a fold-feasibility signal. Its refusal means "try a different range", and the recovery (acp_status → in-recommendation retry) is always available. #6728's scenario was "a range bili will NEVER fold" (stopping is correct); #7197's is "a wrong range but a correct one exists" (stopping is wrong).

Fix (issue suggestion #3)

Regression review

Tests

Config surface

None.

@ranxianglei ranxianglei added bug Something isn't working dsh p2 scope/kernel labels Nov 18, 2026
@ranxianglei ranxianglei changed the title fix: scope-gate (requireRecommendation) refusals no longer arm the compress breaker (#7197) [PR] fix: scope-gate (requireRecommendation) refusals no longer arm the compress breaker (#7197) Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-19_7197-scope-gate-breaker (97c4a1e)

Latest build — install this exact version

npm install -g billion-context@0.0.10866-pr.7209.6b9e843

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
97c4a1e billion-context@0.0.10866-pr.7209.6b9e843 build
017ad42 billion-context@0.0.10864-pr.7209.cf27699 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr7209.tgz
npm install -g package

Install instructions are refreshed on each push.

…mpress breaker (#7197)

⚠️ MODEL-FACING TEXT CHANGE: scope-gate refusal receipts no longer carry
the 'COMPRESS CIRCUIT BREAKER: ARMED — STOP calling compress now: do not
try other ranges, do not re-issue any previous range, and do not poll
acp_status.' paragraph. The core refusal wording is unchanged. The model
now sees the refusal + advice ('Call acp_status ... stay within them')
and follows it with an in-recommendation retry — the recovery the removed
paragraph forbade. No number/ref/position the model propagates moves.

The out-of-recommendation scope gate is a range-correctness gate
('your span was wrong'), not a fold-feasibility signal. Its recovery
(acp_status -> an in-recommendation retry) is always available and
succeeds if followed, so arming the session-level breaker (which orders
'do not try other ranges ... do not poll acp_status') forbade the only
recovery the code still allowed: an obedient model lost compression for
the whole session while a disobedient one recovered on the next call.

Remove noteCompressLoopFailure from the scope-gate branch; keep
recordCompressFailure so the #6728 repeat-collapse still fires on
identical re-submission. The nudge gate keeps the breaker charge (its
recovery is 'wait for a nudge' - no self-recovery).

Update tests/issue6728-policy-gate-ledger.test.ts: the requireRecommendation
test now asserts the breaker stays disarmed and the repeat-collapse still
fires.
@ranxianglei
ranxianglei force-pushed the 2026-11-19_7197-scope-gate-breaker branch from 017ad42 to 97c4a1e Compare November 18, 2026 17:59
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

查重: 不重复。与在途 PR #6924(open, "wire external-summary all-fail batches into the compress circuit breaker")同 compress-failure ledger 但方向相反——#6924 把 external-summary 全败加进 breaker,本 PR 把 scope-gate 拒绝移出 breaker;失败类型不同、改动分支不同,非重复。open PR 列表无其他同主题项。

审核结论(已拉取分支 2026-11-19_7197-scope-gate-breaker @ 97c4a1e 核对源码 + 确认 CI):

  1. 是什么问题: compress.requireRecommendation: true 下,三次范围猜错即武装 session 级压缩熔断器(dsh内部问题 出现这个错误后,重启dsh可以发消息 但陷入无限压缩失败 #2146),而熔断文案("STOP calling compress … do not try other ranges … do not poll acp_status")恰好禁止了代码仍允许的唯一自救动作(读 acp_status → 在推荐集内重试)。守规矩的模型整个 session 失去压缩,不守规矩的下次调用即恢复——文案与行为互相矛盾。
  2. 什么原因导致的: [PR] fix(pi): charge policy-gate refusals to the compress failure ledger #6753(修 [Bug][pi] Policy-gate REFUSED receipts (compress.requireNudge / requireRecommendation) charge no failure ledger — endless byte-identical refusals, breaker never arms | 策略门 REFUSED 回执不计入失败账本:逐字重复拒绝、熔断永不启动 #6728)把 noteCompressLoopFailure 同时加进了 nudge 与 scope 两个 policy-gate 分支。对 nudge gate 正确(其恢复是"等 nudge",模型无法自救,该停);对 scope gate 错误——scope gate 是范围正确性门("你这段选错了"),不是可折叠性信号,其恢复(acp_status → 推荐集内重试)永远可用且照做必成,武装 breaker 等于禁止了唯一恢复路径。
  3. 影响范围与严重程度: 仅影响开启 requireRecommendation: true(opt-in 配置)且模型连错三次范围的会话。p2——模型仍可自救(推荐集内重试),但 breaker 文案误导,守规矩的模型整 session 丢压缩、需绕行;非数据丢失、非缓存泄露,不升 p1。
  4. 怎么修复的: 只从 scope-gate 分支移除 noteCompressLoopFailure(src/stream.ts:1308 区),保留 recordCompressFailure([Bug][pi] Policy-gate REFUSED receipts (compress.requireNudge / requireRecommendation) charge no failure ledger — endless byte-identical refusals, breaker never arms | 策略门 REFUSED 回执不计入失败账本:逐字重复拒绝、熔断永不启动 #6728 重复折叠保护仍在:第 2 次相同调用起回执折成一行);nudge gate(src/stream.ts:1145)保留 breaker 计费。拒绝文案本身不变,只是 scope-gate 拒绝不再追加 breaker 段落。
  5. 是否有回归问题: 逐项过——nudge gate 不变(仍计费,其"停"正确);重复折叠不变(recordCompressFailure 仍触发);终态文案 / acp_status 建议 / preflight 车道(loopTracking:false,原 loopGuard 本就为 "")均不变;有意后果:仅 scope-gate 失败时 breaker 不再武装 → acp_status 不再打印 "ARMED"、nudge 不再被抑制(模型可继续收到 nudge 并恢复)——均为修复预期。无 fail-fast 变吞错、无阈值/时序/输出格式漂移(除有意的 breaker 段落移除)。
  6. 是否破坏缓存: 不涉及——改动是 compress 拒绝回执文案 + breaker 武装逻辑,不触及缓存/重试/增量游标/去重键。
  7. 是否改了设计方向: 无架构转向。纠正的是一次失败计费归属到正确的门(范围正确性 vs 可折叠性);breaker 本身设计(3 连败,dsh内部问题 出现这个错误后,重启dsh可以发消息 但陷入无限压缩失败 #2146)不变,只改哪个 gate 喂它。
  8. 是否引入了新的配置: 无。

标签: bug + p2 + dsh + scope/kernel 已挂,判定正确(源 issue 为 [Bug][dsh];breaker 属压缩引擎/上下文管理域;severity 非 p1 两类)。

CI / 合并判定: 0 failed,9 success,9 queued(仍在跑),12 skipped(e2e 车道,env 门控,本 diff 不触发);分支落后 master 0 提交。模型面文本变更已在 commit + PR 顶部以 ⚠️ 标注,回执级测试断言了精确的模型可见字符串(测试有牙:断言 breaker 不武装 + 无 breaker 段落 + 重复折叠仍触发)。代码逻辑正确、测试有牙、标签齐、diff 干净(2 文件 +21−15)——CI 跑完转绿即可合;merge 仅人工,我不代合。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

1 participant