zed-industries/zed · error · LanguageModelCompletionError

{provider} does not support explicit compaction

Error message

{provider} does not support explicit compaction

What it means

Default trait-method guard in LanguageModel::compact: the base implementation always fails because a provider that hasn't overridden supports_explicit_compaction/compact does not implement provider-side explicit compaction. Calling compact on such a model (via {provider}) is a programming/configuration error — the caller should have checked supports_explicit_compaction first. Sentinel: fires whenever compact is invoked on a model whose provider uses the default trait implementation.

Source

Thrown at crates/language_model/src/language_model.rs:160

    }

    fn supports_explicit_compaction(&self) -> bool {
        false
    }

    /// The provider-enforced input size required for explicit compaction.
    fn minimum_explicit_compaction_input_tokens(&self) -> Option<u64> {
        None
    }

    fn compact(
        &self,
        _request: LanguageModelRequest,
        _cx: &AsyncApp,
    ) -> BoxFuture<'static, Result<CompactionResult, LanguageModelCompletionError>> {
        let provider = self.provider_name();
        async move {
            Err(LanguageModelCompletionError::Other(anyhow::anyhow!(
                "{provider} does not support explicit compaction"
            )))
        }
        .boxed()
    }

    /// Whether this model supports images
    fn supports_images(&self) -> bool;

    /// Whether this model supports tools.
    fn supports_tools(&self) -> bool;

    /// Whether this model supports choosing which tool to use.
    fn supports_tool_choice(&self, choice: LanguageModelToolChoice) -> bool;

    /// Returns whether this model or provider supports streaming tool calls;
    fn supports_streaming_tools(&self) -> bool {
        false

View on GitHub (pinned to f4178619ac)

Solutions

  1. Check `supports_explicit_compaction()` before calling compact and skip or use client-side compaction instead
  2. Implement compact on the provider if it should support explicit compaction
  3. Choose a model that supports explicit compaction for workflows that require it
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/language_model/src/language_model.rs:160 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/fa15490e51a3ffaa. Report an issue: GitHub.