{"record":{"id":"ac32d939fe9beb94","repo":"zed-industries/zed","slug":"compaction-produced-an-empty-summary","errorCode":null,"errorMessage":"Compaction produced an empty summary","messagePattern":"Compaction produced an empty summary","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent/src/thread.rs","lineNumber":3267,"sourceCode":"                    | LanguageModelCompletionEvent::Thinking { .. }\n                    | LanguageModelCompletionEvent::RedactedThinking { .. }\n                    | LanguageModelCompletionEvent::ReasoningDetails(_)\n                    | LanguageModelCompletionEvent::ToolUse(_)\n                    | LanguageModelCompletionEvent::ToolUseJsonParseError { .. }\n                    | LanguageModelCompletionEvent::StartMessage { .. }\n                    | LanguageModelCompletionEvent::Compaction(_) => {}\n                }\n            }\n\n            if *cancellation_rx.borrow() {\n                log::debug!(\"Compaction cancelled after summarizing\");\n                return Ok(ControlFlow::Break(()));\n            }\n\n            let summary = summary.trim().to_string();\n            if summary.is_empty() {\n                log::warn!(\"Compaction produced an empty summary\");\n                return Err(anyhow::anyhow!(\"Compaction produced an empty summary\"));\n            }\n\n            log::debug!(\"Compaction succeeded:\\n{summary}\");\n            event_stream.update_context_compaction_status(\n                compaction_id.clone(),\n                acp_thread::ContextCompactionStatus::Completed,\n            );\n\n            this.update(cx, |this, cx| {\n                let compaction =\n                    Arc::new(Message::Compaction(CompactionInfo::Summary(summary.into())));\n                match insertion {\n                    CompactionInsertion::Auto { insertion_ix } => {\n                        if insertion_ix <= this.messages.len() {\n                            this.messages.insert(insertion_ix, compaction);\n                        } else {\n                            this.messages.push(compaction);\n                        }","sourceCodeStart":3249,"sourceCodeEnd":3285,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/agent/src/thread.rs#L3249-L3285","documentation":"Post-compaction sanity check in Thread: the summarization request completed but yielded an empty summary. Rather than replacing history with nothing (which would lose all context), the compaction fails with this error.","triggerScenarios":"Thrown at crates/agent/src/thread.rs:3226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry compaction; transient model failures can produce empty summaries","Check the model's availability and that it supports summarization-style prompts","Reduce the history size or compact in smaller chunks if the model keeps returning empty output"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-09-19T19:09:50.599Z","contentChangedAt":"2026-09-19T19:09:50.599Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}