Skip to content

Commit

Permalink
log recorded session at the very end
Browse files Browse the repository at this point in the history
  • Loading branch information
salman1993 committed Feb 5, 2025
1 parent 27ce15a commit afea99e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions crates/goose-cli/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,15 @@ We've removed the conversation up to the most recent user message
}

async fn close_session(&mut self) {
self.prompt.render(raw_message("Closing session..."));

let usage = self.agent.usage().await;
log_usage(self.session_file.to_string_lossy().to_string(), usage);

self.prompt.render(raw_message(
format!(
"Closing session. Recorded to {}\n",
self.session_file.display()
)
.as_str(),
format!("Recorded to {}\n", self.session_file.display()).as_str(),
));
self.prompt.close();
let usage = self.agent.usage().await;
log_usage(self.session_file.to_string_lossy().to_string(), usage);
}

pub fn session_file(&self) -> PathBuf {
Expand Down

0 comments on commit afea99e

Please sign in to comment.