{"record":{"id":"93e0dea60b8900f0","repo":"zed-industries/zed","slug":"openai-compaction-output-did-not-contain-a-recogni","errorCode":null,"errorMessage":"OpenAI compaction output did not contain a recognized compaction item (output types: {item_types})","messagePattern":"OpenAI compaction output did not contain a recognized compaction item \\(output types: (.+?)\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/open_ai/src/responses.rs","lineNumber":164,"sourceCode":"    if items.is_empty() {\n        return Err(anyhow!(\"OpenAI returned an empty compaction output\"));\n    }\n    if !items.iter().any(|item| {\n        item.get(\"type\")\n            .and_then(Value::as_str)\n            .is_some_and(|item_type| {\n                matches!(\n                    item_type,\n                    \"compaction\" | \"compaction_summary\" | \"context_compaction\"\n                )\n            })\n    }) {\n        let item_types = items\n            .iter()\n            .filter_map(|item| item.get(\"type\").and_then(Value::as_str))\n            .collect::<Vec<_>>()\n            .join(\", \");\n        return Err(anyhow!(\n            \"OpenAI compaction output did not contain a recognized compaction item \\\n             (output types: {item_types})\"\n        ));\n    }\n    Ok(())\n}\n\n#[derive(Debug, Default)]\npub struct ResponseInput {\n    provider_items: Vec<Value>,\n    generated_items: Vec<ResponseInputItem>,\n}\n\nimpl ResponseInput {\n    pub fn new(provider_items: Vec<Value>, generated_items: Vec<ResponseInputItem>) -> Self {\n        Self {\n            provider_items,\n            generated_items,","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/open_ai/src/responses.rs#L146-L182","documentation":"Validation in validate_compaction_items: the compaction output contained items but none whose `type` is a recognized compaction variant (compaction/compaction_summary/context_compaction); the listed types are embedded for diagnosis. The output cannot be used as a replacement window.","triggerScenarios":"Thrown at crates/open_ai/src/responses.rs:164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request; the API may have returned an unexpected shape transiently","Fall back to full-transcript replay","Check for OpenAI Responses API schema changes if persistent"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}