Structs§
- Compression
Candidate Plan - Immutable archive selection and summary input prepared before model requests. Tools may be archived without entering a MessageSummary source.
- Compression
Plan - A concrete archive selection and replacement summary. Message-summary archives may include tools that are deliberately excluded from its source.
- Context
Compression Exposure - Metadata about current context pressure, used to decide when compression should be requested by host-side control flow.
Enums§
- Compression
Plan Error - Structured reason why a compression plan could not be built.
Constants§
Functions§
- active_
messages_ for_ budget - apply_
compression_ plan - build_
compression_ plan_ with_ summary - Build a compression plan that archives older active messages and replaces them with a caller-provided summary.
- build_
forced_ compression_ candidate_ plan - Select the exact archive candidates before invoking the summarization model.
- build_
forced_ compression_ candidate_ plan_ with_ fixed_ tokens - Variant of
build_forced_compression_candidate_planthat accounts for fixed prompt blocks rendered outsideSession.messages(for example task, plan, workflow, project-resource, and external-memory context blocks). - build_
forced_ compression_ plan_ with_ summary - Build a compression plan while bypassing “tool exposure” gating.
- build_
message_ summary_ candidate_ plan_ with_ fixed_ tokens - Archive all eligible active history, retaining the current user request and
explicit prose anchors, while summarizing only user/assistant
content. - build_
summary_ prompt - compression_
summary_ message - context_
window_ usage_ percent - estimate_
context_ compression_ exposure - Estimate whether context pressure has crossed the configured threshold for compression eligibility.
- estimate_
context_ compression_ exposure_ with_ fixed_ tokens - Fixed-token-aware variant used when provider-visible context lives outside
Session::messages(for example, the durable model-context ledger). - finalize_
compression_ candidate_ plan - Bind a completed summary to a previously selected candidate set and verify the real post-compression prompt before any session mutation occurs.
- normalized_
summary_ target_ ratio - normalized_
trigger_ percent - summary_
source_ messages