Skip to content

Commit 1201baa

Browse files
authored
Merge pull request #60 from UiPath/fix/always-choose-first-api-interrupt
fix: always choose first interrupt for debug resume
2 parents 9fe38e1 + 9e7189b commit 1201baa

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
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.3.2"
3+
version = "0.3.3"
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/resumable/runtime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ async def _handle_suspension(
189189
current_interrupts = result.output or {}
190190

191191
# Diff: find new interrupts
192-
existing_ids = {t.interrupt_id for t in suspended_result.triggers}
193-
new_ids = current_interrupts.keys() - existing_ids
192+
existing_ids = [t.interrupt_id for t in suspended_result.triggers]
193+
new_ids = [key for key in current_interrupts.keys() if key not in existing_ids]
194194

195195
# Create triggers only for new interrupts
196196
for interrupt_id in new_ids:

tests/test_resumable.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,11 @@ async def test_resumable_creates_multiple_triggers_on_first_suspension():
160160
assert len(result.triggers) == 2
161161
assert {t.interrupt_id for t in result.triggers} == {"int-1", "int-2"}
162162

163-
# Check payloads by interrupt_id (order not guaranteed)
164-
payloads_by_id = {t.interrupt_id: t.payload for t in result.triggers}
165-
assert payloads_by_id["int-1"] == {"action": "approve_branch_1"}
166-
assert payloads_by_id["int-2"] == {"action": "approve_branch_2"}
163+
# Check payloads by interrupt_id (order should be preserved)
164+
assert result.triggers[0].interrupt_id == "int-1"
165+
assert result.triggers[0].payload == {"action": "approve_branch_1"}
166+
assert result.triggers[1].interrupt_id == "int-2"
167+
assert result.triggers[1].payload == {"action": "approve_branch_2"}
167168

168169
# Both triggers should be created and saved
169170
assert cast(AsyncMock, trigger_manager.create_trigger).await_count == 2

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)