{"record":{"id":"ebbba32bcfb709ec","repo":"Hmbown/CodeWhale","slug":"no-saved-sessions-found-for-workspace-use-cod","errorCode":null,"errorMessage":"No saved sessions found for workspace {}. Use `codewhale sessions` to list all sessions, or `codewhale resume <SESSION_ID>` to resume one explicitly.","messagePattern":"No saved sessions found for workspace (.+?)\\. Use `codewhale sessions` to list all sessions, or `codewhale resume <SESSION_ID>` to resume one explicitly\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"crates/tui/src/lib.rs","lineNumber":7700,"sourceCode":"    println!(\"Cleared saved API key.\");\n    Ok(())\n}\n\nasync fn run_xai_device_auth(config_path: Option<&Path>) -> Result<()> {\n    let pending = xai_oauth::device_code_login().await?;\n    let activation = xai_oauth::activate_device_login(pending, config_path, None)?;\n    println!(\n        \"xAI OAuth is ready; activated {} via {}\",\n        codewhale_config::quote_os_path(&activation.auth_path),\n        codewhale_config::quote_os_path(&activation.config_path)\n    );\n    Ok(())\n}\n\nfn resolve_session_id(session_id: Option<String>, last: bool, workspace: &Path) -> Result<String> {\n    if last {\n        return latest_session_id_for_workspace(workspace)?.ok_or_else(|| {\n            anyhow!(\n                \"No saved sessions found for workspace {}. Use `codewhale sessions` to list all sessions, or `codewhale resume <SESSION_ID>` to resume one explicitly.\",\n                workspace.display()\n            )\n        });\n    }\n    if let Some(id) = session_id {\n        return Ok(id);\n    }\n    pick_session_id()\n}\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","sourceCodeStart":7682,"sourceCodeEnd":7718,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/lib.rs#L7682-L7718","documentation":"codewhale resume --last resolves the most recent session recorded for the current workspace via latest_session_id_for_workspace. If the workspace has no recorded sessions, the lookup returns None and resolution stops with this message, which names the workspace and points at 'codewhale sessions' and 'codewhale resume <SESSION_ID>'.","triggerScenarios":"Running resume --last in a fresh clone or a directory where Codewhale has never persisted a session; the workspace-keyed session store has no entry for this path; sessions were cleared by cleanup.","commonSituations":"First run on a new machine or clone; after clearing session storage; running from a different directory than where sessions were created — workspace identity is path-based.","solutions":["Run codewhale sessions to list all sessions, then resume by explicit ID","Start a new session in this workspace once; afterwards --last resolves","Run from the same workspace directory used when the sessions were created","If sessions were expected, verify they were not removed by a cache or session cleanup step"],"exampleFix":"# before\ncodewhale resume --last\n\n# after\ncodewhale sessions\ncodewhale resume <SESSION_ID>","handlingStrategy":"validation","validationCode":"# List sessions for this workspace before scripting resume --last\ncodewhale sessions > /dev/null 2>&1 || echo \"no session store yet; start a session first\"\ncodewhale sessions | grep -q \"$(pwd)\" || echo \"no sessions recorded for this workspace path\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create at least one session in a workspace before using resume --last","Run from the same workspace path each time — session lookup is workspace-keyed","In scripts, resume by explicit session ID instead of --last"],"tags":["rust","cli","sessions","workspace"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}