Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/uipath-platform/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-platform"
version = "0.1.48"
version = "0.1.49"
description = "HTTP client library for programmatic access to UiPath Platform"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

logger = logging.getLogger(__name__)

# SourceEnum.Robots = 4 (default for Python SDK / coded agents)
DEFAULT_SOURCE = 4
# SourceEnum.CodedAgents = 10 (default for Python SDK / coded agents)
DEFAULT_SOURCE = 10


class AttachmentProvider(IntEnum):
Expand Down
12 changes: 6 additions & 6 deletions packages/uipath-platform/tests/services/test_span_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ def test_uipath_span_missing_execution_type_and_agent_version(self):
assert span_dict["AgentVersion"] is None

@patch.dict(os.environ, {"UIPATH_ORGANIZATION_ID": "test-org"})
def test_uipath_span_source_defaults_to_robots(self):
"""Test that Source defaults to 4 (Robots) and ignores attributes.source."""
def test_uipath_span_source_defaults_to_coded_agents(self):
"""Test that Source defaults to 10 (CodedAgents) and ignores attributes.source."""
mock_span = Mock(spec=OTelSpan)

trace_id = 0x123456789ABCDEF0123456789ABCDEF0
Expand All @@ -387,9 +387,9 @@ def test_uipath_span_source_defaults_to_robots(self):
uipath_span = _SpanUtils.otel_span_to_uipath_span(mock_span)
span_dict = uipath_span.to_dict()

# Top-level Source should be 4 (Robots), string "runtime" is ignored
assert uipath_span.source == 4
assert span_dict["Source"] == 4
# Top-level Source should be 10 (CodedAgents), string "runtime" is ignored
assert uipath_span.source == 10
assert span_dict["Source"] == 10

# attributes.source string should still be in Attributes JSON
attrs = json.loads(span_dict["Attributes"])
Expand All @@ -408,7 +408,7 @@ def test_uipath_span_source_override_with_uipath_source(self):
mock_span.name = "test-span"
mock_span.parent = None
mock_span.status.status_code = StatusCode.OK
# uipath.source=1 (Agents) overrides default of 4 (Robots)
# uipath.source=1 (Agents) overrides default of 10 (CodedAgents)
mock_span.attributes = {"uipath.source": 1, "source": "runtime"}
mock_span.events = []
mock_span.links = []
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath-platform/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/uipath/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath"
version = "2.10.62"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we also re-generate the uv.lock?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably

version = "2.10.63"
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath/src/uipath/tracing/_otel_exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def _process_span_attributes(self, span_data: Dict[str, Any]) -> None:
def _build_url(self, span_list: list[Dict[str, Any]]) -> str:
"""Construct the URL for the API request."""
trace_id = str(span_list[0]["TraceId"])
return f"{self.base_url}/api/Traces/spans?traceId={trace_id}&source=Robots"
Copy link
Copy Markdown
Collaborator

@radu-mocanu radu-mocanu May 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure this won t break low code?
we need to double-check that all the spans we emit are dropped in by their runtime

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saksharthakkar / @JosephMar could validate this change from a tracing perspective

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to be changed


source exists both inside the model and on the query path (for convenience)

return f"{self.base_url}/api/Traces/spans?traceId={trace_id}&source=CodedAgents"

def _send_with_retries(
self, url: str, payload: list[Dict[str, Any]], max_retries: int = 4
Expand Down
6 changes: 3 additions & 3 deletions packages/uipath/tests/tracing/test_otel_exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def exporter(mock_env_vars):
exporter = LlmOpsHttpExporter()
# Mock _build_url to include query parameters as in the actual implementation
exporter._build_url = MagicMock( # type: ignore
return_value="https://test.uipath.com/org/tenant/llmopstenant_/api/Traces/spans?traceId=test-trace-id&source=Robots"
return_value="https://test.uipath.com/org/tenant/llmopstenant_/api/Traces/spans?traceId=test-trace-id&source=CodedAgents"
)
yield exporter

Expand Down Expand Up @@ -107,7 +107,7 @@ def test_export_success(exporter, mock_span):
[{"span": "data", "TraceId": "test-trace-id"}]
)
exporter.http_client.post.assert_called_once_with(
"https://test.uipath.com/org/tenant/llmopstenant_/api/Traces/spans?traceId=test-trace-id&source=Robots",
"https://test.uipath.com/org/tenant/llmopstenant_/api/Traces/spans?traceId=test-trace-id&source=CodedAgents",
json=[{"span": "data", "TraceId": "test-trace-id"}],
)

Expand Down Expand Up @@ -685,7 +685,7 @@ def exporter_with_mocks(self, mock_env_vars):
with patch("uipath.tracing._otel_exporters.httpx.Client"):
exporter = LlmOpsHttpExporter()
exporter._build_url = MagicMock( # type: ignore
return_value="https://test.uipath.com/org/tenant/llmopstenant_/api/Traces/spans?traceId=test-trace-id&source=Robots"
return_value="https://test.uipath.com/org/tenant/llmopstenant_/api/Traces/spans?traceId=test-trace-id&source=CodedAgents"
)
yield exporter

Expand Down
2 changes: 1 addition & 1 deletion packages/uipath/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading