Repository navigation
[PR] fix: wire external-summary all-fail batches into the compress circuit breaker - #6924
ranxianglei wants to merge 1 commit into
Conversation
… 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
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10365-pr.6924.73fbeaaThis 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。 |
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