{"record":{"id":"aee4326a6a60dab6","repo":"Hmbown/CodeWhale","slug":"compaction-summary-response-was-unusable-a-placeh","errorCode":null,"errorMessage":"Compaction summary response was unusable: a placeholder was returned.","messagePattern":"Compaction summary response was unusable: a placeholder was returned\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/compaction.rs","lineNumber":1536,"sourceCode":"        .to_ascii_lowercase();\n    if normalized.is_empty() {\n        anyhow::bail!(\n            \"Compaction summary response was unusable: only whitespace or punctuation was returned.\"\n        );\n    }\n    if matches!(\n        normalized.as_str(),\n        \"no summary available\"\n            | \"summary unavailable\"\n            | \"no summary\"\n            | \"n/a\"\n            | \"na\"\n            | \"not available\"\n            | \"i cannot provide a summary\"\n            | \"i can't provide a summary\"\n            | \"unable to provide a summary\"\n    ) {\n        anyhow::bail!(\"Compaction summary response was unusable: a placeholder was returned.\");\n    }\n    Ok(())\n}\n\n/// Drop the oldest history message before retrying an over-window summary\n/// request (Codex parity: `history.remove_first_item()`), plus any tool\n/// results the removal orphans — strict providers reject unpaired results.\nfn drop_oldest_history_messages(messages: &mut Vec<Message>) {\n    if messages.len() <= 1 {\n        return;\n    }\n    messages.remove(0);\n    while messages.len() > 1\n        && messages[0]\n            .content\n            .iter()\n            .any(|block| matches!(block, ContentBlock::ToolResult { .. }))\n    {","sourceCodeStart":1518,"sourceCodeEnd":1554,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/compaction.rs#L1518-L1554","documentation":"Compaction asks the model to summarize the session history, then validates the summary before replacing history. This error means the model's summary response matched a known placeholder pattern (e.g. \"n/a\", \"i cannot provide a summary\"), so it carries no usable content. The library refuses to overwrite session history with a placeholder.","triggerScenarios":"A compaction/summary request completes and the returned text, lowercased and trimmed, equals one of the placeholder strings such as \"na\", \"not available\", or \"i cannot/can't/unable to provide a summary\".","commonSituations":"A small or heavily quantized local model fails to follow the summary prompt and answers with a refusal or empty placeholder; a provider router strips the real content; a prompt template change makes the summary instruction unclear so the model declines.","solutions":["Inspect the raw provider response for the summary request to confirm the model actually returned a refusal/placeholder.","Retry compaction — transient model confusion often resolves on a second request.","Strengthen or fix the summary prompt so the model produces a real summary (clear instruction to summarize the conversation).","Switch to a model that reliably follows the summary instruction.","Report/persist the original conversation — this error intentionally leaves history untouched."],"exampleFix":"// model returned a placeholder summary\nlet summary = \"I can't provide a summary\";\n// after: prompt asks for an explicit structured summary\n\"Summarize the conversation above in 5-10 sentences. Do not refuse or reply with a placeholder.\"","handlingStrategy":"validation","validationCode":"fn is_placeholder_summary(t: &str) -> bool {\n    matches!(t.trim().to_lowercase().as_str(), \"na\" | \"n/a\" | \"not available\" | \"i cannot provide a summary\" | \"i can't provide a summary\" | \"unable to provide a summary\")\n}","typeGuard":"if is_placeholder_summary(&summary_text) { /* treat as unusable */ }","tryCatchPattern":"match compaction::summarize(&history) {\n    Err(e) if e.to_string().contains(\"placeholder was returned\") => retry_with_stronger_prompt(),\n    Err(e) => return Err(e),\n    Ok(summary) => apply(summary),\n}","preventionTips":["Use a model known to follow summary instructions","Include an explicit 'do not refuse' clause in the summary prompt","Log the raw summary response for diagnosis","Keep the original conversation intact until the summary validates"],"tags":["compaction","llm-response","placeholder-summary"],"backgroundTag":"unexpected-response-shape","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}