Skip to content

Commit fca94f2

Browse files
committed
fix: remove interrupt
1 parent 0d3231a commit fca94f2

File tree

3 files changed

+1
-32
lines changed

3 files changed

+1
-32
lines changed

src/uipath/runtime/chat/protocol.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from uipath.core.chat import (
66
UiPathConversationMessageEvent,
77
)
8-
from uipath.core.triggers import UiPathResumeTrigger
98

109

1110
class UiPathChatProtocol(Protocol):
@@ -32,17 +31,6 @@ async def emit_message_event(
3231
"""
3332
...
3433

35-
async def emit_interrupt_event(
36-
self,
37-
resume_trigger: UiPathResumeTrigger,
38-
) -> None:
39-
"""Wrap and send an interrupt event.
40-
41-
Args:
42-
resume_trigger: UiPathResumeTrigger to wrap and send
43-
"""
44-
...
45-
4634
async def emit_exchange_end_event(self) -> None:
4735
"""Send an exchange end event."""
4836
...
@@ -52,5 +40,5 @@ async def emit_exchange_error_event(self, error: Exception) -> None:
5240
...
5341

5442
async def wait_for_resume(self) -> dict[str, Any]:
55-
"""Wait for the interrupt_end event to be received."""
43+
"""Wait for a confirmToolCall event to be received."""
5644
...

src/uipath/runtime/chat/runtime.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ async def stream(
102102
resume_map: dict[str, Any] = {}
103103

104104
for trigger in api_triggers:
105-
await self.chat_bridge.emit_interrupt_event(trigger)
106-
107105
resume_data = (
108106
await self.chat_bridge.wait_for_resume()
109107
)

tests/test_chat.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def make_chat_bridge_mock() -> UiPathChatProtocol:
3333
bridge_mock.connect = AsyncMock()
3434
bridge_mock.disconnect = AsyncMock()
3535
bridge_mock.emit_message_event = AsyncMock()
36-
bridge_mock.emit_interrupt_event = AsyncMock()
3736
bridge_mock.wait_for_resume = AsyncMock()
3837

3938
return cast(UiPathChatProtocol, bridge_mock)
@@ -331,7 +330,6 @@ async def test_chat_runtime_handles_api_trigger_suspension():
331330
cast(AsyncMock, bridge.connect).assert_awaited_once()
332331
cast(AsyncMock, bridge.disconnect).assert_awaited_once()
333332

334-
cast(AsyncMock, bridge.emit_interrupt_event).assert_awaited_once()
335333
cast(AsyncMock, bridge.wait_for_resume).assert_awaited_once()
336334

337335
# Message events emitted (one before suspend, one after resume)
@@ -563,15 +561,8 @@ async def test_chat_runtime_handles_multiple_api_triggers():
563561
assert resume_input["api-call"] == {"approved": True}
564562

565563
# Bridge should have been called 3 times (once per trigger)
566-
assert cast(AsyncMock, bridge.emit_interrupt_event).await_count == 3
567564
assert cast(AsyncMock, bridge.wait_for_resume).await_count == 3
568565

569-
# Verify each emit_interrupt_event received a trigger
570-
emit_calls = cast(AsyncMock, bridge.emit_interrupt_event).await_args_list
571-
assert emit_calls[0][0][0].interrupt_id == "email-confirm"
572-
assert emit_calls[1][0][0].interrupt_id == "file-delete"
573-
assert emit_calls[2][0][0].interrupt_id == "api-call"
574-
575566

576567
@pytest.mark.asyncio
577568
async def test_chat_runtime_filters_non_api_triggers():
@@ -603,12 +594,4 @@ async def test_chat_runtime_filters_non_api_triggers():
603594
assert result.triggers[0].trigger_type == UiPathResumeTriggerType.QUEUE_ITEM
604595

605596
# Bridge should have been called only 2 times (for 2 API triggers)
606-
assert cast(AsyncMock, bridge.emit_interrupt_event).await_count == 2
607597
assert cast(AsyncMock, bridge.wait_for_resume).await_count == 2
608-
609-
# Verify only API triggers were emitted
610-
emit_calls = cast(AsyncMock, bridge.emit_interrupt_event).await_args_list
611-
assert emit_calls[0][0][0].interrupt_id == "email-confirm"
612-
assert emit_calls[0][0][0].trigger_type == UiPathResumeTriggerType.API
613-
assert emit_calls[1][0][0].interrupt_id == "file-delete"
614-
assert emit_calls[1][0][0].trigger_type == UiPathResumeTriggerType.API

0 commit comments

Comments
 (0)