Skip to content

feat: chat runtime support multiple triggers#78

Open
GabrielVasilescu04 wants to merge 1 commit intomainfrom
feature/chat-runtime-mutliple-triggers
Open

feat: chat runtime support multiple triggers#78
GabrielVasilescu04 wants to merge 1 commit intomainfrom
feature/chat-runtime-mutliple-triggers

Conversation

@GabrielVasilescu04
Copy link
Contributor

@GabrielVasilescu04 GabrielVasilescu04 commented Feb 6, 2026

Description

Add support for multiple triggers in chat runtime

Development Package

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath-runtime==0.6.3.dev1000780255",

  # Any version from PR
  "uipath-runtime>=0.6.3.dev1000780000,<0.6.3.dev1000790000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-runtime = { index = "testpypi" }

@GabrielVasilescu04 GabrielVasilescu04 self-assigned this Feb 6, 2026
@GabrielVasilescu04 GabrielVasilescu04 requested a review from a team as a code owner February 6, 2026 14:58
Copilot AI review requested due to automatic review settings February 6, 2026 14:58
@GabrielVasilescu04 GabrielVasilescu04 force-pushed the feature/chat-runtime-mutliple-triggers branch from 1edc828 to bc600e5 Compare February 6, 2026 15:00
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 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 per interrupt_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.

Comment on lines 87 to 90
if (
runtime_result.status == UiPathRuntimeStatus.SUSPENDED
and runtime_result.trigger
and runtime_result.trigger.trigger_type
== UiPathResumeTriggerType.API
and runtime_result.triggers
):
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
)

resume_data = await self.chat_bridge.wait_for_resume()

Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
if trigger.interrupt_id is None:
raise ValueError(
"Received API resume trigger without an interrupt_id; "
"cannot build resume map entry."
)

Copilot uses AI. Check for mistakes.
@GabrielVasilescu04 GabrielVasilescu04 force-pushed the feature/chat-runtime-mutliple-triggers branch from bc600e5 to 76c04ca Compare February 6, 2026 15:59
@GabrielVasilescu04 GabrielVasilescu04 force-pushed the feature/chat-runtime-mutliple-triggers branch from 76c04ca to ecf1f44 Compare February 6, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants