Repository navigation
[PR] fix: wire external-summary all-fail batches into the compress circuit breaker - #6924
ranxianglei wants to merge 3 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11482-pr.6924.215f7fbThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6924.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: opencode/qwen3.8-27b) 🔶 需要决策 查重: duplicate — PR #6905 targets the same thread #6903. PR #6905 ("fix(external-summary): stop repeated total failures and recover after repair", created 2026-11-16 08:38Z — 51 minutes BEFORE this PR's 09:29Z) also 背景一句话: two open PRs fix issue #6903 (all external-summary candidates failing never arms the consecutive-failure breaker, so repeated 待决问题: which PR to keep. 选项:
不决定的默认行为: I cannot close either PR (owner-only). Both stay open and will step on each other at merge time; I recommend closing #6924. Independent review of this PR (done regardless of the dedup verdict — full diff read, every referenced symbol verified against the branch): Verified against the code:
Test gaps (must be fixed if option B is chosen):
CI (live-verified 2026-11-16 ~09:40Z): this PR's run started 09:30Z and is still in progress; #6905's last full run on its current head sha was green, its re-run is in progress. Both PRs are 结论八问(本 PR 独立审核):
判定: 代码本身扎实、diff 干净,但本 PR 与 #6905 重复(后者更早、CI 绿、对 issue 要求的覆盖更全)。按先来后到,建议关闭本 PR、保留 #6905——关闭动作需要 owner 执行,我无法关闭 PR。 |
… breaker⚠️ MODEL-FACING TEXT CHANGE: the external-summary all-failure receipt now appends the compress-loop pause paragraph once the breaker arms (n>=3), and a new pre-dispatch armed-refusal receipt is returned when the breaker is already armed by external-summary failures. Both are model-visible instruction/state text. Consumption chain: neither text introduces a new number/ref/position the model could anchor on — n and decayMinutes are real streak values, and the pause paragraph is the existing verbatim wording (owner decision 2026-10-07). The model's next action after either text is to stop compressing, not to copy a value into a subsequent call. The external-summary all-failure branch (applyConfiguredCompression) returned directly without entering the consecutive-failure breaker, so repeated compress calls kept re-requesting unavailable candidates and the 3-failure / 10-min cooldown protection never stopped the session. - Count dispatched-but-all-failed batches in the existing breaker (3-failure threshold, 10-min cooldown). Count only when a candidate call was actually dispatched (plan.stats.attempts > 0) and the batch is finished/deadline — a congestion-only batch (no dispatch) and a cancelled batch (teardown) are not provider failures. - Refuse BEFORE dispatch when the breaker is armed by the external-summary cause. Cause-gated (not any-armed) so substrate-destruction's instructed recovery and stale-ref re-anchoring can still dispatch and clear the breaker. The gate does not call noteCompressLoopFailure, so repeated refusals do not extend the 10-min cooldown. - One successful fold clears the streak (existing applyRanges behavior). - The forced cause keeps the provider-down verdict visible to acp_status without claiming summary-too-long (the underlying provider cause stays an independent diagnosis). Config surface: none new (reuses the existing breaker mechanism). Closes #6903
…ubstantial-fold semantics⚠️ MODEL-FACING TEXT CHANGE: the #6903 armed external-summary refusal receipt said the breaker 'disarms on one successful fold'; master's #7326 (da7bda3) moved every other breaker surface to 'one substantial fold (a trivial one that saves almost nothing does not count)' (>=500-token discharge, COMPRESS_LOOP_DISCHARGE_MIN_TOKENS). The PR branched before #7326, so its new receipt kept the stale any-success wording while the rebased doc comment carries the substantial semantics — same breaker, two different disarm claims. This aligns the receipt with the owner-decided #7326 wording, verbatim from armedRefusalReceipt. No behavior change: breaker logic untouched; only the model-visible sentence changes (old: 'one successful fold' -> new: 'one substantial fold (a trivial one that saves almost nothing does not count)').
6bbfdcc to
44d1bf1
Compare
(ai: vllm-qwen/qwen3.8-27b)
Conflict resolved and rebased. 七问:
Status: pushed final head PR: #6924 |
🔶 需要决策 PR #6924 (Closes #6903) is functionally superseded by #6905, which is already merged into master (2026-11-24, via #7630; commits What master already has (#6905):
What #6924 adds beyond #6905 (minor deltas):
Why a mechanical merge is not viable:
Options:
Default if undecided: A — close #6924 as superseded; #6905 is already merged and shipping, and the duplicate PR only blocks review. No push was made this run; the branch head is still |
(ai: vllm-qwen/qwen3.8-27b) Status re-check (no new information this run — the decision below remains open):
Waiting on owner action: close #6924 (option A) or direct option B (rewrite as a delta on #6905). I cannot close the PR myself (owner-only), and I will not force a semantically broken rebase onto the branch while the decision is pending. |
…fold (#7545) The merged one-shot gate (#7546) blocks preflight whenever the session has committed folds — but committed folds belong to the epoch that produced them. When the host wholesale-replaces the history under the same session id, fold-reconcile latches the epoch confirmation (#3641) and preflight itself suspends on the same latch (src/preflight.ts); the gate must suspend with it, or the new epoch's first over-window turn is forwarded unfolded (regression: the e2e in tests/issue6069-epoch-pause-over-window.test.ts, red on all 3 test shards of #7546 after merge). - gate (src/server.ts): skip the committed-fold block while epochConfirmPending(session) — the new epoch gets its own one-shot - re-arm (src/fold-reconcile.ts): an aborted attempt on the REPLACED epoch must not starve the new one — clear preflightRuns at the latch site (successful folds never set the latch, so the one-shot still holds within any single epoch) - test: case E in preflight-one-shot-gate (old epoch folds -> 3 replacement passes latch -> grown turn folds again -> next over-window turn blocked: the exception is scoped to the latch window)
(ai: vllm-qwen/qwen3.8-27b) Red CI root-caused as an inherited master failure — fixed by cherry-picking the exact landed fix. New head What was red. Run 45055154361 on head Why it is not this PR's fault (inherited). I reproduced the identical failure on the PR's own base commit The fix already landed on master. What I did. Cherry-picked Why not Verification (local, on new head
Coordination note (for #4599, which is closed upstream and not mirrored): PR #6924 red was inherited (preflight one-shot gate, fixed on master by 七问
结论:本次 CI 红已修复并推送( |
🔶 需要决策 (status re-check — state unchanged, decision remains open since floor 3) Live-verified this run (2026-11-26 ~09:20Z):
No rebase this run. The dirty state is a semantic collision with #6905 (already merged into master 2026-11-24 via #7630), not a textual conflict. A plain rebase would produce: (1) double strike on the breaker (the all-fail branch would call both Options (unchanged from floors 3 and 11):
Default if undecided: A — close #6924 as superseded. No push was made this run; branch head is still 七问
结论: 状态无变化,决策仍挂起。等待 owner 拍板(A 或 B)。 |
🔶 需要决策 (status re-check — independently re-verified the semantic collision; decision remains open since floor 3) Live-verified this run (2026-11-26 ~21:30Z):
Independently re-verified the semantic collision (not just trusting prior runs):
This is a design decision, not a mechanical fix. I will not force a semantically broken rebase onto the branch. Options (unchanged from floors 3 and 11):
Default if undecided: A — close #6924 as superseded. No push was made this run; branch head is still 七问
结论: 状态基本无变化(master 有新提交但不影响冲突),独立复核确认语义冲突成立,决策仍挂起。等待 owner 拍板(A 或 B)。 |
🔶 需要决策 (status re-check — 4th re-trigger, no new information; decision remains open since floor 3) Live-verified this run (2026-11-26 ~22:15Z):
No rebase this run. The dirty state is a semantic collision with #6905 (already merged into master), not a textual conflict. A plain rebase keeps both implementations → double strike + competing gates + failing tests (independently verified in the prior run). Forcing it would create a regression. Options (unchanged from floors 3 and 11):
Default if undecided: A. No push; branch head still Note on the loop: this is the 4th auto-fix-lane wake for the same dirty state. The underlying blocker is the pending owner decision, not a mechanical conflict — further re-triggers will produce the same outcome until the decision is made. 七问
结论: 第 4 次 re-check,无新信息。master 有新 CI 提交但不影响冲突。决策仍挂起,等待 owner 拍板(A 或 B)。 |
🔶 需要决策 (5th re-trigger — state byte-identical to the 4th; no new information) Live-verified this run (2026-11-26 ~22:20Z):
No rebase, no push. The dirty state is the semantic collision with #6905 (merged into master 2026-11-24), not a textual conflict — a mechanical rebase keeps both implementations and produces a regression (double strike, competing gates, failing tests; full analysis in floors 3, 11, 21). I will not force it. Decision still open (options unchanged): A (recommended) close #6924 as superseded by #6905 · B rewrite as a delta on #6905 · C not viable. Default: A. I cannot close the PR (owner-only). 七问
结论: 第 5 次 re-check,状态与第 4 次完全一致,无新信息。决策自 floor 3 起挂起,等待 owner 拍板(A 或 B)。在此之前进一步 re-trigger 只会得到相同结果。 |
🔶 需要决策 (6th re-trigger — state unchanged; master moved but not in a way that affects the collision) Live-verified this run (2026-11-27 ~10:28Z):
No rebase, no push. The dirty state is the semantic collision with #6905 (merged into master 2026-11-24), not a mechanical conflict. A plain rebase keeps both implementations → double strike + competing gates + failing tests (full analysis in floors 3, 11, 21). Forcing it would create a regression. Decision still open (options unchanged): A (recommended) close #6924 as superseded by #6905 · B rewrite as a delta on #6905 · C not viable. Default: A. I cannot close the PR (owner-only). Note: my local work branch was reset between runs (I'm now on 七问
结论: 第 6 次 re-check。master 有新提交(#7804 sessions-dir-config)但不影响冲突。状态与之前一致,决策自 floor 3 起挂起。等待 owner 拍板(A 或 B),在此之前进一步 re-trigger 只会得到相同结果。 |
🔶 需要决策 (7th re-trigger — master moved significantly, but the semantic collision is unchanged) Live-verified this run (2026-11-29 ~09:14Z):
No rebase, no push. The dirty state is the semantic collision with #6905 (merged into master 2026-11-24), not a mechanical conflict. A plain rebase keeps both implementations → double strike + competing gates + failing tests (full analysis in floors 3, 11, 21). Forcing it would create a regression. Decision still open (options unchanged): A (recommended) close #6924 as superseded by #6905 · B rewrite as a delta on #6905 · C not viable. Default: A. I cannot close the PR (owner-only). 七问
结论: 第 7 次 re-check。master 有大量新提交(含 v0.1.217 发布),其中一处 1 行改动触及 |
🔶 需要决策 (8th re-trigger — master moved, merge state transiently Live-verified this run (2026-11-29 ~11:28Z):
No rebase, no push. The underlying dirty state is the semantic collision with #6905 (merged into master 2026-11-24), not a mechanical conflict. A plain rebase keeps both implementations → double strike + competing gates + failing tests (full analysis in floors 3, 11, 21). Forcing it would create a regression. Decision still open (options unchanged): A (recommended) close #6924 as superseded by #6905 · B rewrite as a delta on #6905 · C not viable. Default: A. I cannot close the PR (owner-only). 七问
结论: 第 8 次 re-check。master 有新提交(#7910)但不影响冲突。merge state 当前为 |
🔶 需要决策 (9th re-trigger — master moved, merge state back to Live-verified this run (2026-11-30 ~05:56Z):
No rebase, no push. The dirty state is the semantic collision with #6905 (merged into master 2026-11-24), not a mechanical conflict. A plain rebase keeps both implementations → double strike + competing gates + failing tests (full analysis in floors 3, 11, 21). Forcing it would create a regression. Decision still open (options unchanged): A (recommended) close #6924 as superseded by #6905 · B rewrite as a delta on #6905 · C not viable. Default: A. I cannot close the PR (owner-only). Note: the new close-object-guard CI (#7973) requires every PR to carry a close/fix object — this PR has "Closes #6903" so it satisfies that guard. 七问
结论: 第 9 次 re-check。master 有新提交(含 v0.1.218 发布)但不影响冲突。merge state 回到 |
🔶 需要决策 (10th re-trigger — master moved, semantic collision unchanged) Live-verified this run (2026-11-30 ~16:03Z):
No rebase, no push. The dirty state is the semantic collision with #6905 (merged into master 2026-11-24), not a mechanical conflict. Forcing a rebase would create a regression (full analysis in floors 3, 11, 21). Decision still open (options unchanged): A (recommended) close #6924 as superseded by #6905 · B rewrite as a delta on #6905 · C not viable. Default: A. I cannot close the PR (owner-only). 七问
结论: 第 10 次 re-check。master 有新提交(#7916)但不影响冲突。决策自 floor 3 起挂起。等待 owner 拍板(A 或 B)。 |
🔶 需要决策 (11th re-trigger — master moved, semantic collision unchanged) Live-verified this run (2026-12-01 ~05:46Z):
No rebase, no push. The dirty state is the semantic collision with #6905 (merged into master 2026-11-24), not a mechanical conflict. Forcing a rebase would create a regression (full analysis in floors 3, 11, 21). Decision still open (options unchanged): A (recommended) close #6924 as superseded by #6905 · B rewrite as a delta on #6905 · C not viable. Default: A. I cannot close the PR (owner-only). 七问
结论: 第 11 次 re-check。master 有新提交(#8028, #7987)但不影响冲突。决策自 floor 3 起挂起。等待 owner 拍板(A 或 B)。 |
🔶 需要决策 (12th re-trigger — master moved, semantic collision unchanged) Live-verified this run (2026-12-02 ~03:24Z):
No rebase, no push. The dirty state is the semantic collision with #6905 (merged into master 2026-11-24), not a mechanical conflict. Forcing a rebase would create a regression (full analysis in floors 3, 11, 21). Decision still open (options unchanged): A (recommended) close #6924 as superseded by #6905 · B rewrite as a delta on #6905 · C not viable. Default: A. I cannot close the PR (owner-only). 七问
结论: 第 12 次 re-check。master 有新提交(#7983, #8067)但不影响冲突。决策自 floor 3 起挂起。等待 owner 拍板(A 或 B)。 |
🔶 需要决策 (13th re-trigger — master moved, semantic collision unchanged) Live-verified this run (2026-12-02 ~14:29Z):
No rebase, no push. The dirty state is the semantic collision with #6905 (merged into master 2026-11-24), not a mechanical conflict. Forcing a rebase would create a regression (full analysis in floors 3, 11, 21). Decision still open (options unchanged): A (recommended) close #6924 as superseded by #6905 · B rewrite as a delta on #6905 · C not viable. Default: A. I cannot close the PR (owner-only). 七问
结论: 第 13 次 re-check。master 有新提交但不影响冲突。决策自 floor 3 起挂起。等待 owner 拍板(A 或 B)。 |
🔶 需要决策 (14th re-trigger — state completely unchanged) Live-verified this run (2026-12-02 ~20:32Z):
No rebase, no push. The dirty state is the semantic collision with #6905 (merged into master 2026-11-24), not a mechanical conflict. Forcing a rebase would create a regression (full analysis in floors 3, 11, 21). Decision still open (options unchanged): A (recommended) close #6924 as superseded by #6905 · B rewrite as a delta on #6905 · C not viable. Default: A. I cannot close the PR (owner-only). 七问
结论: 第 14 次 re-check。状态完全未变(master 未移动)。决策自 floor 3 起挂起。等待 owner 拍板(A 或 B)。 |
Consumption-chain regression inference (§7.3, mandatory for model-facing text):
loopNoisePauseParagraph) is the EXISTING verbatim wording (owner decision 2026-10-07) — no new numbers/refs the model could anchor on.nanddecayMinutes— both REAL values from the streak (no phantom values). It carries no message refs, no token counts, no positions.What this fixes
The external-summary all-failure branch in
applyConfiguredCompression()(src/external-summary-compress.ts) returned directly without entering the consecutive-failure breaker, so repeatedcompresscalls kept re-requesting unavailable candidates and the existing 3-failure / 10-min cooldown protection never stopped the session.Repro (no real provider): configure two local summary endpoints returning HTTP 403, call
compressthree times on the same compressible range → 6 endpoint requests; the 4th call was still dispatching. After this fix the 4th call is refused before dispatch.How
plan.stats.attempts > 0) and the batch isfinished/deadline— a congestion-only batch (no dispatch) and a cancelled batch (request teardown) are NOT provider failures.noteCompressLoopFailure, so repeated refusals do not extend the 10-min cooldown.applyRangesbehavior); the 10-min decay allows a recovery probe.external-summary-failure — …) keeps the provider-down verdict visible toacp_statuswithout claiming summary-too-long (the underlying provider cause stays an independent diagnosis, per the issue).Regression tests (new file
tests/issue6903-external-summary-breaker.test.ts)All 4 pass; the related existing suites (issue2146, issue4812, issue3126, issue3635, external-summary-runtime, agent-providers, wire-contract-go-session) all pass.
Config surface
None new — reuses the existing breaker mechanism (threshold / cooldown / cause).
Closes #6903