| Agent | Trigger Threshold | Compression Strategy | Auxiliary Model | Token Tracking |
|---|---|---|---|---|
| Phosphor | 80% (configurable) | LLM summary; optional embedded dlgo model | Yes β main, small, or embedded (dlgo) |
(chars + 3) / 4 estimate |
| Oh-My-Pi | 80% (configurable) | 3 strategies: context-full, handoff, snapcompact (bitmap images) | Optional handoff task | Model-aware token budget |
| Hermes-Agent | 50% (configurable) | Pluggable ContextEngine (lossy LLM summary default) | Yes (configurable auxiliary model/provider) | API-reported + rough char estimate |
| OpenCode | Budget-based (window - buffer) | Checkpoint (summary + serialized context) | No | Local estimate vs. reserved headroom |
| Dimension | Phosphor | Oh-My-Pi | Hermes | OpenCode |
|---|---|---|---|---|
| Primary trigger | Threshold: currentTokens / contextWindow >= threshold |
6 scenarios: threshold, overflow, incomplete, idle, mid-turn, manual | Dual: agent compressor (50%) + gateway hygiene (85%) | Request size vs. contextWindow - buffer |
| Overflow recovery | AggressiveBuild retry on overflow |
Context promotion first, then compaction; agent.continue() retry |
Gateway safety net at 85% | One overflow-triggered compaction attempt |
| Pre-compaction pruning | PruneAndBuild(msgs, 200) |
Tool-output pruning + useless-result elision | Phase 1: prune old tool results (>200 chars) | Deferred |
| Mid-turn check | None | Yes (midTurnEnabled) |
None | None |
| Idle maintenance | None | Yes (runIdleCompaction()) |
None | None |
| Dimension | Phosphor | Oh-My-Pi | Hermes | OpenCode |
|---|---|---|---|---|
| Summary method | LLM generates summary message | LLM summary or snapcompact bitmap archival | Auxiliary LLM with structured template | Hidden checkpoint with rolling summary |
| Summary template | templates/summary.md (state, files, context, strategy, next steps) |
prompts/compaction-summary-context.md |
Structured: Goal, Constraints, Progress, Decisions, Files, Next Steps | Structured rolling summary + token-bounded serialized context |
| Iterative update | Yes β previous summary prepended | New summary each compaction | Yes β previous summary passed for update | Yes β repeated compactions update prior summary |
| Summary model | Configurable: main, small, embedded |
Main model or none (snapcompact) | Auxiliary model (configurable) | Not specified |
# Phosphor
options:
disable_auto_summarize: false
summarize_threshold: 0.8
summarize_model: main # 'main', 'small', or 'embedded'
summarize_prune_chars: 200
summarize_prune_aggressive_chars: 50
# Oh-My-Pi
compaction:
enabled: true
strategy: context-full # or: handoff, snapcompact
threshold: 0.8
midTurnEnabled: true
autoContinue: true
dropUseless: true
snapcompact:
shape: auto
maxFrames: 80
# Hermes
compression:
enabled: true
threshold: 0.50
target_ratio: 0.20
protect_last_n: 20
codex_gpt55_autoraise: true
auxiliary:
compression:
model: null
provider: auto
# OpenCode
compaction:
auto: true
prune: false
keep.tokens: 20000
buffer: 4000-
Oh-My-Pi snapcompact: Unique bitmap-image archival β no API call needed. Model-aware frame shapes (Claude: 11on16-bw, Gemini: 8on22-bw). Cheapest compaction but requires vision-capable model.
-
Hermes dual-layer: Gateway hygiene (85%) as safety net + agent compressor (50%) as primary. Anthropic prompt caching integrated with compaction.
-
Hermes auxiliary model: Dedicated summary model keeps cost low and offloads the main model. Summary budget scales with content size.
-
OpenCode checkpoint model: Durable full transcript preserved; compaction creates a hidden checkpoint that replaces the model-visible representation. Context Epoch baseline rebuilds after compaction.
-
Phosphor: Configurable summary model (
main,small,embeddeddlgo). Supports iterative compaction (previous summary prepended), pre-compaction pruning (PruneAndBuildat 200-char limit), and overflow recovery with aggressive pruning retry. Threshold-based trigger remains at 80%.
| Feature | Available In |
|---|---|
| Multiple compaction strategies | Oh-My-Pi |
| Pre-compaction tool-output pruning | Phosphor, Oh-My-Pi, Hermes |
| Auxiliary/cheaper summary model | Phosphor, Hermes |
| Dual-layer safety net | Hermes |
| Context Epoch / checkpoint model | OpenCode |
| Mid-turn compaction | Oh-My-Pi |
| Idle maintenance | Oh-My-Pi |
| Bitmap archival (no API) | Oh-My-Pi |
| Anthropic prompt caching | Hermes |
| Iterative summary updates | Phosphor, Hermes, OpenCode |