feat(tui): implement content pruning to manage conversation history size #8646

Open
opened 2026-04-13 21:41:07 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Commit message type: feat
  • Scope: tui
  • Branch name prefix: feat/v3.7.0-content-pruning

Background and Context

As part of Epic #8606 (Settings Screen, Content Pruning & Safety Behaviors), content pruning automatically removes old messages when the conversation history approaches the context window limit. This prevents context window overflow.

This issue blocks Epic #8606.

Expected Behavior

  • Content pruning is triggered when conversation history exceeds a configurable threshold
  • Pruning removes the oldest messages first (LRU eviction)
  • Pruning preserves system messages and the most recent N messages
  • Pruning is configurable (threshold, messages to keep)

Acceptance Criteria

  • Content pruning is triggered when history exceeds threshold
  • Oldest messages are removed first (LRU eviction)
  • System messages are preserved
  • Most recent N messages are preserved (configurable)
  • Pruning threshold is configurable in settings
  • Unit tests verify pruning logic
  • Unit tests achieve >= 97% coverage

Subtasks

  • Implement ContentPruner class with LRU eviction
  • Implement pruning trigger (threshold check)
  • Implement system message preservation
  • Add pruning configuration to settings
  • Write unit tests for pruning logic

Definition of Done

  1. Content pruning is functional
  2. Unit tests verify pruning logic
  3. Unit tests pass with >= 97% coverage
  4. Code reviewed and merged to main branch

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor

## Metadata - **Commit message type**: `feat` - **Scope**: `tui` - **Branch name prefix**: `feat/v3.7.0-content-pruning` ## Background and Context As part of Epic #8606 (Settings Screen, Content Pruning & Safety Behaviors), content pruning automatically removes old messages when the conversation history approaches the context window limit. This prevents context window overflow. This issue blocks Epic #8606. ## Expected Behavior - Content pruning is triggered when conversation history exceeds a configurable threshold - Pruning removes the oldest messages first (LRU eviction) - Pruning preserves system messages and the most recent N messages - Pruning is configurable (threshold, messages to keep) ## Acceptance Criteria - [ ] Content pruning is triggered when history exceeds threshold - [ ] Oldest messages are removed first (LRU eviction) - [ ] System messages are preserved - [ ] Most recent N messages are preserved (configurable) - [ ] Pruning threshold is configurable in settings - [ ] Unit tests verify pruning logic - [ ] Unit tests achieve >= 97% coverage ## Subtasks - [ ] Implement `ContentPruner` class with LRU eviction - [ ] Implement pruning trigger (threshold check) - [ ] Implement system message preservation - [ ] Add pruning configuration to settings - [ ] Write unit tests for pruning logic ## Definition of Done 1. Content pruning is functional 2. Unit tests verify pruning logic 3. Unit tests pass with >= 97% coverage 4. Code reviewed and merged to main branch --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
HAL9000 added this to the v3.7.0 milestone 2026-04-13 21:50:36 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#8646
No description provided.