Skip to content

refactor: improve compaction to retain recent conversation context#21822

Open
nexxeln wants to merge 3 commits intodevfrom
nxl/improve-compaction-strategy
Open

refactor: improve compaction to retain recent conversation context#21822
nexxeln wants to merge 3 commits intodevfrom
nxl/improve-compaction-strategy

Conversation

@nexxeln
Copy link
Copy Markdown
Member

@nexxeln nexxeln commented Apr 10, 2026

Summary

  • keep recent real user turns verbatim during compaction instead of summarizing the full remaining session
  • add configurable compaction.tail_turns and compaction.tail_tokens limits with runtime defaults
  • persist tail_start_id on compaction parts and update filtered session history to retain the tail across future compactions
  • update the compaction prompt to summarize older context while relying on preserved recent turns
  • add coverage for retained-tail selection, fallback behavior, and repeated compaction boundaries

@nexxeln nexxeln changed the title Improve compaction to retain recent conversation context refactor: improve compaction to retain recent conversation context Apr 10, 2026
@nexxeln nexxeln marked this pull request as ready for review April 10, 2026 04:07
opencode-agent bot added a commit that referenced this pull request Apr 10, 2026
opencode-agent bot added a commit that referenced this pull request Apr 10, 2026
opencode-agent bot added a commit that referenced this pull request Apr 10, 2026
opencode-agent bot added a commit that referenced this pull request Apr 10, 2026
opencode-agent bot added a commit that referenced this pull request Apr 10, 2026
opencode-agent bot added a commit that referenced this pull request Apr 10, 2026
opencode-agent bot added a commit that referenced this pull request Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants