From 73e85d32489b9e963c4f0ade00c605afdb8f694d Mon Sep 17 00:00:00 2001 From: GabrielVasilescu04 Date: Tue, 17 Feb 2026 16:09:07 +0200 Subject: [PATCH] feat: map parent_operation_id from runtime_config --- pyproject.toml | 2 +- src/uipath/runtime/context.py | 9 +++++++++ tests/test_context.py | 4 ++++ uv.lock | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 80086a5..e4aea0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-runtime" -version = "0.8.6" +version = "0.8.7" 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 6ee853c..ff7020c 100644 --- a/src/uipath/runtime/context.py +++ b/src/uipath/runtime/context.py @@ -43,6 +43,7 @@ class UiPathRuntimeContext(BaseModel): org_id: str | None = None folder_key: str | None = None process_key: str | None = None + parent_operation_id: str | None = None config_path: str = "uipath.json" runtime_dir: str | None = Field( "__uipath", description="Directory for runtime files" @@ -376,6 +377,14 @@ def from_config( attributes_set.add(attr_name) setattr(instance, attr_name, runtime_config[config_key]) + # Handle InternalArguments + internal_arguments = runtime_config.get("internalArguments", {}) + if internal_arguments and isinstance(internal_arguments, dict): + parent_operation_id = internal_arguments.get("parentOperationId") + if parent_operation_id: + attributes_set.add("parent_operation_id") + instance.parent_operation_id = parent_operation_id + # Handle fpsProperties mapping for config_key, attr_name in fps_mappings.items(): if config_key in fps_config and hasattr(instance, attr_name): diff --git a/tests/test_context.py b/tests/test_context.py index e51e917..9231f65 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -207,6 +207,7 @@ def test_from_config_loads_runtime_and_fps_properties(tmp_path: Path) -> None: "outputFile": "my_output.json", "stateFile": "my_state.db", "logsFile": "my_logs.log", + "internalArguments": {"parentOperationId": "operationId-123"}, }, "fpsProperties": { "conversationalService.conversationId": "conv-abc", @@ -229,6 +230,9 @@ def test_from_config_loads_runtime_and_fps_properties(tmp_path: Path) -> None: assert ctx.state_file == "my_state.db" assert ctx.logs_file == "my_logs.log" + # parentOperationId is mapped correctly from internal_arguments + assert ctx.parent_operation_id == "operationId-123" + # fpsProperties mapping assert ctx.conversation_id == "conv-abc" assert ctx.exchange_id == "ex-def" diff --git a/uv.lock b/uv.lock index cf6e941..35cf6f7 100644 --- a/uv.lock +++ b/uv.lock @@ -1005,7 +1005,7 @@ wheels = [ [[package]] name = "uipath-runtime" -version = "0.8.6" +version = "0.8.7" source = { editable = "." } dependencies = [ { name = "uipath-core" },