{"record":{"id":"ee0a27c6b12a9a02","repo":"aaif-goose/goose","slug":"no-session-found-with-name","errorCode":null,"errorMessage":"No session found with name '{}'","messagePattern":"No session found with name '(.+?)'","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/goose-cli/src/cli.rs","lineNumber":426,"sourceCode":"            let sessions = session_manager\n                .list_sessions_by_types(&[SessionType::User])\n                .await?;\n            let session_id = sessions\n                .first()\n                .map(|s| s.id.clone())\n                .ok_or_else(|| anyhow::anyhow!(\"No session found to resume\"))?;\n            return Ok(Some(session_id));\n        };\n\n        if let Some(session_id) = id.session_id {\n            session_id\n        } else if let Some(name) = id.name {\n            let sessions = session_manager.list_sessions().await?;\n            sessions\n                .into_iter()\n                .find(|s| s.name == name || s.id == name)\n                .map(|s| s.id)\n                .ok_or_else(|| anyhow::anyhow!(\"No session found with name '{}'\", name))?\n        } else if let Some(path) = id.path {\n            path.file_stem()\n                .and_then(|s| s.to_str())\n                .map(|s| s.to_string())\n                .ok_or_else(|| {\n                    anyhow::anyhow!(\"Could not extract session ID from path: {:?}\", path)\n                })?\n        } else {\n            return Err(anyhow::anyhow!(\"Invalid identifier\"));\n        }\n    } else {\n        let Some(id) = identifier else {\n            let session = session_manager\n                .create_session(\n                    std::env::current_dir()?,\n                    \"CLI Session\".to_string(),\n                    SessionType::User,\n                    goose_mode,","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose-cli/src/cli.rs#L408-L444","documentation":"anyhow error from the resume branch of CLI session resolution (crates/goose-cli/src/cli.rs) when an identifier was given via -n/--name (no --session-id) and no listed session matches s.name == name || s.id == name. The name lookup is an exact, case-sensitive match against stored session names or ids.","triggerScenarios":"Running 'goose --resume -n mysession' where 'mysession' was never stored (typo, different casing, leading/trailing space) or the session lives in a different data dir; the same string is also tried as a session id and fails.","commonSituations":"Renaming or deleting the session earlier; name set in a different GOOSE_HOME; quoting issues adding whitespace in shell; expecting fuzzy/prefix matching where only exact match exists.","solutions":["List sessions and copy the exact name: 'goose session list'","Retry with the exact stored name or use the session id directly: goose --resume --session-id <id>","Check casing/whitespace — matching is exact","Verify GOOSE_HOME/data dir points where the session was created"],"exampleFix":"# before\ngoose --resume -n ProjectX\n\n# after\ngoose session list                # get exact name, e.g. 'project-x'\ngoose --resume -n project-x","handlingStrategy":"validation","validationCode":"let exists = session_manager.list_sessions().await?.iter().any(|s| &s.name == name || &s.id == name);\nif !exists { /* list candidates for the user instead of failing */ }","typeGuard":null,"tryCatchPattern":"match resolve_resume().await {\n    Err(e) if e.to_string().contains(\"No session found with name\") => {\n        print_available_sessions().await?; // help the user self-correct\n        return Err(e);\n    }\n    other => other?,\n}","preventionTips":["Fetch exact names via 'goose session list' before resuming","Treat names as case-sensitive exact strings","Prefer --session-id in scripts — ids are unambiguous"],"tags":["cli","session","resume","goose"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}