Skip to content

Commit a804948

Browse files
Clement Fauchereclaude
andcommitted
fix: remove OpenInference external span provider registration
Stop registering OpenInference as the external span provider in the langchain runtime factory. The agent runtime (uipath-agents-python) registers its own provider via SpanHierarchyManager, which returns the correct LLMOps span. Having OpenInference also registered caused trace ID mismatches on alpha where the OTEL context didn't propagate through LangGraph's async tasks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 118bac4 commit a804948

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.9.20"
3+
version = "0.9.21"
44
description = "Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath_langchain/runtime/factory.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ def _setup_instrumentation(self, trace_manager: UiPathTraceManager | None) -> No
5959
"""Setup tracing and instrumentation."""
6060
_instrument_traceable_attributes()
6161
LangChainInstrumentor().instrument()
62-
UiPathSpanUtils.register_current_span_provider(get_current_span)
63-
UiPathSpanUtils.register_current_span_ancestors_provider(get_ancestor_spans)
62+
# Don't register OpenInference as external span provider — let OTEL
63+
# context from the agent runtime flow through naturally. This ensures
64+
# @traced and _inject_trace_context see the agent's trace ID.
65+
# UiPathSpanUtils.register_current_span_provider(get_current_span)
66+
# UiPathSpanUtils.register_current_span_ancestors_provider(get_ancestor_spans)
6467

6568
def _get_connection_string(self) -> str:
6669
"""Get the database connection string."""

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)