Skip to content

feat(coding-agent): exclude plans from compaction - #251

Merged
Pepps233 merged 3 commits into
mainfrom
feat/better-compaction-with-plans
Sep 29, 2026
Merged

Pepps233 merged 3 commits into
mainfrom
feat/better-compaction-with-plans

Conversation

@Pepps233

@Pepps233 Pepps233 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Exclude historical plan data from compaction and branch summarization while attaching the latest authoritative plan state afterward.

Remove plan data superseded by that snapshot from the resulting model context, including retained messages and earlier summary snapshots.

Reasoning

The plan is persisted separately, so summarizing its history adds duplicate tokens and can preserve obsolete checklists.

An attached snapshot should supersede earlier plan data when restoring context after compaction or tree navigation.

Keep the existing summarizer prompts and their goal, constraints and preferences, progress, key decisions, next steps, and critical context sections unchanged.

Changes

  • Filter plan calls and results from compaction input, including split turns and extension preparation.
  • Strip attached plan snapshots from previous summaries and summary messages before summarization.
  • Apply plan exclusion before branch summarization token budgeting, including the authority paragraph attached by tree navigation.
  • Remove superseded plan calls, results, and summary snapshots from rebuilt model context while preserving retained text, other tool pairs, and subsequent plan updates.
  • Preserve persisted session history, file metadata, and the latest plan's statuses and success criteria.
  • Retain the previous narrative summary when filtering leaves no new history in a split turn.

Testing

  • Reproduced summarizer-input duplication, retained-tail duplication, and embedded snapshots in tree summarization through AgentSession with the faux provider before fixing them.
  • Added coverage for normal and split-turn compaction, repeated compaction after resume, manual and automatic compaction, and active, completed, and cleared plans.
  • Added coverage for retained mixed tool calls, replay, later plan updates, repeated tree summaries, and compaction after tree navigation.
  • npm run check passed.
  • Focused compaction, snapshot, session context, and plan restoration tests passed.
  • ./test.sh passed with local socket access and isolated credentials.

@Pepps233 Pepps233 added enhancement New feature or request coding-agent labels Sep 29, 2026
@Pepps233 Pepps233 self-assigned this Sep 29, 2026
- Let the latest attached snapshot supersede retained plan history without changing persisted entries.
- Exclude compaction and branch snapshots before tree summarization token budgeting.
@Pepps233
Pepps233 merged commit 4a336d1 into main Sep 29, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coding-agent enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant