Hmbown/CodeWhale · error · anyhow::Error

No saved sessions found.

Error message

No saved sessions found.

What it means

The interactive session picker (pick_session_id) lists every session from SessionManager::default_location() and bails when the list is empty. Unlike the workspace-scoped variant (error 471), this is a global "no sessions at all" condition in the default store.

Source

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

    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 0c42157ee5)

Solutions

  1. Create at least one session by starting the TUI once, then retry
  2. Verify the state directory location and that this user can read it
  3. If you relocated your state, restore it or point the environment back at it

Example fix

// before
$ codewhale resume    # picker opens with zero sessions
Error: No saved sessions found.

// after
$ codewhale            # run one session to seed the store, then
$ codewhale resume
Defensive patterns

Strategy: validation

Validate before calling

let sessions = SessionManager::default_location()?.list_sessions()?;
if sessions.is_empty() { /* show an onboarding hint instead of the picker */ }

Prevention

When it happens

Trigger: Opening the session picker when list_sessions() returns empty — e.g. fork/resume without an id on a fresh install, or with the state directory wiped or pointing elsewhere.

Common situations: First run after install; XDG/state directory moved or cleaned; running as a different user than the one owning the sessions.

Related errors


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