Re-exports§
pub use crate::compaction::memory_envelope::effective_context_budget;pub use crate::compaction::memory_envelope::effective_session_context_budget;pub use crate::compaction::prefire::AsyncCompactionCache;pub use crate::compaction::prefire::PrefireState;
Modules§
- auto
- Unified automatic compaction orchestration.
- memory_
envelope - Session memory envelope + local compaction helpers, shared by every
compaction path (auto, manual
/compact, model-switch, recovery, fork). - prefire
- two_
pass - Pure builders for prefire two-pass compaction.
Structs§
- Compaction
Config - Compaction configuration for context window management.
- Compaction
Parent Context - Parent request prefix for cache-safe compaction forking.
- Compaction
Route Policy - Per-route compaction policy in the DeepSeek-harness shape.
- Manual
Compaction Options - Universally meaningful manual-compaction options.
Enums§
- Compaction
Strategy - How the manual
/compactcommand compacts for a given provider/model.
Constants§
Functions§
- bound_
compacted_ history_ to_ context - Bound a locally managed compacted history to the resolved context budget, including any caller-supplied session ceiling. Standalone native responses must bypass this helper: their retained items and opaque continuation state are the provider’s canonical next context window.
- build_
cache_ safe_ compaction_ history - Build a cache-safe compaction history: the parent’s full conversation prefix verbatim, plus the compaction instruction as the only new turn. From the provider’s perspective this looks nearly identical to the parent’s last request, so the cached prefix is reused.
- compact_
history - Compact conversation history using the configured summarizer.
- compact_
history_ manual - Compact history for the manual
/compactcommand using provider-native compaction when available, falling back to local summarization otherwise. - compact_
history_ manual_ with_ budget - Manual compaction with the resolved session context budget applied to native request inputs and locally rebuilt summaries. Native provider responses are returned unchanged so opaque continuation state remains valid.
- compact_
history_ manual_ with_ parent_ context - Manual compaction that reuses the parent segment’s cached prefix.
- compact_
history_ with_ budget - Compact conversation history using a caller-resolved context budget for input bounding and locally rebuilt output. Standalone native responses are returned as the provider’s canonical next context window.
- compacted_
history_ shrinks - Whether a compaction result is worth keeping.
- manual_
compaction_ strategy - Select the manual-compaction strategy for a provider/model.