Skip to content

Conversation

@saksharthakkar
Copy link
Contributor

@saksharthakkar saksharthakkar commented Jan 14, 2026

Summary

  • Add execution_type and agent_version fields to UiPathSpan dataclass
  • Update to_dict() to return ExecutionType and AgentVersion as top-level keys
  • Extract executionType and agentVersion from OTEL span attributes in otel_span_to_uipath_span()

Problem

Backend (LlmOps) expects ExecutionType and AgentVersion as top-level span properties, but Python SDK was sending them inside the Attributes JSON blob.

Before (broken)

{
  "Name": "Agent run - Agent",
  "ExecutionType": null,
  "AgentVersion": null,
  "Attributes": "{\"executionType\": 0, \"agentVersion\": \"1.0.0\", ...}"
}

After (fixed)

{
  "Name": "Agent run - Agent",
  "ExecutionType": 0,
  "AgentVersion": "1.0.0",
  "Attributes": "{...}"
}

Data Flow

Orchestrator → hdens → uipath-agents-python → uipath-python → LLMOps
                ↓              ↓                    ↓
         UIPATH_IS_DEBUG   executionType      ExecutionType (top-level)
      UIPATH_PROCESS_VERSION agentVersion     AgentVersion (top-level)
Component Responsibility
Orchestrator Sets JobFlags.IsStudioDebugContext
hdens Propagates as UIPATH_IS_DEBUG and UIPATH_PROCESS_VERSION env vars
uipath-agents-python Reads env vars, sets executionType/agentVersion in span attributes
uipath-python (this PR) Extracts from attributes → top-level UiPathSpan fields
LLMOps Receives top-level ExecutionType and AgentVersion for filtering

Related PRs

LLMOps Compatibility

Backend expects these as top-level properties on the Span model:

Test plan

  • Unit tests for execution_type extraction
  • Unit tests for agent_version extraction
  • Unit tests for both fields together
  • Unit tests for missing fields (defaults to None)
  • Integration test with env vars set

🤖 Generated with Claude Code

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Jan 14, 2026
@saksharthakkar saksharthakkar changed the title (wip) feat: add ExecutionType and AgentVersion as top-level span properties feat: add ExecutionType and AgentVersion as top-level span properties Jan 14, 2026
@saksharthakkar saksharthakkar marked this pull request as ready for review January 14, 2026 00:54
Copy link
Member

@JosephMar JosephMar left a comment

Choose a reason for hiding this comment

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

LGTM

@saksharthakkar saksharthakkar force-pushed the feat/add-execution-type branch 3 times, most recently from 5bd72e6 to 9bb150b Compare January 14, 2026 19:36
Extract executionType and agentVersion from OTEL span attributes
and expose them as top-level fields on UiPathSpan for LlmOps
compatibility.

- Add execution_type and agent_version fields to UiPathSpan dataclass
- Update to_dict() to return ExecutionType and AgentVersion keys
- Extract values in otel_span_to_uipath_span()
- Bump version to 2.4.21

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: JosephMar <[email protected]>
@saksharthakkar saksharthakkar force-pushed the feat/add-execution-type branch from 9bb150b to bed7f63 Compare January 14, 2026 19:38
@saksharthakkar saksharthakkar merged commit 13adc91 into main Jan 14, 2026
86 checks passed
@saksharthakkar saksharthakkar deleted the feat/add-execution-type branch January 14, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants