Skip to content

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

Closed

Description

@Liuhanlin23

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.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Feb 6, 2026
  2. github-actions commented on Feb 6, 2026

    @github-actions
    Contributor

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

    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.

  3. github-actions commented on Apr 15, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions