Repository navigation
Compaction can repeatedly fail when its one-shot summary input exceeds the summary model context #3948
Replies: 1 comment
|
I can corroborate this on DeepSeek Harness These measurements come from the persisted session events:
The final event sequence was: Before this, several summary attempts failed with: Fresh-session corroboration: A new conversation started with the 45,000-token harness setting. Two compactions succeeded, reporting 5,773 and 4,061 output tokens, both with Configuration caveat: The original conversation initially advertised 262,144 tokens while the server allowed 32,768. That contributed to early failures. The later settings and fresh-session observations are included to distinguish that mismatch from the continuing compaction problem. Diagnostic limitation: Failed summaries did not preserve output or usage in the session log. I cannot prove that every truncation consumed exactly 8,192 tokens, or distinguish reasoning-budget exhaustion from summary length or a server-side generation limit. The clearest finding is that overflow recovery submitted a summary request larger than the already-rejected normal request, leaving the conversation unable to recover. |
Uh oh!
There was an error while loading. Please reload this page.
Symptom
Automatic compaction can trigger above the configured pressure threshold but fail to land a checkpoint. The log reports
step compaction failed: ... context overflow ...; continuing the turn, and subsequent turns keep replaying the same over-budget surface.Root cause
dsh-compaction-basicselects a compactable surface prefix, then replays that complete prefix in one auxiliary summary request. The selected prefix can itself exceed the summary target context window. ProviderCONTEXT_WINDOW_EXCEEDEDis caught by the automatic listener, so the durable surface remains unchanged and the next step repeats the failure. Installing an alternate Provider does not fix the shipped default presets because they continue mounting@deepseek-ai/dsh-compaction-basicin the isolated compaction realm.Proposed fix
Keep the existing cache-reusing one-shot request unchanged when estimated input plus its output cap fits. Otherwise, or when that fitting request receives canonical
CONTEXT_WINDOW_EXCEEDED, use bounded chronological map/reduce internally:Adapters without context capacity metadata retain the existing one-shot behavior; capacity becomes required only if that call overflows and bounded recovery is needed.
Verification and implementation
Fork implementation and tests: aka-danielZhang#9
The focused
dsh-compaction-basicsuite passes 153 tests with 100% statements, branches, functions, and lines. Full Harness typecheck and build pass. The fitting one-shot request shape, target precedence,maxTokens, raw output, and KV-cache behavior remain covered as compatibility contracts.All reactions