fix: Manual compaction does not update context window. (#6682)
This commit is contained in:
@@ -86,7 +86,7 @@ impl Agent {
|
||||
.conversation
|
||||
.ok_or_else(|| anyhow!("Session has no conversation"))?;
|
||||
|
||||
let (compacted_conversation, _usage) = compact_messages(
|
||||
let (compacted_conversation, usage) = compact_messages(
|
||||
self.provider().await?.as_ref(),
|
||||
session_id,
|
||||
&conversation,
|
||||
@@ -98,6 +98,9 @@ impl Agent {
|
||||
.replace_conversation(session_id, &compacted_conversation)
|
||||
.await?;
|
||||
|
||||
self.update_session_metrics(session_id, session.schedule_id, &usage, true)
|
||||
.await?;
|
||||
|
||||
Ok(Some(Message::assistant().with_system_notification(
|
||||
SystemNotificationType::InlineMessage,
|
||||
"Compaction complete",
|
||||
|
||||
Reference in New Issue
Block a user