Skip to main content

shake

Function shake 

Source
pub fn shake(messages: &mut Vec<Message>, config: &ShakeConfig) -> ShakeOutcome
Expand description

Shake the message log: elide large tool results and code blocks from the older portion of messages, leaving the recent protect_window_tokens intact.

If aggregate savings are below min_savings_tokens the call is a no-op: messages is unchanged and the outcome is ShakeOutcome::NoChange. Otherwise every eligible region is replaced in a single pass.