Fix context progress bar not resetting after /clear command (#5652)
Signed-off-by: Cat Bilyeu <catherinebilyeu@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: David Katz <katzdave@yahoo.com>
This commit is contained in:
@@ -628,10 +628,22 @@ impl CliSession {
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Err(e) = SessionManager::update_session(&self.session_id)
|
||||
.total_tokens(Some(0))
|
||||
.input_tokens(Some(0))
|
||||
.output_tokens(Some(0))
|
||||
.apply()
|
||||
.await
|
||||
{
|
||||
output::render_error(&format!("Failed to reset token counts: {}", e));
|
||||
continue;
|
||||
}
|
||||
|
||||
self.messages.clear();
|
||||
|
||||
tracing::info!("Chat context cleared by user.");
|
||||
output::render_message(
|
||||
&Message::assistant().with_text("Chat context cleared."),
|
||||
&Message::assistant().with_text("Chat context cleared.\n"),
|
||||
self.debug,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user