Skip to main content

validate_compaction

Function validate_compaction 

Source
pub async fn validate_compaction(
    provider: &AnyProvider,
    messages: &[Message],
    summary: &str,
    config: &CompactionProbeConfig,
) -> Result<Option<CompactionProbeResult>, MemoryError>
Expand description

Run the compaction probe: generate questions, answer them from the summary, score results.

Returns Ok(None) when:

  • Probe is disabled (config.enabled = false)
  • The probe times out
  • Fewer than 2 questions are generated (insufficient statistical power)

The caller treats None as “no opinion” and proceeds with compaction.

§Errors

Returns MemoryError if an LLM call fails. Callers should treat this as non-fatal and proceed with compaction.