From cf3cdd11e0b48e8ed450a6bebedb90ca961e27ed Mon Sep 17 00:00:00 2001 From: Clement Fauchere Date: Tue, 7 Apr 2026 17:45:44 -0500 Subject: [PATCH 1/2] fix(platform): use LLMOps span ID in x-uipath-traceparent-id header The trace header now prefers the external (LLMOps) span over the raw OTEL span, so the span ID in the header matches what's visible in the LLMOps trace UI. This enables end-to-end correlation between agent traces and downstream service logs (e.g. Context Grounding / ECS). Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/uipath/platform/common/_base_service.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/uipath-platform/src/uipath/platform/common/_base_service.py b/packages/uipath-platform/src/uipath/platform/common/_base_service.py index d236e4ef5..2bd7c7ec3 100644 --- a/packages/uipath-platform/src/uipath/platform/common/_base_service.py +++ b/packages/uipath-platform/src/uipath/platform/common/_base_service.py @@ -67,8 +67,15 @@ def _get_caller_component() -> str: def _inject_trace_context(headers: dict[str, str]) -> None: - """Inject UiPath trace context header from the active OTEL span.""" - span = trace.get_current_span() + """Inject UiPath trace context header from the active OTEL span. + + Prefers the LLMOps tool span (from ContextVar) over the raw OTEL span, + so the header carries the span ID visible in the LLMOps trace. + """ + from uipath.core.tracing.span_utils import UiPathSpanUtils + + llmops_span = UiPathSpanUtils.get_external_current_span() + span = llmops_span or trace.get_current_span() ctx = span.get_span_context() if ctx.trace_id and ctx.span_id: headers[_TRACE_PARENT_HEADER] = ( From 143ac1889abbfb7096e659129725b120baacf303 Mon Sep 17 00:00:00 2001 From: Clement Fauchere Date: Tue, 7 Apr 2026 17:55:09 -0500 Subject: [PATCH 2/2] chore(platform): bump version to 0.1.22 Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/uipath-platform/pyproject.toml | 2 +- packages/uipath-platform/uv.lock | 2 +- packages/uipath/uv.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/uipath-platform/pyproject.toml b/packages/uipath-platform/pyproject.toml index b53fb68f9..44f48463f 100644 --- a/packages/uipath-platform/pyproject.toml +++ b/packages/uipath-platform/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-platform" -version = "0.1.21" +version = "0.1.22" description = "HTTP client library for programmatic access to UiPath Platform" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/packages/uipath-platform/uv.lock b/packages/uipath-platform/uv.lock index 648df8ab4..0494f3530 100644 --- a/packages/uipath-platform/uv.lock +++ b/packages/uipath-platform/uv.lock @@ -1088,7 +1088,7 @@ dev = [ [[package]] name = "uipath-platform" -version = "0.1.21" +version = "0.1.22" source = { editable = "." } dependencies = [ { name = "httpx" }, diff --git a/packages/uipath/uv.lock b/packages/uipath/uv.lock index b8a817758..679981407 100644 --- a/packages/uipath/uv.lock +++ b/packages/uipath/uv.lock @@ -2682,7 +2682,7 @@ dev = [ [[package]] name = "uipath-platform" -version = "0.1.21" +version = "0.1.22" source = { editable = "../uipath-platform" } dependencies = [ { name = "httpx" },