Repository navigation
Bug: repeated automatic compaction with little or no progress blocks chat execution #8733
Replies: 3 comments
Related reports and how this case connects to themAfter searching existing discussions, this report should be treated as additional evidence of an existing problem family, not necessarily a new bug:
Interaction: a large output reservation plus fixed headroom lowers the trigger (#7501 / #8088); once compaction starts, small or already summarized candidates may yield little/no reduction, causing repeated attempts (#7212 / #7501). Our report adds observations from DSH 0.2.0-rc.2 with dsh-plugin-subscriptions 0.9.7 / Codex. These are related mechanisms, not evidence that all three reports have one conclusively established cause. Please feel free to consolidate this report with the existing discussions. No definitive upstream fix has been verified by us. |
|
hit basically this same loop building grunz (a coding agent on open models). in our case the fixed overhead, system prompt plus tool defs, counted toward the trigger, so right after a compaction it was already over the line and fired again. same tell as urs, it keeps summarizing tiny slices that cant get any smaller. what fixed it was measuring the trigger against only the part compaction can actually shrink. is the provider plugins overhead counted in ur threshold |
|
Adding the missing proof for the open question in the first comment here ("we have not yet proven that every failed span in our session consists solely of a previous checkpoint"). In the case I traced on
The fold cannot shrink, because a production summarizer returns roughly its input when the input is already a checkpoint: measured with the shipped Full numbers, the surface reconstruction, and a locally verified guard are in my comment on #7212, which is the canonical report for this failure mode. This thread, #7212, #9041 and #5669 describe one defect: automatic pressure compaction has no convergence check, so a span that cannot shrink is retried on every step and the resulting throw is logged and discarded. |
Uh oh!
There was an error while loading. Please reload this page.
Bug report: repeated automatic compaction prevents normal chat progress
Environment
Observed behavior
A coding session repeatedly enters automatic compaction, sometimes several times consecutively within the same turn. Individual summarization attempts take approximately 50β90 seconds. Some summaries succeed, but another compaction starts immediately afterward; others fail because the summary is not smaller than the content being replaced. The chat spends minutes compacting instead of making useful progress.
Examples from durable session events:
The event sequence includes compaction/start β compaction/summary β compaction/end β another compaction/start within milliseconds. Other attempts end with the errors above, and subsequent steps try again. This establishes repeated compaction with little/no progress, not proof of a literally infinite loop or a single hung HTTP request.
Why compaction triggers earlier than the displayed history suggests
The provider plugin supplies defaultMaxTokens = 128000. With the installed compaction-basic defaults (headroomTokens = 65536, thresholdRatio = 0.8), the effective threshold is:
One projection sample contained sampledSurfaceTokens = 28814 but pressureTokens = 71247. Thus history size alone does not explain actual request pressure, and the large output reservation leaves a relatively small input budget.
I found no explicit compaction policy overrides in the user's web profile. The installed compaction-basic implementation defaults to compactionRetries = 1 and summarization maxTokens = 65536. It rejects non-shrinking summaries, but this session still encounters repeated attempts across steps. I have not isolated a minimal reproduction or established the exact reason every attempt was triggered.
Temporary mitigation
Locally lowered the Codex adapter's default output budget from 128000 to 32768. A subsequent normal request/header event confirms maxTokens = 32768, including with account-qualified model selection. This mitigates early pressure; it does not establish that the summary/retry bug is fixed. The summary budget is separate.
Expected behavior / possible improvements
Could maintainers advise whether this is a known compaction-basic issue and what diagnostics or a minimal reproduction would be most useful? The third-party plugin's high output default contributes to the early trigger, but robust handling of non-shrinking summaries appears to belong in the core compaction engine.
All reactions