Skip to content

Commit 20a8dae

Browse files
committed
fix: chat runtime results should be suspended
1 parent aed58ac commit 20a8dae

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# UiPath Runtime
22

3-
[![PyPI downloads](https://img.shields.io/pypi/dm/uipath-runtime.svg)](https://pypi.org/project/uipath-runtime/)
43
[![PyPI - Version](https://img.shields.io/pypi/v/uipath-runtime)](https://pypi.org/project/uipath-runtime/)
4+
[![PyPI downloads](https://img.shields.io/pypi/dm/uipath-runtime.svg)](https://pypi.org/project/uipath-runtime/)
55
[![Python versions](https://img.shields.io/pypi/pyversions/uipath-runtime.svg)](https://pypi.org/project/uipath-runtime/)
66

77
Runtime abstractions and contracts for the UiPath Python SDK.

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.2.4"
3+
version = "0.2.5"
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/chat/runtime.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,17 @@ async def stream(
6969
if isinstance(event, UiPathRuntimeMessageEvent):
7070
if event.payload:
7171
await self.chat_bridge.emit_message_event(event.payload)
72-
73-
yield event
72+
if isinstance(event, UiPathRuntimeResult):
73+
# In chat mode, convert successful completion to SUSPENDED
74+
# Breakpoints and resumable triggers are already suspended
75+
# Faulted jobs remain faulted
76+
if event.status == UiPathRuntimeStatus.SUCCESSFUL:
77+
yield UiPathRuntimeResult(
78+
status=UiPathRuntimeStatus.SUSPENDED,
79+
output=event.output,
80+
)
81+
else:
82+
yield event
7483

7584
async def get_schema(self) -> UiPathRuntimeSchema:
7685
"""Get schema from the delegate runtime."""

src/uipath/runtime/errors/exception.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Base exception class for UiPath runtime errors with structured error information."""
22

3+
from __future__ import annotations
4+
35
import sys
46
import traceback
57
from typing import Any
@@ -105,7 +107,7 @@ def __init__(
105107
@classmethod
106108
def from_resume_trigger_error(
107109
cls, exc: UiPathFaultedTriggerError
108-
) -> "UiPathRuntimeError":
110+
) -> UiPathRuntimeError:
109111
"""Create UiPathRuntimeError from UiPathFaultedTriggerError."""
110112
return cls(
111113
code=UiPathErrorCode.RESUME_TRIGGER_ERROR,

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)