@@ -179,7 +179,7 @@ async def _stream_and_debug(
179179
180180 # Check if this is a suspended execution that needs polling
181181 if (
182- isinstance ( self .delegate , UiPathResumableRuntime )
182+ ( resumable_runtime := self .get_resumable_runtime () )
183183 and self .trigger_poll_interval > 0
184184 and final_result .status == UiPathRuntimeStatus .SUSPENDED
185185 and final_result .trigger
@@ -204,7 +204,7 @@ async def _stream_and_debug(
204204 else :
205205 trigger_data = await self ._poll_trigger (
206206 final_result .trigger ,
207- self . delegate .trigger_manager ,
207+ resumable_runtime .trigger_manager ,
208208 )
209209 resume_data = {interrupt_id : trigger_data }
210210 except UiPathDebugQuitError :
@@ -233,6 +233,15 @@ async def _stream_and_debug(
233233 elif isinstance (event , UiPathRuntimeStateEvent ):
234234 await self .debug_bridge .emit_state_update (event )
235235
236+ def get_resumable_runtime (self ) -> UiPathResumableRuntime | None :
237+ """Get the delegate resumable runtime, if exists."""
238+ current_runtime : UiPathRuntimeProtocol = self
239+ while hasattr (current_runtime , "delegate" ):
240+ current_runtime = current_runtime .delegate
241+ if isinstance (current_runtime , UiPathResumableRuntime ):
242+ return current_runtime
243+ return None
244+
236245 async def get_schema (self ) -> UiPathRuntimeSchema :
237246 """Passthrough schema for the delegate."""
238247 return await self .delegate .get_schema ()
0 commit comments