Repository navigation
feat(tasks): send the current span as ParentSpanId in taskSourceMetadata [ACTN-11909] - #1948
Conversation
6b8b66c to
ff73d76
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The backward-compatible change reuses existing merge behavior, includes a focused regression test, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Adds optional task_source_metadata support to asynchronous QuickForm creation, enabling Action Center task events to link to the correct trace span.
Changes:
- Passes custom metadata through the existing task-source merge helper; synchronous creation remains unchanged.
- Adds a regression test verifying
ParentSpanIdis included andInstanceIdis preserved. - Bumps
uipath-platformto0.2.42and updates both lockfiles.
| File | Description |
|---|---|
| packages/uipath/uv.lock | Updates the platform package version. |
| packages/uipath-platform/uv.lock | Updates the platform package version. |
| packages/uipath-platform/tests/services/test_actions_service.py | Tests custom metadata merging for async QuickForms. |
| packages/uipath-platform/src/uipath/platform/action_center/_tasks_service.py | Adds and forwards the optional metadata parameter. |
| packages/uipath-platform/pyproject.toml | Bumps the package version to 0.2.42. |
Review effort: Balanced
|
@Sahil-Wakode - once the environments are sstable, let's make sure the CIs are green |
f4e8a78 to
0ef02b5
Compare
yes I have rebased and working on the CIs thankyou |
2449187 to
a31b2c0
Compare
🚨 Heads up:
|
🚨 Heads up:
|
d01142f to
7aa1572
Compare
radu-mocanu
left a comment
There was a problem hiding this comment.
please see https://github.com/UiPath/uipath-python/pull/1948/changes#r4466705036
other than that looks good
…ata [ACTN-11909] _apply_task_source adds ParentSpanId from the current span, so every task the SDK creates carries it. The task_source_metadata parameter on create_quickform_async is no longer needed and is removed.
ParentSpanId is added only for a valid, non-zero span id. Any error while reading the span is logged at debug level and the task is created without ParentSpanId.
…1909] The tasks service now calls _SpanUtils.current_span_id() instead of its own copy of the lookup.
…t_trace_context [ACTN-11909] _inject_trace_context now gets the span from _SpanUtils.current_span(), the same lookup the tasks service uses. The header logic is unchanged.
428a28a to
6e75b72
Compare
|



What
_apply_task_sourcenow addsParentSpanIdtotaskSourceMetadata. It is the span the task is created under, the same one the SDK already sends in thex-uipath-traceparent-idheader (LLMOps current span, falling back to the OTel current span). If there is no current span the key is left out and the task looks the same as today.Why
Action Center places a task's trace spans under
ParentSpanId. Every create path (create,create_async,create_quickform,create_quickform_async, andCreateTask/CreateEscalationinterrupts) goes through_apply_task_source, so all of them get it without callers having to pass anything.Changes
_tasks_service.py: addParentSpanIdfrom the current span in_apply_task_source.test_actions_service.py: test that the current span is sent asParentSpanId.Testing
uipath-platformtests: 1892 passed, 11 skipped. The new test fails without this change.ruff format,ruff checkandmypypass.Demo
For coded agents the spans in trace-view look like:

Development Packages
uipath
uipath-platform