Skip to content

Commit d2fd27b

Browse files
feat: map parent_operation_id from runtime_config
1 parent c061349 commit d2fd27b

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-runtime"
3-
version = "0.8.6"
3+
version = "0.8.7"
44
description = "Runtime abstractions and interfaces for building agents and automation scripts in the UiPath ecosystem"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath/runtime/context.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class UiPathRuntimeContext(BaseModel):
4343
org_id: str | None = None
4444
folder_key: str | None = None
4545
process_key: str | None = None
46+
parent_operation_id: str | None = None
4647
config_path: str = "uipath.json"
4748
runtime_dir: str | None = Field(
4849
"__uipath", description="Directory for runtime files"
@@ -376,6 +377,14 @@ def from_config(
376377
attributes_set.add(attr_name)
377378
setattr(instance, attr_name, runtime_config[config_key])
378379

380+
# Handle InternalArguments
381+
internal_arguments = runtime_config.get("internalArguments", {})
382+
if internal_arguments and isinstance(internal_arguments, dict):
383+
parent_operation_id = internal_arguments.get("parentOperationId")
384+
if parent_operation_id:
385+
attributes_set.add("parent_operation_id")
386+
instance.parent_operation_id = parent_operation_id
387+
379388
# Handle fpsProperties mapping
380389
for config_key, attr_name in fps_mappings.items():
381390
if config_key in fps_config and hasattr(instance, attr_name):

tests/test_context.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ def test_from_config_loads_runtime_and_fps_properties(tmp_path: Path) -> None:
207207
"outputFile": "my_output.json",
208208
"stateFile": "my_state.db",
209209
"logsFile": "my_logs.log",
210+
"internalArguments": {"ParentOperationId": "operationId-123"},
210211
},
211212
"fpsProperties": {
212213
"conversationalService.conversationId": "conv-abc",
@@ -229,6 +230,9 @@ def test_from_config_loads_runtime_and_fps_properties(tmp_path: Path) -> None:
229230
assert ctx.state_file == "my_state.db"
230231
assert ctx.logs_file == "my_logs.log"
231232

233+
# parentOperationId is mapped correctly from internal_arguments
234+
assert ctx.parent_operation_id == "operationId-123"
235+
232236
# fpsProperties mapping
233237
assert ctx.conversation_id == "conv-abc"
234238
assert ctx.exchange_id == "ex-def"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)