Skip to content

Commit bd0b091

Browse files
committed
fix: debugger emit interrupt hit
1 parent 37393ee commit bd0b091

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-runtime"
3-
version = "0.1.3"
3+
version = "0.2.0"
44
description = "Runtime abstractions and interfaces for building agents and automation scripts in the UiPath ecosystem"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath/runtime/debug/bridge.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ async def emit_breakpoint_hit(
3737
"""Notify debugger that a breakpoint was hit."""
3838
...
3939

40+
async def emit_interrupt_hit(self, result: UiPathRuntimeResult) -> None:
41+
"""Notify debugger that an interrupt was hit."""
42+
...
43+
4044
async def emit_execution_completed(
4145
self,
4246
runtime_result: UiPathRuntimeResult,

src/uipath/runtime/debug/runtime.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
)
2828
from uipath.runtime.resumable.protocols import UiPathResumeTriggerReaderProtocol
2929
from uipath.runtime.resumable.runtime import UiPathResumableRuntime
30-
from uipath.runtime.resumable.trigger import UiPathResumeTrigger
30+
from uipath.runtime.resumable.trigger import (
31+
UiPathResumeTrigger,
32+
UiPathResumeTriggerType,
33+
)
3134
from uipath.runtime.schema import UiPathRuntimeSchema
3235

3336
logger = logging.getLogger(__name__)
@@ -192,9 +195,19 @@ async def _stream_and_debug(
192195

193196
resume_data: dict[str, Any] | None = None
194197
try:
195-
resume_data = await self._poll_trigger(
196-
final_result.trigger, self.delegate.trigger_manager
197-
)
198+
if (
199+
final_result.trigger.trigger_type
200+
== UiPathResumeTriggerType.API
201+
):
202+
await self.debug_bridge.emit_interrupt_hit(event)
203+
resume_data = (
204+
await self.debug_bridge.wait_for_resume()
205+
)
206+
else:
207+
resume_data = await self._poll_trigger(
208+
final_result.trigger,
209+
self.delegate.trigger_manager,
210+
)
198211
except UiPathDebugQuitError:
199212
final_result = UiPathRuntimeResult(
200213
status=UiPathRuntimeStatus.SUCCESSFUL,

src/uipath/runtime/resumable/runtime.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ async def _handle_suspension(
146146

147147
suspended_result = UiPathRuntimeResult(
148148
status=UiPathRuntimeStatus.SUSPENDED,
149+
output=result.output,
149150
)
150151

151152
if result.output:

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)