Skip to content

feat(escalation): [2/2] send the escalation span id with the Action Center task [ACTN-11909] - #1164

Draft
Sahil-Wakode wants to merge 1 commit into
mainfrom
feat/escalation-task-parent-span-id
Draft

Sahil-Wakode wants to merge 1 commit into
mainfrom
feat/escalation-task-parent-span-id

Conversation

@Sahil-Wakode

@Sahil-Wakode Sahil-Wakode commented Oct 19, 2026 •

Copy link
Copy Markdown

What this PR does

When the escalation tool creates an Action Center task, it now sends the id of the "Escalation" span with the task, as ParentSpanId. Part 2 of 2, after UiPath/uipath-python#1948.

Why

Action Center now writes task events (created, assigned, completed) to the trace. Today, for agent escalations, those events show up at the top of the trace, not under the "Escalation" step that created the task. That's because the task only carries the trace id, not the span it belongs to.

The id is already available. When the escalation tool starts, the tool instrumentor (uipath-agents-python) creates the "Escalation" span and writes its id into the tool's _span_context as parent_span_id. This PR reads it and sends it with the task. Action Center reads it in UiPath/business-apps-tasks#3734.

Changes

  • escalation_tool.py:
    • create_task_for_channel takes task_source_metadata and passes it to both create_quickform_async (quick form channel) and create_async (app channel).
    • The escalation tool sends {"ParentSpanId": <escalation span id>}. If there is no span id, it sends nothing extra, and the task is created as before.
  • test_escalation_tool.py: tests that app tasks and quick form tasks get the span id, and that nothing extra is sent when there is no span id.

Testing

  • All 43 tests in test_escalation_tool.py pass. The new checks fail without this change.
  • ruff and mypy pass.
  • Ran the real tool instrumentor, this escalation tool and the uipath-python SDK together: the ParentSpanId sent to Action Center matched the exported "Escalation" span id, for both app and quick form tasks.

Before merging

After uipath-platform 0.2.42 (#1948) is on PyPI: require uipath-platform>=0.2.42, bump this package's version, and update uv.lock. Quick form tasks need that release.

Ticket: https://uipath.atlassian.net/browse/ACTN-11909

@Sahil-Wakode
Sahil-Wakode force-pushed the feat/escalation-task-parent-span-id branch from cfa758a to 115462e Compare October 22, 2026 10:36
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube Cloud

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant