Skip to content
Open
Show file tree
Hide file tree
Changes from all 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.1"
version = "0.11.2"
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",
)
conversational_user_id: str | None = Field(
None,
description="Conversation owner id for CAS (a real cloud user id or a synthetic user id)",
Expand Down Expand Up @@ -368,6 +372,7 @@ def from_config(
"conversationalService.conversationId": "conversation_id",
"conversationalService.exchangeId": "exchange_id",
"conversationalService.messageId": "message_id",
"conversationalService.endExchange": "end_exchange",
"conversationalService.conversationalUserId": "conversational_user_id",
"mcpServer.id": "mcp_server_id",
"mcpServer.slug": "mcp_server_slug",
Expand Down
32 changes: 32 additions & 0 deletions tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,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