@@ -102,7 +102,7 @@ def test_create_conversation(self):
102102 conversation_id = str (uuid .uuid4 ())
103103
104104 with patch (
105- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
105+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
106106 return_value = _async_generator (),
107107 ) as mock_start_workflow_and_stream :
108108 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -120,7 +120,7 @@ def test_create_conversation(self):
120120 # Check that the method was called with workflow_inputs
121121 mock_start_workflow_and_stream .assert_called_once ()
122122 call_args = mock_start_workflow_and_stream .call_args
123- workflow_inputs = call_args [0 ][0 ]
123+ workflow_inputs = call_args [0 ][1 ]
124124 self .assertEqual (workflow_inputs .user_id , self .user .id )
125125 self .assertEqual (workflow_inputs .is_new_conversation , True )
126126 self .assertEqual (workflow_inputs .conversation_id , conversation .id )
@@ -129,7 +129,7 @@ def test_create_conversation(self):
129129
130130 def test_add_message_to_existing_conversation (self ):
131131 with patch (
132- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
132+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
133133 return_value = _async_generator (),
134134 ) as mock_start_workflow_and_stream :
135135 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -149,7 +149,7 @@ def test_add_message_to_existing_conversation(self):
149149 # Check that the method was called with workflow_inputs
150150 mock_start_workflow_and_stream .assert_called_once ()
151151 call_args = mock_start_workflow_and_stream .call_args
152- workflow_inputs = call_args [0 ][0 ]
152+ workflow_inputs = call_args [0 ][1 ]
153153 self .assertEqual (workflow_inputs .user_id , self .user .id )
154154 self .assertEqual (workflow_inputs .is_new_conversation , False )
155155 self .assertEqual (workflow_inputs .conversation_id , conversation .id )
@@ -183,7 +183,7 @@ def test_invalid_message_format(self):
183183 def test_rate_limit_burst (self ):
184184 # Create multiple requests to trigger burst rate limit
185185 with patch (
186- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
186+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
187187 return_value = _async_generator (),
188188 ):
189189 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -215,7 +215,7 @@ def test_none_content_with_existing_conversation(self):
215215 user = self .user , team = self .team , status = Conversation .Status .IN_PROGRESS
216216 )
217217 with patch (
218- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
218+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
219219 return_value = _async_generator (),
220220 ) as mock_stream_conversation :
221221 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -251,7 +251,7 @@ def test_missing_trace_id(self):
251251
252252 def test_nonexistent_conversation (self ):
253253 with patch (
254- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
254+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
255255 return_value = _async_generator (),
256256 ):
257257 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -284,7 +284,7 @@ def test_unauthenticated_request(self):
284284 )
285285 self .assertEqual (response .status_code , status .HTTP_401_UNAUTHORIZED )
286286
287- @patch ("ee.hogai.stream.conversation_stream.ConversationStreamManager.cancel_conversation " )
287+ @patch ("ee.hogai.agent.executor.AgentExecutor.cancel_workflow " )
288288 def test_cancel_conversation (self , mock_cancel ):
289289 conversation = Conversation .objects .create (
290290 user = self .user ,
@@ -327,7 +327,7 @@ def test_cancel_other_teams_conversation(self):
327327 )
328328 self .assertEqual (response .status_code , status .HTTP_404_NOT_FOUND )
329329
330- @patch ("ee.hogai.stream.conversation_stream.ConversationStreamManager.cancel_conversation " )
330+ @patch ("ee.hogai.agent.executor.AgentExecutor.cancel_workflow " )
331331 def test_cancel_conversation_with_async_cleanup (self , mock_cancel ):
332332 """Test that cancel endpoint properly handles async cleanup."""
333333 conversation = Conversation .objects .create (
@@ -347,7 +347,7 @@ def test_cancel_conversation_with_async_cleanup(self, mock_cancel):
347347
348348 self .assertEqual (response .status_code , status .HTTP_204_NO_CONTENT )
349349
350- @patch ("ee.hogai.stream.conversation_stream.ConversationStreamManager.cancel_conversation " )
350+ @patch ("ee.hogai.agent.executor.AgentExecutor.cancel_workflow " )
351351 def test_cancel_conversation_async_cleanup_failure (self , mock_cancel ):
352352 """Test cancel endpoint behavior when async cleanup fails."""
353353 conversation = Conversation .objects .create (
@@ -415,7 +415,7 @@ def test_stream_from_in_progress_conversation(self):
415415 user = self .user , team = self .team , status = Conversation .Status .IN_PROGRESS
416416 )
417417 with patch (
418- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
418+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
419419 return_value = _async_generator (),
420420 ) as mock_stream_conversation :
421421 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -435,7 +435,7 @@ def test_resume_generation_from_idle_conversation(self):
435435 """Test resuming generation from an idle conversation with no new content."""
436436 conversation = Conversation .objects .create (user = self .user , team = self .team , status = Conversation .Status .IDLE )
437437 with patch (
438- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
438+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
439439 return_value = _async_generator (),
440440 ) as mock_start_workflow_and_stream :
441441 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -453,7 +453,7 @@ def test_resume_generation_from_idle_conversation(self):
453453 # Check that the method was called with workflow_inputs
454454 mock_start_workflow_and_stream .assert_called_once ()
455455 call_args = mock_start_workflow_and_stream .call_args
456- workflow_inputs = call_args [0 ][0 ]
456+ workflow_inputs = call_args [0 ][1 ]
457457 self .assertEqual (workflow_inputs .user_id , self .user .id )
458458 self .assertEqual (workflow_inputs .is_new_conversation , False )
459459 self .assertEqual (workflow_inputs .conversation_id , conversation .id )
@@ -595,7 +595,7 @@ def test_billing_context_validation_valid_data(self):
595595 conversation = Conversation .objects .create (user = self .user , team = self .team )
596596
597597 with patch (
598- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
598+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
599599 return_value = _async_generator (),
600600 ) as mock_start_workflow_and_stream :
601601 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -611,15 +611,15 @@ def test_billing_context_validation_valid_data(self):
611611 )
612612 self .assertEqual (response .status_code , status .HTTP_200_OK )
613613 call_args = mock_start_workflow_and_stream .call_args
614- workflow_inputs = call_args [0 ][0 ]
614+ workflow_inputs = call_args [0 ][1 ]
615615 self .assertEqual (workflow_inputs .billing_context , self .billing_context )
616616
617617 def test_billing_context_validation_invalid_data (self ):
618618 """Test that invalid billing context data is rejected."""
619619 conversation = Conversation .objects .create (user = self .user , team = self .team )
620620
621621 with patch (
622- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
622+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
623623 return_value = _async_generator (),
624624 ) as mock_start_workflow_and_stream :
625625 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -635,5 +635,5 @@ def test_billing_context_validation_invalid_data(self):
635635 )
636636 self .assertEqual (response .status_code , status .HTTP_200_OK )
637637 call_args = mock_start_workflow_and_stream .call_args
638- workflow_inputs = call_args [0 ][0 ]
638+ workflow_inputs = call_args [0 ][1 ]
639639 self .assertEqual (workflow_inputs .billing_context , None )
0 commit comments