Skip to main content

render_projected

Function render_projected 

Source
pub fn render_projected(
    partitions: &ContextPartitions,
    budget: u32,
    engine: &ContextTokenEngine,
    preserve_recent_msgs: usize,
    handles: &HandleTable,
    frozen_history_len: usize,
) -> RenderedContext
Expand description

Render with Layer-4 read-time projection driven by handles: tool results whose handle is Collapsed render as previews (originals untouched), freeing budget for more recent turns.

Token budget: system_stable + system_knowledge tokens are subtracted first. Remaining budget is allocated to history turns newest-first. The first preserve_recent_msgs history messages are always included. Text messages are truncated at the budget boundary; Parts messages are included whole.