II.
Page overview
Reference · livepage:docs-harness-features-backlog-gaps-performance-gap-perf-002
GAP-PERF-002: Session Compaction overview
Inspect the raw attributes, linked wiki pages, and inbound or outbound graph edges for page:docs-harness-features-backlog-gaps-performance-gap-perf-002.
Attributes
nodeKind
Page
sourcePath
docs/harness-features-backlog/gaps/performance/GAP-PERF-002.md
sourceKind
repo-docs
title
GAP-PERF-002: Session Compaction
displayName
GAP-PERF-002: Session Compaction
slug
docs/harness-features-backlog/gaps/performance/gap-perf-002
articlePath
wiki/docs/harness-features-backlog/gaps/performance/GAP-PERF-002.md
article
# GAP-PERF-002: Session Compaction
| Field | Value |
|-------|-------|
| Category | performance |
| Priority | Critical |
| Effort | XL |
| Status | Partial |
## Description
Implement session-level compaction that summarizes and condenses orchestration history, preventing context window overflow during long runs.
## Current State
The compression module provides FNV-1a hash-based dedup and library file caching. This is token-level compression, not session-level compaction. The harness never summarizes or condenses conversation history.
## Target State
Multiple compaction strategies: tool-output summarization, resolved effect pruning, iteration digest. Auto-compact trigger based on token budget thresholds. PreCompact/PostCompact hooks for custom behavior.
## Dependencies
- [GAP-PROMPT-001](../prompt-engineering/GAP-PROMPT-001.md) -- prompt strata model for identifying compactable sections
## Key Files
| Component | Path |
|-----------|------|
| Compression module | `packages/babysitter-sdk/src/compression/` |
| Hook dispatcher | `packages/babysitter-sdk/src/hooks/dispatcher.ts` |
| State cache | `packages/babysitter-sdk/src/runtime/replay/stateCache.ts` |
## Recommendation
Phase 3 implementation. Auto-compact trigger at token budget threshold. At least 2 strategies: tool-output summarization and iteration digest. Integrate via on-iteration-end hook.
documents
[]
Outgoing edges
None.
Incoming edges
contains_page1
- page:docs-harness-features-backlog·PageHarness Features Backlog: Gap Analysis (Restructured)