{"record":{"id":"26b8111f7f51494a","repo":"Hmbown/CodeWhale","slug":"no-saved-sessions-found","errorCode":null,"errorMessage":"No saved sessions found.","messagePattern":"No saved sessions found\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":7903,"sourceCode":"    let source_label = if source_title.is_empty() {\n        \"session\".to_string()\n    } else {\n        format!(\"\\\"{source_title}\\\"\")\n    };\n    println!(\n        \"Forked {source_label} ({source_id}) → new session {new_id}\",\n        source_id = truncate_id(&saved.metadata.id),\n        new_id = truncate_id(&forked.metadata.id),\n    );\n\n    Ok(forked.metadata.id)\n}\n\nfn pick_session_id() -> Result<String> {\n    let manager = SessionManager::default_location()?;\n    let sessions = manager.list_sessions()?;\n    if sessions.is_empty() {\n        bail!(\"No saved sessions found.\");\n    }\n\n    println!(\"Select a session to resume:\");\n    for (idx, session) in sessions.iter().enumerate() {\n        println!(\"  {:>2}. {} ({})\", idx + 1, session.title, session.id);\n    }\n    print!(\"Enter a number (or press Enter to cancel): \");\n    io::stdout().flush()?;\n\n    let mut input = String::new();\n    io::stdin().read_line(&mut input)?;\n    let input = input.trim();\n    if input.is_empty() {\n        bail!(\"No session selected.\");\n    }\n    let idx: usize = input\n        .parse()\n        .map_err(|_| anyhow::anyhow!(\"Invalid input\"))?;","sourceCodeStart":7885,"sourceCodeEnd":7921,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/lib.rs#L7885-L7921","documentation":"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.","triggerScenarios":"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.","commonSituations":"First run after install; XDG/state directory moved or cleaned; running as a different user than the one owning the sessions.","solutions":["Create at least one session by starting the TUI once, then retry","Verify the state directory location and that this user can read it","If you relocated your state, restore it or point the environment back at it"],"exampleFix":"// before\n$ codewhale resume    # picker opens with zero sessions\nError: No saved sessions found.\n\n// after\n$ codewhale            # run one session to seed the store, then\n$ codewhale resume","handlingStrategy":"validation","validationCode":"let sessions = SessionManager::default_location()?.list_sessions()?;\nif sessions.is_empty() { /* show an onboarding hint instead of the picker */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Seed one session before scripting resume/fork flows","Pin the state directory in CI so a missing store is detected early"],"tags":["sessions","picker","not-found","first-run"],"backgroundTag":"session-not-found","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}