Skip to content

Conversation

@radu-mocanu
Copy link
Contributor

  • resume runtime on fired triggers

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds “auto-resume” behavior to the resumable runtime so that if resume triggers are already fired at the time of suspension, the runtime immediately resumes without requiring an external resume call.

Changes:

  • Implement auto-resume flow in UiPathResumableRuntime.execute() and .stream() when fired triggers are detected.
  • Introduce UiPathSuspensionResult to carry both the suspension UiPathRuntimeResult and any fired trigger resume-map.
  • Add async tests covering auto-resume scenarios (none/partial/all fired; multiple auto-resumes; stream behavior).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/uipath/runtime/resumable/runtime.py Adds fired-trigger detection at suspension time and recursive auto-resume for execute() and stream().
src/uipath/runtime/result.py Adds UiPathSuspensionResult model used to return both runtime result and fired trigger map.
tests/test_resumable.py Adds coverage for auto-resume behavior across several trigger-firing patterns.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@radu-mocanu radu-mocanu force-pushed the feat/resume-runtime-on-fired-triggers branch 2 times, most recently from 8424ccb to c360384 Compare January 26, 2026 16:31
@radu-mocanu radu-mocanu force-pushed the feat/resume-runtime-on-fired-triggers branch from c360384 to f88511b Compare February 3, 2026 11:16
@radu-mocanu radu-mocanu requested a review from a team as a code owner February 3, 2026 11:16
@radu-mocanu radu-mocanu force-pushed the feat/resume-runtime-on-fired-triggers branch from f88511b to abef1a7 Compare February 3, 2026 16:49
final_result = event
else:
yield event
while True:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execution_completed = False
while not execution_completed

and change the return with

execution_completed = True

I remember issues with returning during a while loop in an async generator

if final_result:
suspension_result = await self._handle_suspension(final_result)

if suspension_result.status != UiPathRuntimeStatus.SUSPENDED or not (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We either use is_suspended everywhere or just check for UiPathRuntimeStatus everywhere (I would incline towards the latter in this low-level concepts)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, forgot to replace it here.
I would rollback to the UiPathRuntimeStatus check to keep the runtime more explicit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants