From 9b05fc1ea286202a382fdae9d9043bdef9c06054 Mon Sep 17 00:00:00 2001 From: Daniel Joica Date: Fri, 6 Nov 2026 11:50:38 +0200 Subject: [PATCH 1/3] refactor(platform): remove the EnableTraceContextHeaders feature flag The flag is on in every important environment, so trace context headers are now always sent to the LLM Gateway. Co-Authored-By: Claude Opus 5.5 --- packages/uipath-platform/pyproject.toml | 2 +- .../uipath/platform/chat/llm_trace_context.py | 8 ++--- .../tests/services/test_llm_trace_context.py | 33 ++----------------- packages/uipath-platform/uv.lock | 4 +-- 4 files changed, 8 insertions(+), 39 deletions(-) diff --git a/packages/uipath-platform/pyproject.toml b/packages/uipath-platform/pyproject.toml index 56920f06c..e21ae1310 100644 --- a/packages/uipath-platform/pyproject.toml +++ b/packages/uipath-platform/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-platform" -version = "0.3.0" +version = "0.3.1" 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/src/uipath/platform/chat/llm_trace_context.py b/packages/uipath-platform/src/uipath/platform/chat/llm_trace_context.py index c10047669..3d758c40d 100644 --- a/packages/uipath-platform/src/uipath/platform/chat/llm_trace_context.py +++ b/packages/uipath-platform/src/uipath/platform/chat/llm_trace_context.py @@ -1,7 +1,6 @@ """W3C-style trace context headers for LLM Gateway requests.""" from opentelemetry import trace -from uipath.core.feature_flags import FeatureFlags from uipath.core.tracing.span_utils import UiPathSpanUtils from ..common._config import UiPathConfig @@ -21,12 +20,9 @@ def build_trace_context_headers( extra_baggage: Additional baggage entries (e.g. ``["source=agents"]``) that callers can inject alongside the platform-level entries. - Returns an empty dict when the ``EnableTraceContextHeaders`` feature flag - is not enabled, or when no active span is present. + Returns an empty dict when there is no active span and no platform-level + baggage to send. """ - if not FeatureFlags.is_flag_enabled("EnableTraceContextHeaders"): - return {} - headers: dict[str, str] = {} llmops_span = UiPathSpanUtils.get_external_current_span() span = llmops_span or trace.get_current_span() diff --git a/packages/uipath-platform/tests/services/test_llm_trace_context.py b/packages/uipath-platform/tests/services/test_llm_trace_context.py index a05032113..5bbd4428d 100644 --- a/packages/uipath-platform/tests/services/test_llm_trace_context.py +++ b/packages/uipath-platform/tests/services/test_llm_trace_context.py @@ -5,13 +5,10 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.trace import NonRecordingSpan, SpanContext, TraceFlags -from uipath.core.feature_flags import FeatureFlags from uipath.platform.chat.llm_trace_context import build_trace_context_headers from uipath.platform.constants import ENV_PROJECT_KEY -FEATURE_FLAG = "EnableTraceContextHeaders" - def _make_span(): """Create a real OTEL span for testing.""" @@ -20,26 +17,8 @@ def _make_span(): return tracer.start_span("test-span") -class TestFeatureFlagDisabled: - """When the feature flag is off, no headers are returned.""" - - def setup_method(self) -> None: - FeatureFlags.reset_flags() - - def test_returns_empty_dict_by_default(self) -> None: - assert build_trace_context_headers() == {} - - def test_returns_empty_dict_when_explicitly_disabled(self) -> None: - FeatureFlags.configure_flags({FEATURE_FLAG: False}) - assert build_trace_context_headers() == {} - - class TestTraceparentHeader: - """When enabled, x-uipath-traceparent-id is populated from config + span.""" - - def setup_method(self) -> None: - FeatureFlags.reset_flags() - FeatureFlags.configure_flags({FEATURE_FLAG: True}) + """x-uipath-traceparent-id is populated from config + span.""" def test_traceparent_from_config_and_span(self) -> None: span = _make_span() @@ -111,14 +90,12 @@ def test_no_traceparent_with_invalid_span(self) -> None: class TestBaggageHeader: - """When enabled, x-uipath-tracebaggage is populated from UiPathConfig.""" + """x-uipath-tracebaggage is populated from UiPathConfig.""" def setup_method(self) -> None: from uipath.platform.common._span_utils import _read_config_id _read_config_id.cache_clear() - FeatureFlags.reset_flags() - FeatureFlags.configure_flags({FEATURE_FLAG: True}) def test_all_env_vars_present(self) -> None: env = { @@ -199,11 +176,7 @@ def test_extra_baggage_only(self) -> None: class TestBothHeaders: - """When enabled with an active span and env vars, both headers are present.""" - - def setup_method(self) -> None: - FeatureFlags.reset_flags() - FeatureFlags.configure_flags({FEATURE_FLAG: True}) + """With an active span and env vars, both headers are present.""" def test_both_headers_present(self) -> None: span = _make_span() diff --git a/packages/uipath-platform/uv.lock b/packages/uipath-platform/uv.lock index fc04aa5b1..6d8462fe9 100644 --- a/packages/uipath-platform/uv.lock +++ b/packages/uipath-platform/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 3 +revision = 5 requires-python = ">=3.11" [options] @@ -1095,7 +1095,7 @@ dev = [ [[package]] name = "uipath-platform" -version = "0.3.0" +version = "0.3.1" source = { editable = "." } dependencies = [ { name = "anyio" }, From 99ec1c3b5e70235b366b6f4de16480cf7991270d Mon Sep 17 00:00:00 2001 From: Daniel Joica Date: Fri, 6 Nov 2026 11:53:42 +0200 Subject: [PATCH 2/3] chore(platform): keep uv.lock at revision 3 Co-Authored-By: Claude Opus 5.5 --- packages/uipath-platform/uv.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/uipath-platform/uv.lock b/packages/uipath-platform/uv.lock index 6d8462fe9..d021cff2a 100644 --- a/packages/uipath-platform/uv.lock +++ b/packages/uipath-platform/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 5 +revision = 3 requires-python = ">=3.11" [options] From 6d0c888bb8707e5bee2dbc36347941a89c3fe92e Mon Sep 17 00:00:00 2001 From: Daniel Joica Date: Fri, 6 Nov 2026 12:34:45 +0200 Subject: [PATCH 3/3] chore(uipath): relock for uipath-platform 0.3.1 Co-Authored-By: Claude Opus 5.5 --- packages/uipath/uv.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/uipath/uv.lock b/packages/uipath/uv.lock index 35b84ec80..23d60b2eb 100644 --- a/packages/uipath/uv.lock +++ b/packages/uipath/uv.lock @@ -2762,7 +2762,7 @@ wheels = [ [[package]] name = "uipath-platform" -version = "0.3.0" +version = "0.3.1" source = { editable = "../uipath-platform" } dependencies = [ { name = "anyio" },