fix: auto-resume conversational llamaindex agents#351
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the uipath-llamaindex runtime so that conversational workflows automatically resume from previously stored workflow context when it exists, aligning behavior with the langgraph runtime’s “auto-restore by thread/state key” model.
Changes:
- Add an
is_conversationalruntime flag and auto-resume logic when prior stored context is detected. - Track whether context was restored from storage (
_has_prior_state) during context load. - Read
runtimeOptions.isConversationalfrom config and pass it into the runtime via the factory; bump package version to0.5.14.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/uipath-llamaindex/src/uipath_llamaindex/runtime/runtime.py | Adds conversational auto-resume behavior based on restored context presence. |
| packages/uipath-llamaindex/src/uipath_llamaindex/runtime/factory.py | Loads isConversational flag and wires it into runtime construction. |
| packages/uipath-llamaindex/pyproject.toml | Bumps package version to 0.5.14. |
| packages/uipath-llamaindex/uv.lock | Updates lock metadata and package version entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| try: | ||
| with open(self.context.config_path, "r") as f: | ||
| config = json.load(f) | ||
| except (FileNotFoundError, json.JSONDecodeError): |
| workflow_input = UiPathChatMessagesMapper.map_input(input or {}) | ||
| is_resuming = bool(options and options.resume) | ||
|
|
||
| self._context = await self._load_context() | ||
|
|
||
| is_resuming = bool(options and options.resume) or ( | ||
| self.is_conversational and self._has_prior_state | ||
| ) | ||
|
|
f719f2e to
702ffc8
Compare
|
|
Closing — the original premise was wrong. Turn 2 already works on main when locally running with |



Summary
isConversationalis read fromuipath.jsonand surfaced to the runtime via the factoryWhy
the llamaindex runtime previously required callers to pass a resume signal explicitly; without it, new input was delivered to a fresh
start_eventinstead of the suspendedHumanResponseEvent, so prior context loaded from storage was never used.Development Packages
uipath-llamaindex