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:
Catherine Bilyeu
2025-11-13 12:33:05 -05:00
committed by GitHub
parent bdfcbf00eb
commit 075cbb2a20
+13 -1
View File
@@ -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,
);