Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
16 changes: 14 additions & 2 deletions src/uipath/runtime/debug/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.