aaif-goose/goose · warning
No sessions found
Error message
No sessions found
What it means
Thrown by prompt_interactive_session_selection (used when `goose session export` runs without an explicit session ID) when list_sessions() returns an empty Vec. The interactive picker needs at least one entry, so an empty visible-session store aborts before showing the selector.
Source
Thrown at crates/goose-cli/src/commands/session.rs:377
file.write_all(&diagnostics_data)
.context("Failed to write diagnostics data")?;
println!("Diagnostics report saved to: {}", output_file.display());
Ok(())
}
/// Prompt the user to interactively select a session
///
/// Shows a list of available sessions and lets the user select one
pub async fn prompt_interactive_session_selection(
session_manager: &SessionManager,
) -> Result<String> {
let sessions = session_manager.list_sessions().await?;
if sessions.is_empty() {
return Err(anyhow::anyhow!("No sessions found"));
}
// Build the selection prompt
let mut selector = select("Select a session to export:");
// Map to display text
let display_map: std::collections::HashMap<String, Session> = sessions
.iter()
.map(|s| {
let desc = if s.name.is_empty() {
"(no name)"
} else {
&s.name
};
let truncated_desc = safe_truncate(desc, TRUNCATED_DESC_LENGTH);
let display_text = format!("{} - {} ({})", s.updated_at, truncated_desc, s.id);
(display_text, s.clone())View on GitHub (pinned to 3810898a74)
Solutions
- Run `goose session list` to confirm the store is empty
- Create/resume a session first so at least one exists
- Check GOOSE_CONFIG_DIR/GOOSE_HOME points where your sessions live
Example fix
# before goose session export # Err: No sessions found # after goose session list # confirm empty goose session new / goose run # create a session, then export
Defensive patterns
Strategy: validation
Validate before calling
if session_manager.list_sessions().await?.is_empty() {
anyhow::bail!("no sessions to export; create one first");
}
// only then run the interactive export flow Type guard
async fn has_exportable_sessions(sm: &SessionManager) -> bool {
sm.list_sessions().await.map(|s| !s.is_empty()).unwrap_or(false)
} Try / catch
match prompt_interactive_session_selection(&sm).await {
Err(e) if e.to_string() == "No sessions found" => Ok(None), // nothing to do
other => other.map(Some),
} Prevention
- Pass the session ID explicitly to `goose session export` so the picker never runs
- Check `goose session list` is non-empty before interactive flows in scripts
When it happens
Trigger: Running `goose session export` with no ID argument on a fresh install or an emptied sessions directory; GOOSE_CONFIG_DIR pointing at an empty store.
Common situations: First run after install; after clearing sessions; CI containers with no persisted goose state.
Related errors
- Session has no messages
- Export canceled
- Invalid selection
- No sessions found.
- Session '{}' not found or failed to read: {}
AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16).
Data as JSON: /api/errors/cd55991376d0d021.
Report an issue: GitHub.