Skip to main content

Module compaction

Module compaction 

Source

Structs§

CompactRange
CompactSummary
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
replace_range_with_summary
spawn_auto_compact
start_auto_compact