@@ -149,13 +149,6 @@ async def create_session(self, request: CreateSessionRequest) -> CreateBashSessi
149149 await self ._update_expire_time (request .sandbox_id )
150150 return await self ._deployment_service .async_ray_get (sandbox_actor .create_session .remote (request ))
151151
152- async def execute (self , command : Command ) -> CommandResponse :
153- sandbox_actor = await self ._deployment_service .async_ray_get_actor (command .sandbox_id )
154- if sandbox_actor is None :
155- raise Exception (f"sandbox { command .sandbox_id } not found to execute" )
156- await self ._update_expire_time (command .sandbox_id )
157- return await self ._deployment_service .async_ray_get (sandbox_actor .execute .remote (command ))
158-
159152 @monitor_sandbox_operation ()
160153 async def run_in_session (self , action : Action ) -> BashObservation :
161154 sandbox_actor = await self ._deployment_service .async_ray_get_actor (action .sandbox_id )
@@ -164,6 +157,13 @@ async def run_in_session(self, action: Action) -> BashObservation:
164157 await self ._update_expire_time (action .sandbox_id )
165158 return await self ._deployment_service .async_ray_get (sandbox_actor .run_in_session .remote (action ))
166159
160+ async def execute (self , command : Command ) -> CommandResponse :
161+ sandbox_actor = await self ._deployment_service .async_ray_get_actor (command .sandbox_id )
162+ if sandbox_actor is None :
163+ raise Exception (f"sandbox { command .sandbox_id } not found to execute" )
164+ await self ._update_expire_time (command .sandbox_id )
165+ return await self ._deployment_service .async_ray_get (sandbox_actor .execute .remote (command ))
166+
167167 async def _is_expired (self , sandbox_id ):
168168 timeout_dict = await self ._redis_provider .json_get (timeout_sandbox_key (sandbox_id ), "$" )
169169 if timeout_dict is None or len (timeout_dict ) == 0 :
0 commit comments