{"record":{"id":"e986f43043a2dcb8","repo":"Hmbown/CodeWhale","slug":"no-saved-sessions-found-for-workspace","errorCode":null,"errorMessage":"No saved sessions found for workspace {}.","messagePattern":"No saved sessions found for workspace (.+?)\\.","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":8491,"sourceCode":"}\n\nfn latest_session_id_for_workspace(workspace: &Path) -> std::io::Result<Option<String>> {\n    let manager = SessionManager::default_location()?;\n    Ok(manager\n        .get_latest_session_for_workspace(workspace)?\n        .map(|session| session.id))\n}\n\nfn fork_session(\n    config: &Config,\n    session_id: Option<String>,\n    last: bool,\n    workspace: &Path,\n) -> Result<String> {\n    let manager = SessionManager::default_location()?;\n    let saved = if last {\n        let Some(meta) = manager.get_latest_session_for_workspace(workspace)? else {\n            bail!(\n                \"No saved sessions found for workspace {}.\",\n                workspace.display()\n            );\n        };\n        manager.load_session(&meta.id)?\n    } else {\n        let id = resolve_session_id(session_id, false, workspace)?;\n        manager.load_session_by_prefix(&id)?\n    };\n    let saved_provider_identity = saved\n        .metadata\n        .model_provider_id\n        .as_deref()\n        .filter(|identity| !identity.trim().is_empty())\n        .unwrap_or(&saved.metadata.model_provider);\n    let provider_identity = config\n        .resolve_persisted_provider_identity(\n            Some(&saved.metadata.model_provider),","sourceCodeStart":8473,"sourceCodeEnd":8509,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L8473-L8509","documentation":"Resuming with --last looks up the most recent saved session for the given workspace; if the SessionManager returns none, the TUI bails with this message naming the workspace path. It means no session has ever been persisted for that directory.","triggerScenarios":"Running resume --last (or equivalent) with a workspace path that has no recorded sessions — get_latest_session_for_workspace returned None.","commonSituations":"Running from a different directory than where sessions were saved; first run in a fresh checkout; workspace path changed (rename/move) so the stored workspace no longer matches.","solutions":["Run from the workspace directory where the sessions were created","Use `resume` with an explicit session id instead of --last","List sessions to find the right workspace/session"],"exampleFix":"// before\ncodewhale resume --last --workspace /tmp/new-project\n// after\ncodewhale resume --workspace /tmp/existing-project  # or resume <session-id>","handlingStrategy":"fallback","validationCode":"let has = manager.list_sessions()?.iter().any(|s| s.workspace == workspace); if !has { eprintln!(\"no sessions for {}\"); }","typeGuard":null,"tryCatchPattern":"match resume_result { Err(e) if e.to_string().starts_with(\"No saved sessions\") => { /* start a new session or prompt for a workspace */ }, other => other? }","preventionTips":["Resume from the same directory the session was created in","List sessions before using --last","Keep workspace paths stable (avoid moving/renaming project dirs)"],"tags":["sessions","resume","not-found"],"backgroundTag":"record-not-found","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}