Skip to main content

compile_context

Function compile_context 

Source
pub fn compile_context(
    hits: &[Hit],
    counter: &dyn TokenCounter,
    budget: &ContextBudget,
) -> Result<ContextPacket>
Expand description

Whole-entry packing. Checks the actual escaped envelope, including overhead. No entry is cut mid-negation or mid-JSON. This packet belongs in append-only tool/history context, never a rewritten system prompt on every turn.