Hmbown/CodeWhale · error · std::io::Error
Session id cannot be empty
Error message
Session id cannot be empty
What it means
Guard in validated_session_id: the supplied session id was empty or whitespace after trimming. Session ids key the approval receipt store and transcript files; an empty id would collapse all sessions onto one storage slot, so replay/approval lookups fail fast with InvalidInput.
Source
Thrown at crates/tui/src/session_manager.rs:912
let durable = self.approval_receipt_store().load(&session.metadata.id)?;
if !durable.is_empty() {
session.approval_receipts = durable;
}
ApprovalReplay::from_receipts(&session.approval_receipts)
.map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
Ok(())
}
/// Reconstruct completed approvals and interrupted unmatched asks for one
/// session without consulting the model transcript.
pub(crate) fn replay_approvals(&self, session_id: &str) -> io::Result<ApprovalReplay> {
self.approval_receipt_store().replay(session_id)
}
fn validated_session_id<'a>(&self, id: &'a str) -> std::io::Result<&'a str> {
let trimmed = id.trim();
if trimmed.is_empty() {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
"Session id cannot be empty",
));
}
if !trimmed
.chars()
.all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_')
{
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!("Invalid session id '{id}'"),
));
}
if trimmed == SESSION_BOOT_OWNERS_STEM {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!("Session id '{trimmed}' collides with a reserved sessions file"),
));View on GitHub (pinned to 0c42157ee5)
Solutions
- Pass a real, previously created session id.
- Check upstream session creation/resolution for failures that yield empty ids.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/tui/src/session_manager.rs:912 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/ee80ee660427385e.
Report an issue: GitHub.