[FEATURE]:Session compaction includes already-summarized messages, wasting tokens #8714

Open
opened 2026-02-16 18:10:38 -05:00 by yindo · 1 comment
Owner

Originally created by @Liuhanlin23 on GitHub (Feb 6, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Description:
The session compaction logic in compaction.ts currently includes all historical messages every time it performs compaction, even when previous compaction summaries already exist. This causes unnecessary processing and token waste.
I noticed that the prune() method already implements this optimization, recognizing that messages before a summary point don't need reprocessing.
If you agree this optimization is needed, I would like to be assigned to handle and fix this issue.

Originally created by @Liuhanlin23 on GitHub (Feb 6, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request Description: The session compaction logic in compaction.ts currently includes all historical messages every time it performs compaction, even when previous compaction summaries already exist. This causes unnecessary processing and token waste. I noticed that the prune() method already implements this optimization, recognizing that messages before a summary point don't need reprocessing. If you agree this optimization is needed, I would like to be assigned to handle and fix this issue.
yindo added the discussion label 2026-02-16 18:10:38 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 6, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #11142: Bug about watchdog reminder causing excessive token amplification (O(N) growth) - similar reprocessing of already-included messages causing token waste
  • #4659: [FEATURE] Sliding window context management for long-running sessions - proposes inception messages to avoid reprocessing historical context
  • #11829: [FEATURE] Recursive Language Model (RLM) Context Management - suggests model should query context programmatically rather than include all messages to eliminate redundant reprocessing
  • #8932: [FEATURE] Allow pinning important instructions/messages per session to keep them after compaction - addresses context loss and provides mechanism to preserve critical context
  • #8455: [FEATURE] Recursive Language Model as alternative to Compaction - proposes external context storage model

These issues all converge on the same root cause: compaction logic reprocessing messages that have already been summarized, causing token waste and context degradation.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 6, 2026): This issue might be a duplicate of existing issues. Please check: - #11142: Bug about watchdog reminder causing excessive token amplification (O(N) growth) - similar reprocessing of already-included messages causing token waste - #4659: [FEATURE] Sliding window context management for long-running sessions - proposes inception messages to avoid reprocessing historical context - #11829: [FEATURE] Recursive Language Model (RLM) Context Management - suggests model should query context programmatically rather than include all messages to eliminate redundant reprocessing - #8932: [FEATURE] Allow pinning important instructions/messages per session to keep them after compaction - addresses context loss and provides mechanism to preserve critical context - #8455: [FEATURE] Recursive Language Model as alternative to Compaction - proposes external context storage model These issues all converge on the same root cause: compaction logic reprocessing messages that have already been summarized, causing token waste and context degradation. Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8714