Repository navigation
Replies: 3 comments
|
Measured case that may be worth handling before the suppression policy, because the non-convergence here is structural rather than marginal β suppression would stop the repetition, but the attempt can never succeed. In
Outcome in that session:
One difference from this proposal that matters for where the fix belongs: these attempts throw before commit, so there is no successful Full write-up: #7212 Evidence (complete session log, credential-redacted, plus the span table and stats): https://gist.github.com/gorban/4725c87390cb391047a2f14b56b98d28 |
|
Thanks β this is strong evidence that there is a structural
non-convergence case that should be handled before the suppression
policy.
I agree with the distinction: if the selected compactable span is
itself the prior checkpoint, or the candidate cannot reduce the span,
suppressing only after a successful CompactionResult will not stop the
retry loop. In that case the safer fix seems to be to reject the span
as non-compactable/non-retryable and prevent the pre-step listener
from immediately scheduling the same failed attempt again.
The #7212 measurements are especially useful because they separate
this from marginal compression failure. Iβll treat this as a distinct
failure mode when refining the proposal rather than assuming
post-success suppression covers it.
Thanks for the detailed reproduction and evidence.
β¦On Sat, 19 Sep 2026 18:35:28 -0700, David Bruck ***@***.***> wrote:
Measured case that may be worth handling before the suppression policy, because the non-convergence here is structural rather than marginal β suppression would stop the repetition, but the attempt can never succeed.
In session-2496881f-8d36-4ce6-93d9-1954a31930c7 (dsh 0.1.6-alpha.2, openrouter/deepseek/deepseek-v4.1-flash), the compaction product becomes the next compaction's only eligible input. selectCompactableRange always starts at the first non-system surface node, so after one successful compaction the span is the checkpoint that compaction just wrote. 19 of the 20 successful compactions selected a one-node span equal to the previous checkpoint:
summary seq
selected span
span is prior checkpoint
shadowed tokens
708
9β246
no
38,883
873
709β709
yes
2,453
877
874β874
yes
2,442
922
878β878
yes
2,432
β¦
β¦
yes
β¦
1338
1256β1256
yes
2,238
Outcome in that session:
- 79 compaction/start, 59 rejected, 20 succeeded;
- 39 of the 59 rejections are exact equality (2237 >= 2237, 2238 >= 2238, 2432 >= 2432);
- 48 attempts inside turn 20 alone;
- 2,678 s (44.6 min) of summarization wall time in the failed attempts, median 38.9 s each;
- 5 of 5 manual /compact runs failed with the same guard.
One difference from this proposal that matters for where the fix belongs: these attempts throw before commit, so there is no successful CompactionResult to suppress. The repetition is driven by the throw plus the agent/pre-step listener retrying on the next step. Suppressing after a successful compaction would not cover this case; refusing a span that cannot shrink (or that is itself a checkpoint) would.
Full write-up: [#7212](#7212)
Evidence (complete session log, credential-redacted, plus the span table and stats): https://gist.github.com/gorban/4725c87390cb391047a2f14b56b98d28
β
Reply to this email directly, [view it on GitHub](#5669?email_source=notifications&email_token=ADHJMC25VBZSFNZCAWZZWR35P4X6BA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBVGIYTQMJQUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-18521810), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ADHJMCZQJFGV3BUXLN7IZUD5P4X6BAVCNFSNUABJKJSXA33TNF2G64TZHMYTGMZTGA3DKMBZGE5UI2LTMN2XG43JN5XDWMJQG42TEMBZGWQXMAQ).
You are receiving this because you authored the thread.
|
|
I checked the current compaction-basic flow against the #7212 trace,
and I think the proposal should distinguish two different no-progress
cases rather than treating them as one.
1. Post-success non-convergence: a compaction commits, but pressure
remains above threshold. The original token-growth backoff still fits
this case.
2. Pre-commit shrink failure: summarizeCompaction rejects because the
framed checkpoint is not smaller than the selected span. Today that
exception is caught by the agent/pre-step listener, the turn
continues, and the next pre-step can select the same unchanged span
and pay for the same failed summarization again. #7212 is this second
case.
A minimal refinement would be to make the "summary not smaller"
condition distinguishable from ordinary provider/surface failures, and
record the same process-local no-progress backoff for pressure
compaction when it occurs. The suppression key should remain session +
exact provider/model route, and should be cleared/unblocked by
meaningful surface growth, falling below threshold, or a route change.
Context-overflow recovery can keep its existing bounded retry
semantics and bypass the pressure suppression.
I would not reject a span merely because it is a single prior
checkpoint: the #7212 data also shows that checkpoint-only spans
sometimes do shrink successfully before reaching the plateau. The
important signal is the observed no-progress result for an unchanged
span, not checkpoint identity by itself.
That would let one mechanism cover both:
- successful compaction that still leaves the request above threshold, and
- failed compaction that proves the selected span cannot currently shrink,
while leaving unrelated summarizer/provider errors retryable as they are today.
Iβll fold this distinction and the corresponding regression cases into
the next revision of the proposal.
β¦On Sat, 19 Sep 2026 18:35:28 -0700, David Bruck ***@***.***> wrote:
Measured case that may be worth handling before the suppression policy, because the non-convergence here is structural rather than marginal β suppression would stop the repetition, but the attempt can never succeed.
In session-2496881f-8d36-4ce6-93d9-1954a31930c7 (dsh 0.1.6-alpha.2, openrouter/deepseek/deepseek-v4.1-flash), the compaction product becomes the next compaction's only eligible input. selectCompactableRange always starts at the first non-system surface node, so after one successful compaction the span is the checkpoint that compaction just wrote. 19 of the 20 successful compactions selected a one-node span equal to the previous checkpoint:
summary seq
selected span
span is prior checkpoint
shadowed tokens
708
9β246
no
38,883
873
709β709
yes
2,453
877
874β874
yes
2,442
922
878β878
yes
2,432
β¦
β¦
yes
β¦
1338
1256β1256
yes
2,238
Outcome in that session:
- 79 compaction/start, 59 rejected, 20 succeeded;
- 39 of the 59 rejections are exact equality (2237 >= 2237, 2238 >= 2238, 2432 >= 2432);
- 48 attempts inside turn 20 alone;
- 2,678 s (44.6 min) of summarization wall time in the failed attempts, median 38.9 s each;
- 5 of 5 manual /compact runs failed with the same guard.
One difference from this proposal that matters for where the fix belongs: these attempts throw before commit, so there is no successful CompactionResult to suppress. The repetition is driven by the throw plus the agent/pre-step listener retrying on the next step. Suppressing after a successful compaction would not cover this case; refusing a span that cannot shrink (or that is itself a checkpoint) would.
Full write-up: [#7212](#7212)
Evidence (complete session log, credential-redacted, plus the span table and stats): https://gist.github.com/gorban/4725c87390cb391047a2f14b56b98d28
β
Reply to this email directly, [view it on GitHub](#5669?email_source=notifications&email_token=ADHJMC25VBZSFNZCAWZZWR35P4X6BA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBVGIYTQMJQUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-18521810), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ADHJMCZQJFGV3BUXLN7IZUD5P4X6BAVCNFSNUABJKJSXA33TNF2G64TZHMYTGMZTGA3DKMBZGE5UI2LTMN2XG43JN5XDWMJQG42TEMBZGWQXMAQ).
You are receiving this because you authored the thread.
|
Uh oh!
There was an error while loading. Please reload this page.
Motivation
A pressure-triggered compaction can complete successfully yet leave the routed request above its configured threshold because the retained tail, request envelope, or generated checkpoint remains large. The current engine then throws after its bounded attempts. The automatic pre-step listener continues the turn, so the next step can generate another summary at nearly the same token count, repeatedly spending model requests without a meaningful state change.
Proposed behavior
When all configured pressure compaction attempts land successfully but the result remains above threshold:
CompactionResultinstead of converting the successful compaction into an error.min(contextWindow Γ pressureRetryGrowthRatio, pressureRetryGrowthMaxTokens)with a minimum of one token.
The two deployment tunables are validated at the top level and in exact-route policy overrides:
pressureRetryGrowthRatio: default0.05pressureRetryGrowthMaxTokens: default32768Suppression is intentionally process-local, so replay and model-visible conversation history remain determined only by durable compaction events and surface replacements. A restart may retry one summary earlier.
Patch and validation
A complete reference patch is available on my fork:
10cbfda89dIt includes implementation and policy validation, exact-route overrides, generated config catalogs, bilingual package docs and Agent Note, synchronized translation records, and regression coverage for growth gating, below-threshold clearing, route changes, and overflow bypass.
Validation completed on Windows x64:
index.tsandconfig.tscoverage: 100%EPERM)I am sharing this as a Discussion because the repository currently does not accept external pull requests. Would token-growth gating fit the intended pressure-compaction policy, and are the proposed defaults appropriate?
All reactions