Fail closed is success here.The original conversation stays intact instead of accepting a checkpoint with a missing tail.

One word. Two mechanisms.

Local serverContext shift

Moves or compresses KV-cache state so a request can run.

No Session checkpoint
DeepSeek HarnessCompaction

Replaces older durable history with a complete structured summary.

Committed checkpoint

Trace the rejected attempt.

01startcompaction/start
02generate8192 / 8192
03rejectMAX_TOKENS
04preservesurface unchanged

Choose the binding boundary.

output = 8192Raise summary cap

Try 16,384 and measure one attempt.

small model driftsRoute a summarizer

Set provider and model together.

overflow stays hiddenExpose server overflow

Decide whether Harness owns context recovery.

retries repeatStart clean

Carry a bounded handoff, not the full log.

The cap to change
- id: compaction-basic
  config:
    maxTokens: 16384
Not the conversation output cap. Not the context window.

Twelve acceptance gates.

  1. Context shift stays distinct.
  2. Purpose is compaction.
  3. Route pair resolves.
  4. Default cap is visible.
  5. MAX_TOKENS maps.
  6. No partial summary lands.
  7. Surface stays intact.
  8. Error closes durably.
  9. Success records three events.
  10. Retries mean convergence.
  11. Triggers stay distinct.
  12. Clean handoff stays bounded.