Skip to content

CoS tip: drop oldest turns when compaction head exceeds context (#51121) #98

Description

@kvnloo

Origin

anomalyco#51121

Intent

When the compaction summarizer head exceeds the model's usable context (after reserving prompt/template budget), drop the oldest complete turns instead of giving up with "session too large to compact".

Proof (fail → pass)

cd packages/opencode
bun test test/session/compaction.test.ts -t "drops oldest turns when the head exceeds the model context budget"
# NEGATIVE (base product + tip tests): 0 pass / 1 fail
# GREEN: 1 pass / 0 fail
# restore: 0 pass / 1 fail

Notes

  • Base: dev
  • github_writes_origin=0
  • Codex promote: parked

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions