Skip to content

Preserve chat history after summarization#2424

Open
LittleChenLiya wants to merge 4 commits intobytedance:mainfrom
LittleChenLiya:reproduce/issue-2419
Open

Preserve chat history after summarization#2424
LittleChenLiya wants to merge 4 commits intobytedance:mainfrom
LittleChenLiya:reproduce/issue-2419

Conversation

@LittleChenLiya
Copy link
Copy Markdown
Contributor

@LittleChenLiya LittleChenLiya commented Apr 22, 2026

Summary

  • archive messages that are about to be removed by summarization into display_messages
  • hide generated summary messages from the chat UI while keeping them in the model context
  • render archived display messages before the current compressed message state
  • add e2e coverage for the summarized-history display behavior

Root cause

Long-running ultra-mode chats can trigger summarization. The middleware replaces older messages with a summary message for model context management, and the UI renders that same compressed state, so users lose visibility into their original inputs and earlier conversation turns.

Validation

  • cd backend && uv run pytest tests\test_summarization_middleware.py -q
  • cd backend && uvx ruff check .
  • cd backend && uvx ruff format --check .
  • cd frontend && pnpm.cmd format
  • cd frontend && pnpm.cmd lint
  • cd frontend && pnpm.cmd typecheck
  • cd frontend && BETTER_AUTH_SECRET=local-dev-secret pnpm.cmd build
  • cd frontend && pnpm.cmd exec playwright test tests/e2e/chat.spec.ts --config=playwright.edge.local.config.ts --grep "shows archived messages" (local Edge config only, removed after run)

@LittleChenLiya LittleChenLiya marked this pull request as ready for review April 22, 2026 06:13
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