File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -715,6 +715,11 @@ impl Session {
715
715
state. record_items ( items. iter ( ) ) ;
716
716
}
717
717
718
+ async fn replace_history ( & self , items : Vec < ResponseItem > ) {
719
+ let mut state = self . state . lock ( ) . await ;
720
+ state. replace_history ( items) ;
721
+ }
722
+
718
723
async fn persist_rollout_response_items ( & self , items : & [ ResponseItem ] ) {
719
724
let rollout_items: Vec < RolloutItem > = items
720
725
. iter ( )
Original file line number Diff line number Diff line change @@ -156,10 +156,7 @@ async fn run_compact_task_inner(
156
156
let user_messages = collect_user_messages ( & history_snapshot) ;
157
157
let initial_context = sess. build_initial_context ( turn_context. as_ref ( ) ) ;
158
158
let new_history = build_compacted_history ( initial_context, & user_messages, & summary_text) ;
159
- {
160
- let mut state = sess. state . lock ( ) . await ;
161
- state. replace_history ( new_history) ;
162
- }
159
+ sess. replace_history ( new_history) . await ;
163
160
164
161
let rollout_item = RolloutItem :: Compacted ( CompactedItem {
165
162
message : summary_text. clone ( ) ,
You can’t perform that action at this time.
0 commit comments