Hmbown/CodeWhale · error

Compaction summary response was unusable: only whitespace or

Error message

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

What it means

After trimming every non-alphanumeric edge character, nothing remains: the payload was whitespace, punctuation, or emoji only (crates/tui/src/compaction.rs:1137). is_alphanumeric keeps the check language-neutral for CJK; visually non-empty punctuation or emoji-only payloads are not usable checkpoints.

Source

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

    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 8880682c63)

Solutions

  1. Retry - punctuation-only outputs are usually one-off sampling artifacts
  2. Lower or normalize the compaction sampling temperature
  3. Switch the compaction model
  4. Shorten the history being summarized so the model is not reduced to filler
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check any summary text you produce yourself
fn has_word_chars(s: &str) -> bool {
    s.trim_matches(|c: char| !c.is_alphanumeric()).chars().any(|c| c.is_alphanumeric())
}

Type guard

fn is_punctuation_only_summary(msg: &str) -> bool {
    msg.contains("only whitespace or punctuation was returned")
}

Try / catch

match compact().await {
    Err(e) if is_punctuation_only_summary(&e.to_string()) => {
        lower_temperature();
        compact().await
    }
    r => r,
}

Prevention

When it happens

Trigger: The model answers with '...', a divider line of dashes, markdown asterisks, or emoji-only content; Unicode punctuation-only replies from CJK models.

Common situations: Models hedging with decorative output instead of summarizing; degenerate sampling settings (temperature extremes); prompt templates that elicit formatting-only responses.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/2ce809bc7dec50a2. Report an issue: GitHub.