Skip to content
Closed
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.6.2"
version = "0.6.3"
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
20 changes: 17 additions & 3 deletions src/uipath/runtime/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,28 @@ def __init__(
span_attributes: dict[str, str] | None = None,
log_handler: UiPathRuntimeExecutionLogHandler | None = None,
execution_id: str | None = None,
create_root_span: bool = True,
):
"""Initialize the executor."""
"""Initialize the executor.

Args:
delegate: The runtime to wrap with execution context
trace_manager: Trace manager for span management
root_span: Name of the root span to create (if create_root_span=True)
span_attributes: Attributes to add to the root span
log_handler: Optional log handler for this execution
execution_id: Execution ID for logging context and span propagation
create_root_span: Whether to create a root span (default: True).
When False, only logging context is set up, allowing child
spans to inherit execution.id from parent spans in the call stack.
"""
self.delegate = delegate
self.trace_manager = trace_manager
self.root_span = root_span
self.span_attributes = span_attributes
self.execution_id = execution_id
self.log_handler = log_handler
self.create_root_span = create_root_span
if execution_id is not None and log_handler is None:
self.log_handler = UiPathRuntimeExecutionLogHandler(execution_id)

Expand All @@ -173,7 +187,7 @@ async def execute(
log_interceptor.setup()

try:
if self.execution_id:
if self.create_root_span and self.execution_id:
with self.trace_manager.start_execution_span(
self.root_span,
execution_id=self.execution_id,
Expand Down Expand Up @@ -210,7 +224,7 @@ async def stream(
)
log_interceptor.setup()
try:
if self.execution_id:
if self.create_root_span and self.execution_id:
with self.trace_manager.start_execution_span(
self.root_span,
execution_id=self.execution_id,
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

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