Skip to main content

is_overflow

Function is_overflow 

Source
pub fn is_overflow(
    total_tokens: usize,
    model_context: u32,
    max_output: u32,
    auto_enabled: bool,
) -> bool
Expand description

Returns true when the conversation history exceeds the usable context window.

Compaction is skipped when:

  • auto_enabled is false
  • model_context is 0 (no context limit)

§Arguments

  • total_tokens - Estimated tokens in the full message history.
  • model_context - The model’s maximum context window (0 = unlimited).
  • max_output - The model’s maximum output tokens.
  • auto_enabled - Whether automatic compaction is enabled.