Skip to content

[codex] fix compressor summary duplication#5

Merged
pingp76 merged 1 commit into
mainfrom
codex/fix-compressor-summary-duplication
Jun 15, 2026
Merged

[codex] fix compressor summary duplication#5
pingp76 merged 1 commit into
mainfrom
codex/fix-compressor-summary-duplication

Conversation

@pingp76

@pingp76 pingp76 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Stop compactHistory() from feeding the cached lastSummary back into the next generated summary.
  • Keep lastSummary as compressor state only, while summary input now comes from the current blocks view.
  • Add regression coverage for both repeated raw-history compaction and existing summary-block compaction.

Root Cause

compactHistory() previously merged the previous summary from two places: the closure-level lastSummary cache and any summary block already present in oldBlocks. On repeated P2 compaction, this duplicated the same prior summary and inflated context size.

Validation

  • npm run typecheck
  • npx vitest run src/compressor.test.ts
  • npx eslint src/compressor.ts src/compressor.test.ts
  • Earlier full validation in the main worktree: npm test

@pingp76 pingp76 marked this pull request as ready for review June 15, 2026 09:25
@pingp76 pingp76 merged commit add9c04 into main Jun 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant