fix: remove duplicate span creation and fix trace ID assignment #1189
+7
−326
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR removes duplicate span creation code and fixes trace ID assignment to properly sync with how uipath-python creates spans.
Changes
🗑️ Removed Dead/Duplicate Code (319 lines)
Removed 3 methods from
_progress_reporter.py:_send_parent_trace()- Created duplicate evaluation set spans_send_eval_run_trace()- Dead code (defined but never called)_send_evaluator_traces()- Created duplicate evaluator spans AND duplicate agent span exports🔧 Fixed Trace ID Assignment
eval_set_run_idtrace ID override that forced ALL evaluations to use the same trace IDhandle_update_eval_run():🧹 Cleanup
datetime,timezone,SpanContext,SpanKind,TraceFlagsWhy These Changes?
Problem 1: Duplicate Span Creation
The deleted methods were creating spans that duplicated what
_runtime.pyalready creates:_runtime.pycreates "Evaluation Set Run", "Evaluation", and "Evaluator" spans with proper hierarchy_progress_reporter.pywas creating the same spans again via the 3 deleted methodshandle_update_eval_run)Problem 2: Incorrect Trace IDs
eval_set_run_idas their trace ID_runtime.pycreates spans withexecution.id = eval_item.idfor each evaluationImpact
✅ What Still Works
handle_update_eval_run)_runtime.py(unchanged)🎯 What's Fixed
eval_item.idTesting
Related Changes
This PR complements changes in the Agents repo (
AgentHealthScorerUtils.cs) that update trace retrieval to query by individual evaluation IDs instead of eval set run ID.🤖 Generated with Claude Code
Development Package
uipath pack --nolockto get the latest dev build from this PR (requires version range).Screenshots
Before

After