feat: chat runtime support multiple triggers#78
feat: chat runtime support multiple triggers#78GabrielVasilescu04 wants to merge 1 commit intomainfrom
Conversation
1edc828 to
bc600e5
Compare
There was a problem hiding this comment.
Pull request overview
Adds multi-trigger suspension support to the chat runtime so it can handle (and selectively resolve) multiple resume triggers during a single suspension cycle.
Changes:
- Update
UiPathChatRuntime.stream()to iterate over multiple API resume triggers and collect resume data perinterrupt_id. - Extend chat runtime tests to cover multi-API-trigger suspensions and mixed (API + non-API) trigger filtering behavior.
- Bump package version to
0.6.3(and lockfile accordingly).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/uipath/runtime/chat/runtime.py |
Implements multi-trigger handling in the chat suspension/resume flow. |
tests/test_chat.py |
Updates existing suspension test expectations and adds coverage for multi-trigger and mixed-trigger scenarios. |
pyproject.toml |
Version bump to 0.6.3. |
uv.lock |
Lockfile update reflecting version bump. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if ( | ||
| runtime_result.status == UiPathRuntimeStatus.SUSPENDED | ||
| and runtime_result.trigger | ||
| and runtime_result.trigger.trigger_type | ||
| == UiPathResumeTriggerType.API | ||
| and runtime_result.triggers | ||
| ): |
There was a problem hiding this comment.
The new suspension handling only runs when runtime_result.triggers is set. If a delegate runtime still populates only the legacy runtime_result.trigger field (single-trigger suspensions), API suspensions will no longer be intercepted/resumed and will be yielded back to the caller. Consider falling back to runtime_result.trigger when triggers is None/empty to preserve backward compatibility.
| ) | ||
|
|
||
| resume_data = await self.chat_bridge.wait_for_resume() | ||
|
|
There was a problem hiding this comment.
resume_map[trigger.interrupt_id] = resume_data assumes trigger.interrupt_id is non-null, but UiPathResumeTrigger.interrupt_id is typed as optional. If a trigger comes in without an interrupt id, this will either create an invalid resume map key or cause downstream errors. Add an explicit check (and raise a clear error) before using interrupt_id as the map key.
| if trigger.interrupt_id is None: | |
| raise ValueError( | |
| "Received API resume trigger without an interrupt_id; " | |
| "cannot build resume map entry." | |
| ) |
bc600e5 to
76c04ca
Compare
76c04ca to
ecf1f44
Compare
Description
Add support for multiple triggers in chat runtime
Development Package