From 5865a4b93d6799aa5a9744f39acbdbc73a6f3e7d Mon Sep 17 00:00:00 2001 From: radu-mocanu Date: Fri, 13 Feb 2026 11:25:25 +0200 Subject: [PATCH] chore: debug runtime, check for any resumable runtime in the delegates chain --- pyproject.toml | 2 +- src/uipath/runtime/debug/runtime.py | 16 ++++++++++++++-- uv.lock | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 30689a9..e399d87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-runtime" -version = "0.8.0" +version = "0.8.1" description = "Runtime abstractions and interfaces for building agents and automation scripts in the UiPath ecosystem" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/src/uipath/runtime/debug/runtime.py b/src/uipath/runtime/debug/runtime.py index b671645..8e0393f 100644 --- a/src/uipath/runtime/debug/runtime.py +++ b/src/uipath/runtime/debug/runtime.py @@ -179,7 +179,7 @@ async def _stream_and_debug( # Check if this is a suspended execution that needs polling if ( - isinstance(self.delegate, UiPathResumableRuntime) + (resumable_runtime := self.get_resumable_runtime()) and self.trigger_poll_interval > 0 and final_result.status == UiPathRuntimeStatus.SUSPENDED and final_result.trigger @@ -204,7 +204,7 @@ async def _stream_and_debug( else: trigger_data = await self._poll_trigger( final_result.trigger, - self.delegate.trigger_manager, + resumable_runtime.trigger_manager, ) resume_data = {interrupt_id: trigger_data} except UiPathDebugQuitError: @@ -233,6 +233,18 @@ async def _stream_and_debug( elif isinstance(event, UiPathRuntimeStateEvent): await self.debug_bridge.emit_state_update(event) + def get_resumable_runtime( + self, max_depth: int = 10 + ) -> UiPathResumableRuntime | None: + """Get the delegate resumable runtime, if exists.""" + current_runtime: UiPathRuntimeProtocol = self + while hasattr(current_runtime, "delegate") and max_depth: + max_depth -= 1 + current_runtime = current_runtime.delegate + if isinstance(current_runtime, UiPathResumableRuntime): + return current_runtime + return None + async def get_schema(self) -> UiPathRuntimeSchema: """Passthrough schema for the delegate.""" return await self.delegate.get_schema() diff --git a/uv.lock b/uv.lock index 39b3720..814d580 100644 --- a/uv.lock +++ b/uv.lock @@ -1005,7 +1005,7 @@ wheels = [ [[package]] name = "uipath-runtime" -version = "0.8.0" +version = "0.8.1" source = { editable = "." } dependencies = [ { name = "uipath-core" },