{"record":{"id":"fa15490e51a3ffaa","repo":"zed-industries/zed","slug":"provider-does-not-support-explicit-compaction","errorCode":null,"errorMessage":"{provider} does not support explicit compaction","messagePattern":"(.+?) does not support explicit compaction","errorType":"exception","errorClass":"LanguageModelCompletionError","httpStatus":null,"severity":"error","filePath":"crates/language_model/src/language_model.rs","lineNumber":160,"sourceCode":"    }\n\n    fn supports_explicit_compaction(&self) -> bool {\n        false\n    }\n\n    /// The provider-enforced input size required for explicit compaction.\n    fn minimum_explicit_compaction_input_tokens(&self) -> Option<u64> {\n        None\n    }\n\n    fn compact(\n        &self,\n        _request: LanguageModelRequest,\n        _cx: &AsyncApp,\n    ) -> BoxFuture<'static, Result<CompactionResult, LanguageModelCompletionError>> {\n        let provider = self.provider_name();\n        async move {\n            Err(LanguageModelCompletionError::Other(anyhow::anyhow!(\n                \"{provider} does not support explicit compaction\"\n            )))\n        }\n        .boxed()\n    }\n\n    /// Whether this model supports images\n    fn supports_images(&self) -> bool;\n\n    /// Whether this model supports tools.\n    fn supports_tools(&self) -> bool;\n\n    /// Whether this model supports choosing which tool to use.\n    fn supports_tool_choice(&self, choice: LanguageModelToolChoice) -> bool;\n\n    /// Returns whether this model or provider supports streaming tool calls;\n    fn supports_streaming_tools(&self) -> bool {\n        false","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/language_model/src/language_model.rs#L142-L178","documentation":"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.","triggerScenarios":"Thrown at crates/language_model/src/language_model.rs:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check `supports_explicit_compaction()` before calling compact and skip or use client-side compaction instead","Implement compact on the provider if it should support explicit compaction","Choose a model that supports explicit compaction for workflows that require it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}