Skip to main content

Module compaction

Module compaction 

Source

Structs§

CompactRange
CompactSummary
CompactionBudgetContext
HandleAutoCompactResult
Result of applying the automatic compaction policy to an isolated message handle. The caller must hold that handle’s async compaction lock.
HandleCompactResult
Result of compacting a messages_handle in place.

Constants§

KEEP_RECENT_MESSAGES
KEEP_RECENT_USER_TURNS

Functions§

compact_messages_on_handle
Compact a messages_handle in place (data-layer primitive, operates on any FlowRun’s segment). Returns None if under budget or no compactable range. Caller should hold the FlowRun’s compact_lock.
estimate_compacted_message_tokens
estimate_tokens_for_message
estimate_tokens_for_messages
filter_orphan_tool_messages
find_compact_range
find_compact_summaries
is_compaction_summary
is_plan_related
maybe_auto_compact
maybe_auto_compact_handle_locked
Apply the root compaction budget, range, summary, and replacement policy to an isolated message handle. This function does not acquire the async lock and does not emit session events.
maybe_auto_compact_with_budget
replace_range_with_summary
spawn_auto_compact
start_auto_compact
start_auto_compact_with_budget