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..d021cff2a 100644 --- a/packages/uipath-platform/uv.lock +++ b/packages/uipath-platform/uv.lock @@ -1095,7 +1095,7 @@ dev = [ [[package]] name = "uipath-platform" -version = "0.3.0" +version = "0.3.1" source = { editable = "." } dependencies = [ { name = "anyio" }, 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" },