MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / should_prune

Method should_prune

crates/opencode-session/src/compaction.rs:367–379  ·  view source on GitHub ↗
(messages: &[MessageForPrune])

Source from the content-addressed store, hash-verified

365 }
366
367 fn should_prune(messages: &[MessageForPrune]) -> bool {
368 for msg in messages {
369 for part in &msg.parts {
370 if !part.tool.is_empty()
371 && part.status == ToolPartStatus::Completed
372 && part.compacted.is_none()
373 {
374 return true;
375 }
376 }
377 }
378 false
379 }
380
381 pub fn create_compaction_part(auto: bool) -> CompactionPart {
382 // Plugin hook: session.compacting — notify plugins that compaction is starting.

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected