Chat History Compaction for UI Performance

Problem

When chat sessions become long, the interface begins to lag significantly. This impacts usability and forces users to start new chats, which disrupts workflow and loses valuable context. Many users prefer to maintain a continuous thread, especially when working on complex coding tasks or debugging over time.

Solution

Implement a Chat History Compaction feature that:

  • Automatically summarizes and collapses older messages into a structured block when the chat exceeds a certain length.

  • Allows manual triggering via a command like /compact.

  • Provides expandable summaries so users can revisit full history if needed.

  • Keeps the visible chat lightweight while preserving full context for the AI.

This solves the performance degradation caused by long chat histories and improves user experience by allowing conversations to continue seamlessly without needing to start over. It also helps retain important context and decisions made earlier in the session.

Priority

:yellow_circle: Medium - Important improvement

While not a blocking issue, it significantly affects usability and performance in longer sessions, which are common among power users.