Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions crates/goose-cli/src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ impl CliSession {
let messages = if let Some(session_id) = &session_id {
tokio::task::block_in_place(|| {
tokio::runtime::Handle::current().block_on(async {
SessionManager::get_session(session_id, true)
.await
.map(|session| session.conversation.unwrap_or_default())
.unwrap()
match SessionManager::get_session(session_id, true).await {
Ok(session) => session.conversation.unwrap_or_default(),
Err(_) => {
// If we can't load the session, assume it's new and use empty conversation
Conversation::new_unvalidated(Vec::new())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove the comment here and print something sternly here? like what the session_id was that we thought we were loading? I would like to know how we get us a session_id that doesn't exist; the only way to get in that situation should be that the user entered an invalid one

}
}
})
})
} else {
Expand Down