[COORD-011] Implement compaction #151

Closed
opened 2026-01-31 21:05:06 +00:00 by jason.woltje · 0 comments
Owner

Objective

Implement context compaction that frees memory when agents reach 80% context usage.

Implementation Details

Build compaction from Part 1:

Compaction process:

  • Detect 80% context threshold
  • Request summary from agent (completed work, patterns, decisions)
  • Replace conversation history with concise summary
  • Validate context reduction achieved

Goal: Free 40-50% of context through summarization.

Context Estimate

  • Files to modify: 1 (context_monitor.py)
  • Implementation complexity: medium (20,000 tokens)
  • Test requirements: medium (10,000 tokens)
  • Documentation: medium (3,000 tokens)
  • Total estimated: 46,800 tokens
  • Recommended agent: glm

Difficulty

medium

Dependencies

  • Blocked by: #157 (COORD-010)
  • Blocks: #159 (COORD-012)

Acceptance Criteria

  • Compaction triggered at 80% context threshold
  • Summary prompt generates concise work summary
  • Conversation history replaced with summary
  • Context reduction measured (target: 40-50%)
  • Compaction logged with before/after metrics
  • Unit tests (85% coverage minimum)

Testing Requirements

  • Mock agent context at 80% threshold
  • Test summary generation
  • Test conversation replacement
  • Measure context reduction effectiveness
  • Test compaction failure handling
  • Coverage: 85% minimum
## Objective Implement context compaction that frees memory when agents reach 80% context usage. ## Implementation Details Build compaction from Part 1: Compaction process: - Detect 80% context threshold - Request summary from agent (completed work, patterns, decisions) - Replace conversation history with concise summary - Validate context reduction achieved Goal: Free 40-50% of context through summarization. ## Context Estimate - Files to modify: 1 (context_monitor.py) - Implementation complexity: medium (20,000 tokens) - Test requirements: medium (10,000 tokens) - Documentation: medium (3,000 tokens) - **Total estimated: 46,800 tokens** - **Recommended agent: glm** ## Difficulty medium ## Dependencies - Blocked by: #157 (COORD-010) - Blocks: #159 (COORD-012) ## Acceptance Criteria - [ ] Compaction triggered at 80% context threshold - [ ] Summary prompt generates concise work summary - [ ] Conversation history replaced with summary - [ ] Context reduction measured (target: 40-50%) - [ ] Compaction logged with before/after metrics - [ ] Unit tests (85% coverage minimum) ## Testing Requirements - Mock agent context at 80% threshold - Test summary generation - Test conversation replacement - Measure context reduction effectiveness - Test compaction failure handling - Coverage: 85% minimum
jason.woltje added the apiapip0phase-4 labels 2026-01-31 21:05:06 +00:00
jason.woltje added this to the M4.1-Coordinator (0.0.4) milestone 2026-01-31 21:10:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#151