Skip to main content

Module compression_tooling

Module compression_tooling 

Source

Structs§

CompressionCandidatePlan
Immutable archive selection and summary input prepared before model requests. Tools may be archived without entering a MessageSummary source.
CompressionPlan
A concrete archive selection and replacement summary. Message-summary archives may include tools that are deliberately excluded from its source.
ContextCompressionExposure
Metadata about current context pressure, used to decide when compression should be requested by host-side control flow.

Enums§

CompressionPlanError
Structured reason why a compression plan could not be built.

Constants§

DEFAULT_SUMMARY_TARGET_RATIO

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_plan that accounts for fixed prompt blocks rendered outside Session.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