Hmbown/CodeWhale · error

Compaction summary response was unusable: only whitespace…

Error message

Compaction summary response was unusable: only whitespace or punctuation was returned.

What it means

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.

Solutions

  1. Retry with the same or a stronger summarization model
  2. Configure a different compaction model that follows summarization instructions
  3. Shorten or simplify the conversation before compacting
  4. Start a fresh session if summaries are consistently unusable
Defensive patterns

Strategy: retry

Validate before calling

function isUsableSummary(s: string): boolean {
  const norm = s.trim().replace(/^\P{L}\P{N}+|\P{L}\P{N}+$/gu, '').toLowerCase();
  return norm.length > 0 && norm !== 'no summary available';
}

Type guard

const isAlphanumericCore = (s: string): boolean =>
  s.trim().split('').some(c => c.isAlphanumeric());

Try / catch

let summary = retry(3, async () => {
  const s = await summarize();
  if (!s.trim().replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, '')) throw new Retryable();
  return s;
});

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/2ce809bc7dec50a2. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/compaction.rs:1520

    prompt
}

fn validate_compaction_summary(summary: &str) -> Result<()> {
    let trimmed = summary.trim();
    if trimmed.is_empty() {
        anyhow::bail!("Compaction summary response was unusable: no text was returned.");
    }

    // Strip every non-word edge, not just ASCII punctuation. Providers can
    // return visually non-empty Unicode punctuation or emoji-only payloads;
    // neither is a usable continuation checkpoint. `is_alphanumeric` keeps
    // this language-neutral for CJK and other scripts without imposing a
    // prose-length heuristic.
    let normalized = trimmed
        .trim_matches(|ch: char| !ch.is_alphanumeric())
        .to_ascii_lowercase();
    if normalized.is_empty() {
        anyhow::bail!(
            "Compaction summary response was unusable: only whitespace or punctuation was returned."
        );
    }
    if matches!(
        normalized.as_str(),
        "no summary available"
            | "summary unavailable"
            | "no summary"
            | "n/a"
            | "na"
            | "not available"
            | "i cannot provide a summary"
            | "i can't provide a summary"
            | "unable to provide a summary"
    ) {
        anyhow::bail!("Compaction summary response was unusable: a placeholder was returned.");
    }
    Ok(())

View on GitHub (pinned to 73e0f67d83)