fix: assign fired_triggers var, avoid checking api triggers#84
Merged
radu-mocanu merged 1 commit intomainfrom Feb 16, 2026
Merged
fix: assign fired_triggers var, avoid checking api triggers#84radu-mocanu merged 1 commit intomainfrom
radu-mocanu merged 1 commit intomainfrom
Conversation
95cefc8 to
4bc5995
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the stream method of UiPathResumableRuntime where accessing fired_triggers would cause an UnboundLocalError when the runtime returns a non-suspended result. The fix initializes fired_triggers to None and moves the resume preparation code outside the conditional block to execute at the end of every while loop iteration, making it consistent with the pattern used in the execute method.
Changes:
- Initialize
fired_triggers = Noneat the start of the while loop to preventUnboundLocalError - Move resume preparation code (lines 137-144) outside the conditional block to execute at the end of each iteration
- Bump version from 0.8.3 to 0.8.4 (patch version for bug fix)
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/uipath/runtime/resumable/runtime.py | Fixed UnboundLocalError by initializing fired_triggers and repositioning resume preparation code to execute after each iteration |
| pyproject.toml | Version bump to 0.8.4 for bug fix release |
| uv.lock | Updated lock file to reflect new version |
Comments suppressed due to low confidence (1)
src/uipath/runtime/resumable/runtime.py:144
- If the delegate's stream method doesn't yield a UiPathRuntimeResult (violating the protocol contract), final_result remains None and the while loop continues indefinitely with input=None and resume=True. Consider adding an else clause to handle this defensive case by setting execution_completed=True or raising an error to prevent an infinite loop.
if final_result:
suspension_result = await self._handle_suspension(final_result)
if suspension_result.status != UiPathRuntimeStatus.SUSPENDED or not (
fired_triggers := await self._restore_resume_input(None)
):
yield suspension_result
execution_completed = True
# Note: when resuming a job, orchestrator deletes all triggers associated with it,
# thus we can resume the runtime at this point without worrying a trigger may be fired 'twice'
input = fired_triggers
if not options:
options = UiPathStreamOptions(resume=True)
else:
options.resume = True
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2854158 to
fecf8bd
Compare
5f2a4c3 to
526118e
Compare
526118e to
65477a9
Compare
cristipufu
approved these changes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.