Hmbown/CodeWhale · error · anyhow::Error

No saved sessions found.

Error message

No saved sessions found.

What it means

The interactive resume picker (pick_session_id) lists saved sessions; if SessionManager.list_sessions returns an empty set, there is nothing to present and it bails with this message before printing the menu.

Solutions

  1. Start a session first — resume requires at least one saved session
  2. Check the session storage location in config points at an existing store
  3. Use resume <session-id> once you know an id exists
Defensive patterns

Strategy: fallback

Validate before calling

if manager.list_sessions()?.is_empty() { eprintln!("no saved sessions yet"); }

Try / catch

match pick_session() { Err(e) if e.to_string() == "No saved sessions found." => { /* fall back to starting a new session */ }, other => other? }

Prevention

When it happens

Trigger: Running resume in picker mode when no sessions have been saved anywhere (empty session store).

Common situations: Fresh install or new machine with no prior conversations; sessions directory deleted or pointed elsewhere via config; starting resume before ever ending a session.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at crates/tui/src/lib.rs:8558

    let source_label = if source_title.is_empty() {
        "session".to_string()
    } else {
        format!("\"{source_title}\"")
    };
    println!(
        "Forked {source_label} ({source_id}) → new session {new_id}",
        source_id = truncate_id(&saved.metadata.id),
        new_id = truncate_id(&forked.metadata.id),
    );

    Ok(forked.metadata.id)
}

fn pick_session_id() -> Result<String> {
    let manager = SessionManager::default_location()?;
    let sessions = manager.list_sessions()?;
    if sessions.is_empty() {
        bail!("No saved sessions found.");
    }

    println!("Select a session to resume:");
    for (idx, session) in sessions.iter().enumerate() {
        println!("  {:>2}. {} ({})", idx + 1, session.title, session.id);
    }
    print!("Enter a number (or press Enter to cancel): ");
    io::stdout().flush()?;

    let mut input = String::new();
    io::stdin().read_line(&mut input)?;
    let input = input.trim();
    if input.is_empty() {
        bail!("No session selected.");
    }
    let idx: usize = input
        .parse()
        .map_err(|_| anyhow::anyhow!("Invalid input"))?;

View on GitHub (pinned to 73e0f67d83)