@@ -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 )
@@ -195,7 +195,7 @@ def test_invalid_message_format(self):
195195 def test_rate_limit_burst (self ):
196196 # Create multiple requests to trigger burst rate limit
197197 with patch (
198- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
198+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
199199 return_value = _async_generator (),
200200 ):
201201 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -227,7 +227,7 @@ def test_none_content_with_existing_conversation(self):
227227 user = self .user , team = self .team , status = Conversation .Status .IN_PROGRESS
228228 )
229229 with patch (
230- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
230+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
231231 return_value = _async_generator (),
232232 ) as mock_stream_conversation :
233233 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -263,7 +263,7 @@ def test_missing_trace_id(self):
263263
264264 def test_nonexistent_conversation (self ):
265265 with patch (
266- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
266+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
267267 return_value = _async_generator (),
268268 ):
269269 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -296,7 +296,7 @@ def test_unauthenticated_request(self):
296296 )
297297 self .assertEqual (response .status_code , status .HTTP_401_UNAUTHORIZED )
298298
299- @patch ("ee.hogai.stream.conversation_stream.ConversationStreamManager.cancel_conversation " )
299+ @patch ("ee.hogai.agent.executor.AgentExecutor.cancel_workflow " )
300300 def test_cancel_conversation (self , mock_cancel ):
301301 conversation = Conversation .objects .create (
302302 user = self .user ,
@@ -340,7 +340,7 @@ def test_cancel_other_teams_conversation(self):
340340 )
341341 self .assertEqual (response .status_code , status .HTTP_404_NOT_FOUND )
342342
343- @patch ("ee.hogai.stream.conversation_stream.ConversationStreamManager.cancel_conversation " )
343+ @patch ("ee.hogai.agent.executor.AgentExecutor.cancel_workflow " )
344344 def test_cancel_conversation_with_async_cleanup (self , mock_cancel ):
345345 """Test that cancel endpoint properly handles async cleanup."""
346346 conversation = Conversation .objects .create (
@@ -360,7 +360,7 @@ def test_cancel_conversation_with_async_cleanup(self, mock_cancel):
360360
361361 self .assertEqual (response .status_code , status .HTTP_204_NO_CONTENT )
362362
363- @patch ("ee.hogai.stream.conversation_stream.ConversationStreamManager.cancel_conversation " )
363+ @patch ("ee.hogai.agent.executor.AgentExecutor.cancel_workflow " )
364364 def test_cancel_conversation_async_cleanup_failure (self , mock_cancel ):
365365 """Test cancel endpoint behavior when async cleanup fails."""
366366 conversation = Conversation .objects .create (
@@ -428,7 +428,7 @@ def test_stream_from_in_progress_conversation(self):
428428 user = self .user , team = self .team , status = Conversation .Status .IN_PROGRESS
429429 )
430430 with patch (
431- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
431+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
432432 return_value = _async_generator (),
433433 ) as mock_stream_conversation :
434434 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -606,7 +606,7 @@ def test_billing_context_validation_valid_data(self):
606606 conversation = Conversation .objects .create (user = self .user , team = self .team )
607607
608608 with patch (
609- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
609+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
610610 return_value = _async_generator (),
611611 ) as mock_start_workflow_and_stream :
612612 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -622,15 +622,15 @@ def test_billing_context_validation_valid_data(self):
622622 )
623623 self .assertEqual (response .status_code , status .HTTP_200_OK )
624624 call_args = mock_start_workflow_and_stream .call_args
625- workflow_inputs = call_args [0 ][0 ]
625+ workflow_inputs = call_args [0 ][1 ]
626626 self .assertEqual (workflow_inputs .billing_context , self .billing_context )
627627
628628 def test_billing_context_validation_invalid_data (self ):
629629 """Test that invalid billing context data is rejected."""
630630 conversation = Conversation .objects .create (user = self .user , team = self .team )
631631
632632 with patch (
633- "ee.hogai.stream.conversation_stream.ConversationStreamManager .astream" ,
633+ "ee.hogai.agent.executor.AgentExecutor .astream" ,
634634 return_value = _async_generator (),
635635 ) as mock_start_workflow_and_stream :
636636 with patch ("ee.api.conversation.StreamingHttpResponse" , side_effect = self ._create_mock_streaming_response ):
@@ -646,5 +646,5 @@ def test_billing_context_validation_invalid_data(self):
646646 )
647647 self .assertEqual (response .status_code , status .HTTP_200_OK )
648648 call_args = mock_start_workflow_and_stream .call_args
649- workflow_inputs = call_args [0 ][0 ]
649+ workflow_inputs = call_args [0 ][1 ]
650650 self .assertEqual (workflow_inputs .billing_context , None )
0 commit comments