Skip to content

Conversation

@saksharthakkar
Copy link
Contributor

@saksharthakkar saksharthakkar commented Jan 31, 2026

Motivation

Span upserts were failing with 400 Bad Request due to model mismatch:

Error converting value "runtime" to type 'UiPath.LLMOps.DataAccess.Models.SourceEnum'. Path '[0].Source'

The backend expects Source as an integer (SourceEnum), but Python SDK was passing the string "runtime" from attributes.

Summary

  • Set source field in UiPathSpan to fixed value 4 (SourceEnum.Robots) instead of reading from attributes
  • Why 4? Python SDK traces originate from Robot execution, matching existing source=Robots URL param in LLM export
  • Hardcoded here
  • Removed extraction of source from attributes_dict in otel_span_to_uipath_span
  • Top-level Source now always equals 4 for backend; Attributes.source string ("runtime"/"playground") passes through in JSON

Related Models

Test plan

  • Verify spans have Source: 4 in exported traces
  • Confirm attributes.source string values still appear in JSON payload

🤖 Generated with Claude Code

…om attributes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@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 31, 2026
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@saksharthakkar saksharthakkar marked this pull request as ready for review January 31, 2026 01:03
@saksharthakkar saksharthakkar changed the title (wip) fix: use fixed source=4 (Robots) for UiPathSpan fix: Change top level Source to Int to match LLMOps Span Model Jan 31, 2026
default_factory=lambda: env.get("UIPATH_FOLDER_KEY", "")
)
source: Optional[int] = None
source: int = 4 # SourceEnum.Robots for Python SDK
Copy link
Member

Choose a reason for hiding this comment

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

it should only be 4 for coded agents - low code agents should be 1

Copy link
Member

Choose a reason for hiding this comment

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

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.

2 participants