Hmbown/CodeWhale · error

memory note is empty

Error message

memory note is empty

What it means

normalize_note flattened the input (line breaks collapsed, lines trimmed and empties dropped) and the result was empty — the note, or the evidence string mapped through the same helper, contained nothing but whitespace. Empty entries are refused because they would corrupt the journal's structure.

Source

Thrown at crates/tui/src/native_memory.rs:888

}

/// Evidence is required on every in-place edit and held to the same bounds
/// as a note. An unexplained rewrite of durable context is the thing the
/// journal exists to prevent.
fn normalize_evidence(evidence: &str) -> Result<String> {
    normalize_note(evidence).map_err(|_| anyhow!("memory edits require non-empty evidence"))
}

fn normalize_note(note: &str) -> Result<String> {
    let note = note.replace("\r\n", "\n").replace('\r', "\n");
    let note = note
        .lines()
        .map(str::trim)
        .filter(|line| !line.is_empty())
        .collect::<Vec<_>>()
        .join(" ");
    if note.is_empty() {
        bail!("memory note is empty");
    }
    if note.len() > MAX_NOTE_BYTES {
        bail!("memory note exceeds {MAX_NOTE_BYTES} bytes");
    }
    Ok(note.trim_start_matches('-').trim().to_string())
}

fn validate_query(query: &str) -> Result<&str> {
    let query = query.trim();
    if query.is_empty() || query.chars().count() > MAX_QUERY_CHARS {
        bail!("memory search query is empty or too long");
    }
    Ok(query)
}

fn safe_component(value: &str) -> Result<String> {
    if value.is_empty()
        || value == "."

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Provide actual note/evidence text
  2. Retry the memory operation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/native_memory.rs:888 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/4a0940a5e2652f45. Report an issue: GitHub.