diff --git a/pyproject.toml b/pyproject.toml index 7fb9531..b031523 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-runtime" -version = "0.11.7" +version = "0.11.8" 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" diff --git a/src/uipath/runtime/context.py b/src/uipath/runtime/context.py index 924548c..820bb18 100644 --- a/src/uipath/runtime/context.py +++ b/src/uipath/runtime/context.py @@ -51,6 +51,9 @@ class UiPathRuntimeContext(BaseModel): True, description="Whether to emit the exchange end event for CAS", ) + conversational_outputs_enabled: bool = Field( + False, description="Whether conversational agent output-generation is enabled." + ) conversational_user_id: str | None = Field( None, description="Conversation owner id for CAS (a real cloud user id or a synthetic user id)", @@ -408,6 +411,7 @@ def from_config( "conversationalService.exchangeId": "exchange_id", "conversationalService.messageId": "message_id", "conversationalService.endExchange": "end_exchange", + "conversationalService.enableOutputs": "conversational_outputs_enabled", "conversationalService.conversationalUserId": "conversational_user_id", "mcpServer.id": "mcp_server_id", "mcpServer.slug": "mcp_server_slug", diff --git a/tests/test_context.py b/tests/test_context.py index d3ed4ae..30cef65 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -183,6 +183,7 @@ def test_from_config_extracts_fps_properties_without_runtime(tmp_path: Path) -> "conversationalService.conversationId": "conv-123", "conversationalService.exchangeId": "ex-456", "conversationalService.messageId": "msg-789", + "conversationalService.enableOutputs": True, "conversationalService.conversationalUserId": "owner-guid", "mcpServer.id": "server-id-123", "mcpServer.slug": "my-mcp-server", @@ -196,11 +197,30 @@ def test_from_config_extracts_fps_properties_without_runtime(tmp_path: Path) -> assert ctx.conversation_id == "conv-123" assert ctx.exchange_id == "ex-456" assert ctx.message_id == "msg-789" + assert ctx.conversational_outputs_enabled is True assert ctx.conversational_user_id == "owner-guid" assert ctx.mcp_server_id == "server-id-123" assert ctx.mcp_server_slug == "my-mcp-server" +def test_from_config_conversational_outputs_enabled_defaults_false( + tmp_path: Path, +) -> None: + """When enableOutputs isn't in fpsProperties, the field defaults to False — + legacy safe behavior for pre-migration conversational agents.""" + cfg = { + "fpsProperties": { + "conversationalService.conversationId": "conv-legacy", + } + } + config_path = tmp_path / "uipath.json" + config_path.write_text(json.dumps(cfg)) + + ctx = UiPathRuntimeContext.from_config(config_path=str(config_path)) + + assert ctx.conversational_outputs_enabled is False + + def test_from_config_loads_runtime_and_fps_properties(tmp_path: Path) -> None: """runtime.* keys and fpsProperties.* keys should both be applied.""" cfg = { diff --git a/uv.lock b/uv.lock index 03ad15a..cd8797c 100644 --- a/uv.lock +++ b/uv.lock @@ -1153,7 +1153,7 @@ wheels = [ [[package]] name = "uipath-runtime" -version = "0.11.7" +version = "0.11.8" source = { editable = "." } dependencies = [ { name = "chardet" },