Skip to content

Conversation

@AAgnihotry
Copy link

@AAgnihotry AAgnihotry commented Jan 28, 2026

Summary

Adds create_root_span parameter to UiPathExecutionRuntime to decouple logging context setup from root span creation.

Changes

  • Added create_root_span parameter (default: True) to UiPathExecutionRuntime.__init__()
  • When True: Creates root span with execution.id (existing behavior)
  • When False: Sets up logging context only, no root span created
  • Updated both execute() and stream() methods to respect this flag

Use Case

Enables evaluation runtime to avoid duplicate root spans while maintaining proper logging context:

  • Evaluation runtime sets create_root_span=False
  • Logging context is set up with execution_id for proper log filtering
  • Agent execution spans inherit execution.id from parent "Evaluation" span
  • No intermediate root span cluttering the trace hierarchy

Span Hierarchy

Before (with root span):

Evaluation Set Run
  └─ Evaluation
     └─ root  ← unnecessary intermediate span
        └─ Agent run

After (with create_root_span=False):

Evaluation Set Run
  └─ Evaluation
     └─ Agent run  ← directly under Evaluation

Testing

  • Maintains backward compatibility (default: True)
  • All existing tests pass
  • Used by uipath-python eval runtime

🤖 Generated with Claude Code

Development Package

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath-runtime==0.6.3.dev1000750246",

  # Any version from PR
  "uipath-runtime>=0.6.3.dev1000750000,<0.6.3.dev1000760000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-runtime = { index = "testpypi" }

Added `create_root_span` parameter (default: True) to decouple logging
context from root span creation. When False, only logging context is
set up without creating a root span, allowing child spans to inherit
execution.id from parent spans in the call stack.

Use case: Evaluation runtime can pass create_root_span=False to avoid
duplicate root spans while maintaining proper logging context.
AAgnihotry and others added 2 commits January 28, 2026 12:49
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@AAgnihotry AAgnihotry force-pushed the feat/create-root-span-parameter branch from be5cd76 to a1c2f35 Compare January 28, 2026 21:17
@AAgnihotry AAgnihotry closed this Jan 28, 2026
@cristipufu cristipufu deleted the feat/create-root-span-parameter branch January 29, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant