Skip to content

fix(history): retain recent messages during summarization#5441

Open
dexhunter wants to merge 1 commit into
Aider-AI:mainfrom
dexhunter:fix/recent-chat-summary-context
Open

fix(history): retain recent messages during summarization#5441
dexhunter wants to merge 1 commit into
Aider-AI:mainfrom
dexhunter:fix/recent-chat-summary-context

Conversation

@dexhunter

Copy link
Copy Markdown

Summary

  • restore the newest budget-fitting head suffix during chat summarization
  • preserve chronological order, the unsummarized tail, and existing recursion
  • cover exact boundaries, nonpositive budgets, call count, and large histories

PR #3764 replaced the previous reverse/select/reverse logic with forward iteration. That also changed selection from the newest head suffix to the oldest prefix, so recent eligible messages could be omitted while much older messages were retained.

Fixes #5440.

Autoresearch

Running autoresearch with Weco reproduced the regression and tested candidate fixes against deterministic context-retention and scaling gates:

https://dashboard.weco.ai/share/DrDbVZz3X8a69GvOUew-jxkxDJw0aE7N

  • context_retention_score: 20.0 to 100.0
  • 14 repeated strict candidate evaluations: 100.0
  • linear scaling retained through a 50,000-message fixture

Validation

  • pytest tests/basic/test_history.py tests/basic/test_coder.py -q: 49 passed, 29 subtests passed
  • focused regression tests: 8 passed, 4 subtests passed
  • Ruff and flake8 pass
  • git diff --check passes

Restore the newest budget-fitting head suffix while preserving chronological order and the unsummarized tail.

Fixes Aider-AI#5440
@CLAassistant

CLAassistant commented Jul 12, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Chat summarization retains the oldest head messages after #3764

2 participants