Skip to main content

manual_compaction_strategy

Function manual_compaction_strategy 

Source
pub fn manual_compaction_strategy(
    provider: &dyn LLMProvider,
    model: &str,
) -> CompactionStrategy
Expand description

Select the manual-compaction strategy for a provider/model.

NativeStandalone when the provider opts in via supports_manual_openai_compaction (e.g. OpenAI /responses/compact), NativeInline when the provider reports inline compaction support via supports_native_inline_compaction (e.g. Anthropic compact_20260112), otherwise Local.

Note: supports_responses_compaction is intentionally not the discriminator for NativeInline. It is overloaded — true for both OpenAI-compatible standalone compaction and Anthropic inline compaction — so OpenAI-compatible custom endpoints (which report it but cannot serve an Anthropic compact_20260112 edit) would otherwise be misrouted to NativeInline and waste a rejected generate call before falling back to Local.