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 152ddfa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/goose-cli/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ We've removed the conversation up to the most recent user message
}

async fn close_session(&mut self) {
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",
Expand All @@ -317,8 +320,6 @@ We've removed the conversation up to the most recent user message
.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 152ddfa

Please sign in to comment.