Skip to content

Commit 152ffcd

Browse files
authored
Merge pull request #189 from UiPath/fix/hitl-session-persistence
fix: HITL session persistence, tool events, and breakpoint interaction
2 parents b1d8425 + 83c36bf commit 152ffcd

9 files changed

Lines changed: 1200 additions & 37 deletions

File tree

packages/uipath-agent-framework/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-agent-framework"
3-
version = "0.0.6"
3+
version = "0.0.7"
44
description = "Python SDK that enables developers to build and deploy Microsoft Agent Framework agents to the UiPath Cloud Platform"
55
readme = "README.md"
66
requires-python = ">=3.11"

packages/uipath-agent-framework/samples/hitl-workflow/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def issue_refund(order_id: str, amount: float, reason: str) -> str:
5454
return f"Refund of ${amount:.2f} issued for order {order_id}: {reason}"
5555

5656

57-
client = UiPathOpenAIChatClient(model="gpt-5-mini-2025-08-07")
57+
client = UiPathOpenAIChatClient()
5858

5959
triage = client.as_agent(
6060
name="triage",

packages/uipath-agent-framework/samples/hitl-workflow/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ dev = [
1818

1919
[tool.uv]
2020
prerelease = "allow"
21-

packages/uipath-agent-framework/src/uipath_agent_framework/chat/openai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ class UiPathOpenAIChatClient(OpenAIChatClient):
6767
6868
from uipath_agent_framework.chat import UiPathOpenAIChatClient
6969
70-
client = UiPathOpenAIChatClient(model="gpt-4o-mini")
70+
client = UiPathOpenAIChatClient(model="gpt-4.1-mini-2025-04-14")
7171
agent = client.as_agent(
7272
name="assistant",
7373
instructions="You are a helpful assistant.",
7474
tools=[my_tool],
7575
)
7676
"""
7777

78-
def __init__(self, model: str = "gpt-4o-mini", **kwargs: Any):
78+
def __init__(self, model: str = "gpt-4.1-mini-2025-04-14", **kwargs: Any):
7979
uipath_url, token = get_uipath_config()
8080
gateway_url = build_gateway_url("openai", model, uipath_url)
8181

packages/uipath-agent-framework/src/uipath_agent_framework/runtime/messages.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,20 @@ def map_streaming_content(
184184

185185
def close_message(self) -> list[UiPathConversationMessageEvent]:
186186
"""Close the current message if open. Safety net for end of stream."""
187+
events: list[UiPathConversationMessageEvent] = []
188+
# Emit ToolCallEnd for any tool calls that were started but never
189+
# completed (e.g. HITL suspension interrupted before function_result).
190+
if self._pending_tool_calls:
191+
for tool_call_id, message_id in self._pending_tool_calls.items():
192+
events.append(
193+
self._make_tool_call_end_event(message_id, tool_call_id, {})
194+
)
195+
self._pending_tool_calls.clear()
187196
if self._message_started and self._current_message_id:
188-
events = [self._make_message_end_event(self._current_message_id)]
197+
events.append(self._make_message_end_event(self._current_message_id))
189198
self._message_started = False
190199
self._current_message_id = None
191-
return events
192-
return []
200+
return events
193201

194202
@staticmethod
195203
def _extract_text_from_content(content: Content) -> str:

packages/uipath-agent-framework/src/uipath_agent_framework/runtime/runtime.py

Lines changed: 184 additions & 25 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)