Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-runtime"
version = "0.11.0"
version = "0.12.0"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can get away with a patch increase to avoid incrementing the ranges in all the repos

description = "Runtime abstractions and interfaces for building agents and automation scripts in the UiPath ecosystem"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
5 changes: 5 additions & 0 deletions src/uipath/runtime/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class UiPathRuntimeContext(BaseModel):
)
exchange_id: str | None = Field(None, description="Exchange identifier for CAS")
message_id: str | None = Field(None, description="Message identifier for CAS")
end_exchange: bool = Field(
True,
description="Whether to emit the exchange end event for CAS",
)
voice_mode: Literal["session"] | None = Field(
None, description="Voice job type for CAS"
)
Expand Down Expand Up @@ -364,6 +368,7 @@ def from_config(
"conversationalService.conversationId": "conversation_id",
"conversationalService.exchangeId": "exchange_id",
"conversationalService.messageId": "message_id",
"conversationalService.endExchange": "end_exchange",
"mcpServer.id": "mcp_server_id",
"mcpServer.slug": "mcp_server_slug",
"voice.mode": "voice_mode",
Expand Down
32 changes: 32 additions & 0 deletions tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,38 @@ def test_from_config_loads_runtime_and_fps_properties(tmp_path: Path) -> None:
assert ctx.mcp_server_slug == "test-server-slug"


def test_from_config_maps_end_exchange_fps_property(tmp_path: Path) -> None:
"""conversationalService.endExchange should map onto end_exchange."""
cfg = {
"fpsProperties": {
"conversationalService.conversationId": "conv-123",
"conversationalService.exchangeId": "ex-456",
"conversationalService.endExchange": False,
}
}
config_path = tmp_path / "uipath.json"
config_path.write_text(json.dumps(cfg))

ctx = UiPathRuntimeContext.from_config(config_path=str(config_path))

assert ctx.end_exchange is False


def test_end_exchange_defaults_true_when_fps_property_absent(tmp_path: Path) -> None:
"""end_exchange defaults to True (legacy behavior) when the fps key is missing."""
cfg = {
"fpsProperties": {
"conversationalService.conversationId": "conv-123",
}
}
config_path = tmp_path / "uipath.json"
config_path.write_text(json.dumps(cfg))

ctx = UiPathRuntimeContext.from_config(config_path=str(config_path))

assert ctx.end_exchange is True


def test_result_file_written_on_faulted_trigger_error(tmp_path: Path) -> None:
runtime_dir = tmp_path / "runtime"
ctx = UiPathRuntimeContext(
Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading