@@ -72,7 +72,7 @@ async def test_run_compaction_for_sliding_window_no_events(self):
7272 await _run_compaction_for_sliding_window (
7373 app , session , self .mock_session_service
7474 )
75- self .mock_compactor .maybe_compact_events .assert_not_called ()
75+ self .mock_compactor .maybe_summarize_events .assert_not_called ()
7676 self .mock_session_service .append_event .assert_not_called ()
7777
7878 async def test_run_compaction_for_sliding_window_not_enough_new_invocations (
@@ -82,7 +82,7 @@ async def test_run_compaction_for_sliding_window_not_enough_new_invocations(
8282 name = 'test' ,
8383 root_agent = Mock (spec = BaseAgent ),
8484 events_compaction_config = EventsCompactionConfig (
85- compactor = self .mock_compactor ,
85+ summarizer = self .mock_compactor ,
8686 compaction_interval = 3 ,
8787 overlap_size = 1 ,
8888 ),
@@ -100,15 +100,15 @@ async def test_run_compaction_for_sliding_window_not_enough_new_invocations(
100100 await _run_compaction_for_sliding_window (
101101 app , session , self .mock_session_service
102102 )
103- self .mock_compactor .maybe_compact_events .assert_not_called ()
103+ self .mock_compactor .maybe_summarize_events .assert_not_called ()
104104 self .mock_session_service .append_event .assert_not_called ()
105105
106106 async def test_run_compaction_for_sliding_window_first_compaction (self ):
107107 app = App (
108108 name = 'test' ,
109109 root_agent = Mock (spec = BaseAgent ),
110110 events_compaction_config = EventsCompactionConfig (
111- compactor = self .mock_compactor ,
111+ summarizer = self .mock_compactor ,
112112 compaction_interval = 2 ,
113113 overlap_size = 1 ,
114114 ),
@@ -124,14 +124,16 @@ async def test_run_compaction_for_sliding_window_first_compaction(self):
124124 mock_compacted_event = self ._create_compacted_event (
125125 1.0 , 4.0 , 'Summary inv1-inv4'
126126 )
127- self .mock_compactor .maybe_compact_events .return_value = mock_compacted_event
127+ self .mock_compactor .maybe_summarize_events .return_value = (
128+ mock_compacted_event
129+ )
128130
129131 await _run_compaction_for_sliding_window (
130132 app , session , self .mock_session_service
131133 )
132134
133135 # Expected events to compact: inv1, inv2, inv3, inv4
134- compacted_events_arg = self .mock_compactor .maybe_compact_events .call_args [
136+ compacted_events_arg = self .mock_compactor .maybe_summarize_events .call_args [
135137 1
136138 ]['events' ]
137139 self .assertEqual (
@@ -147,7 +149,7 @@ async def test_run_compaction_for_sliding_window_with_overlap(self):
147149 name = 'test' ,
148150 root_agent = Mock (spec = BaseAgent ),
149151 events_compaction_config = EventsCompactionConfig (
150- compactor = self .mock_compactor ,
152+ summarizer = self .mock_compactor ,
151153 compaction_interval = 2 ,
152154 overlap_size = 1 ,
153155 ),
@@ -174,7 +176,9 @@ async def test_run_compaction_for_sliding_window_with_overlap(self):
174176 mock_compacted_event = self ._create_compacted_event (
175177 2.0 , 5.0 , 'Summary inv2-inv5'
176178 )
177- self .mock_compactor .maybe_compact_events .return_value = mock_compacted_event
179+ self .mock_compactor .maybe_summarize_events .return_value = (
180+ mock_compacted_event
181+ )
178182
179183 await _run_compaction_for_sliding_window (
180184 app , session , self .mock_session_service
@@ -183,7 +187,7 @@ async def test_run_compaction_for_sliding_window_with_overlap(self):
183187 # New invocations are inv3, inv4, inv5 (3 new) > threshold (2).
184188 # Overlap size is 1, so start from 1 inv before inv3, which is inv2.
185189 # Compact range: inv2 to inv5.
186- compacted_events_arg = self .mock_compactor .maybe_compact_events .call_args [
190+ compacted_events_arg = self .mock_compactor .maybe_summarize_events .call_args [
187191 1
188192 ]['events' ]
189193 self .assertEqual (
@@ -201,19 +205,19 @@ async def test_run_compaction_for_sliding_window_no_compaction_event_returned(
201205 name = 'test' ,
202206 root_agent = Mock (spec = BaseAgent ),
203207 events_compaction_config = EventsCompactionConfig (
204- compactor = self .mock_compactor ,
208+ summarizer = self .mock_compactor ,
205209 compaction_interval = 1 ,
206210 overlap_size = 0 ,
207211 ),
208212 )
209213 events = [self ._create_event (1.0 , 'inv1' , 'e1' )]
210214 session = Session (app_name = 'test' , user_id = 'u1' , id = 's1' , events = events )
211215
212- self .mock_compactor .maybe_compact_events .return_value = None
216+ self .mock_compactor .maybe_summarize_events .return_value = None
213217
214218 await _run_compaction_for_sliding_window (
215219 app , session , self .mock_session_service
216220 )
217221
218- self .mock_compactor .maybe_compact_events .assert_called_once ()
222+ self .mock_compactor .maybe_summarize_events .assert_called_once ()
219223 self .mock_session_service .append_event .assert_not_called ()
0 commit comments