@@ -2701,3 +2701,42 @@ async def test_local_hello_world_agent(client: Client):
27012701 if e .HasField ("marker_recorded_event_attributes" ):
27022702 local_activity_found = True
27032703 assert local_activity_found
2704+
2705+
2706+ async def test_split_workers (client : Client ):
2707+ new_config = client .config ()
2708+
2709+ workflow_plugin = openai_agents .OpenAIAgentsPlugin (
2710+ model_params = ModelActivityParameters (
2711+ start_to_close_timeout = timedelta (seconds = 30 )
2712+ ),
2713+ model_provider = TestModelProvider (TestHelloModel ()),
2714+ register_activities = False ,
2715+ )
2716+ new_config ["plugins" ] = [workflow_plugin ]
2717+ workflow_client = Client (** new_config )
2718+
2719+ # Workflow worker
2720+ async with new_worker (
2721+ workflow_client , HelloWorldAgent , no_remote_activities = True
2722+ ) as worker :
2723+ activity_plugin = openai_agents .OpenAIAgentsPlugin (
2724+ model_params = ModelActivityParameters (
2725+ start_to_close_timeout = timedelta (seconds = 30 )
2726+ ),
2727+ model_provider = TestModelProvider (TestHelloModel ()),
2728+ )
2729+ new_config ["plugins" ] = [activity_plugin ]
2730+ activity_client = Client (** new_config )
2731+ # Activity Worker
2732+ async with new_worker (
2733+ activity_client , task_queue = worker .task_queue
2734+ ) as activity_worker :
2735+ result = await activity_client .execute_workflow (
2736+ HelloWorldAgent .run ,
2737+ "Tell me about recursion in programming." ,
2738+ id = f"hello-workflow-{ uuid .uuid4 ()} " ,
2739+ task_queue = worker .task_queue ,
2740+ execution_timeout = timedelta (seconds = 120 ),
2741+ )
2742+ assert result == "test"
0 commit comments