{"record":{"id":"2ce809bc7dec50a2","repo":"Hmbown/CodeWhale","slug":"compaction-summary-response-was-unusable-only-whi","errorCode":null,"errorMessage":"Compaction summary response was unusable: only whitespace or punctuation was returned.","messagePattern":"Compaction summary response was unusable: only whitespace or punctuation was returned\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/compaction.rs","lineNumber":1520,"sourceCode":"    prompt\n}\n\nfn validate_compaction_summary(summary: &str) -> Result<()> {\n    let trimmed = summary.trim();\n    if trimmed.is_empty() {\n        anyhow::bail!(\"Compaction summary response was unusable: no text was returned.\");\n    }\n\n    // Strip every non-word edge, not just ASCII punctuation. Providers can\n    // return visually non-empty Unicode punctuation or emoji-only payloads;\n    // neither is a usable continuation checkpoint. `is_alphanumeric` keeps\n    // this language-neutral for CJK and other scripts without imposing a\n    // prose-length heuristic.\n    let normalized = trimmed\n        .trim_matches(|ch: char| !ch.is_alphanumeric())\n        .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(())","sourceCodeStart":1502,"sourceCodeEnd":1538,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/compaction.rs#L1502-L1538","documentation":"After trimming, validate_compaction_summary strips all non-alphanumeric edge characters (Unicode-aware, lowercased) and bails if nothing remains. This rejects summaries that are visually non-empty but contain no words — punctuation-only, emoji-only, or the literal placeholder `no summary available` and similar sentinel phrases — since none form a usable continuation checkpoint.","triggerScenarios":"The model returns a summary consisting solely of punctuation/emoji, or a recognized degenerate phrase like `no summary available`, `no summary`, `nothing to summarize`, etc.","commonSituations":"Weak or heavily quantized models producing placeholder answers; summarizing conversations the model judges to have no content; prompt/model mismatches where the summarizer does not follow instructions.","solutions":["Retry with the same or a stronger summarization model","Configure a different compaction model that follows summarization instructions","Shorten or simplify the conversation before compacting","Start a fresh session if summaries are consistently unusable"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"function isUsableSummary(s: string): boolean {\n  const norm = s.trim().replace(/^\\P{L}\\P{N}+|\\P{L}\\P{N}+$/gu, '').toLowerCase();\n  return norm.length > 0 && norm !== 'no summary available';\n}","typeGuard":"const isAlphanumericCore = (s: string): boolean =>\n  s.trim().split('').some(c => c.isAlphanumeric());","tryCatchPattern":"let summary = retry(3, async () => {\n  const s = await summarize();\n  if (!s.trim().replace(/^[^\\p{L}\\p{N}]+|[^\\p{L}\\p{N}]+$/gu, '')) throw new Retryable();\n  return s;\n});","preventionTips":["Use a competent summarization model; placeholder outputs indicate instruction non-compliance","Recognize sentinel phrases (no summary available, etc.) as failures upstream","Retry once before giving up — placeholder replies are often one-off","Consider adding explicit summarization instructions to the compaction prompt"],"tags":["compaction","invalid-response","llm"],"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"}