ref: state 9 (#4171)

This commit is contained in:
jif-oai
2025-09-24 18:13:18 +01:00
committed by GitHub
parent f4ceeba263
commit 06a0b36ee5
2 changed files with 6 additions and 4 deletions

View File

@@ -715,6 +715,11 @@ impl Session {
state.record_items(items.iter());
}
async fn replace_history(&self, items: Vec<ResponseItem>) {
let mut state = self.state.lock().await;
state.replace_history(items);
}
async fn persist_rollout_response_items(&self, items: &[ResponseItem]) {
let rollout_items: Vec<RolloutItem> = items
.iter()

View File

@@ -156,10 +156,7 @@ async fn run_compact_task_inner(
let user_messages = collect_user_messages(&history_snapshot);
let initial_context = sess.build_initial_context(turn_context.as_ref());
let new_history = build_compacted_history(initial_context, &user_messages, &summary_text);
{
let mut state = sess.state.lock().await;
state.replace_history(new_history);
}
sess.replace_history(new_history).await;
let rollout_item = RolloutItem::Compacted(CompactedItem {
message: summary_text.clone(),