Skip to content

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

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

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

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

Why

Action Center shows task events (created, assigned, completed) in the trace. Without a parent span they show at the top of the trace instead of under the "Escalation" step. The span id is already in the tool's _span_context as parent_span_id, set by the tool instrumentor. This PR 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 and create_async. If there is no span id, nothing extra is sent.
  • test_escalation_tool.py: tests for app tasks, quick form tasks, and the no-span-id case.

Testing

  • test_escalation_tool.py: 43/43 pass. The new tests fail without this change.
  • ruff and mypy pass.
  • Ran the real tool instrumentor, this tool and the SDK together: the ParentSpanId sent matched the exported "Escalation" span id, for app and quick form tasks.

Before merging

Needs uipath-platform 0.2.42 (#1948) on PyPI. Then: require uipath-platform>=0.2.42, bump this package's version, and update uv.lock. Without it, quick form escalations would fail, because older versions of create_quickform_async don't accept task_source_metadata.

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
@Sahil-Wakode
Sahil-Wakode force-pushed the feat/escalation-task-parent-span-id branch from 115462e to 7169a59 Compare October 23, 2026 10:17
@sonarqubecloud

Copy link
Copy Markdown

@Sahil-Wakode
Sahil-Wakode marked this pull request as ready for review October 23, 2026 10:30
Copilot AI balanced review requested due to automatic review settings October 23, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The dependency requirement and lockfile still allow an SDK version that rejects the new quick-form keyword and prevents task creation.

1 open issue
What changed in this PR

This PR links Action Center task events to the agent’s Escalation trace span by forwarding its ID as ParentSpanId.

Changes:

  • Pass optional task-source metadata through app and quick-form task creation.
  • Populate metadata from the escalation span context.
  • Add tests for span propagation and app-task behavior without a span ID.
File Description
tests/​agent/​tools/​test_escalation_tool.py Tests span metadata for app and quick-form tasks, plus the no-span case.
src/​uipath_langchain/​agent/​tools/​escalation_tool.py Forwards escalation span metadata to Action Center task creation.

Review effort: Balanced

labels=channel.labels,
is_actionable_message_enabled=channel.properties.is_actionable_message_enabled,
actionable_message_metadata=channel.properties.actionable_message_meta_data,
task_source_metadata=task_source_metadata,

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.

2 participants