Hmbown/CodeWhale · error
memory search query is empty or too long
Error message
memory search query is empty or too long
What it means
validate_query guard for native-memory search: after trimming, the query is empty or exceeds MAX_QUERY_CHARS in character count. The bound keeps the search comparison cheap and blocks degenerate all-matching queries.
Source
Thrown at crates/tui/src/native_memory.rs:899
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 == "."
|| value == ".."
|| value.contains('/')
|| value.contains('\\')
{
bail!("invalid memory workspace id");
}
Ok(value.to_string())
}
fn ensure_memory_file(path: &Path) -> Result<()> {
if let Some(parent) = path.parent() {View on GitHub (pinned to 0c42157ee5)
Solutions
- Provide a shorter, non-empty search query
- Retry the memory search
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/tui/src/native_memory.rs:899 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/be61d8bc3f78804f.
Report an issue: GitHub.