Skip to content

feat(tasks): send the current span as ParentSpanId in taskSourceMetadata [ACTN-11909] - #1948

Merged
Sahil-Wakode merged 11 commits into
mainfrom
feat/quickform-task-source-metadata
Nov 4, 2026
Merged

Sahil-Wakode merged 11 commits into
mainfrom
feat/quickform-task-source-metadata

Conversation

@Sahil-Wakode

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

Copy link
Copy Markdown
Contributor

What

_apply_task_source now adds ParentSpanId to taskSourceMetadata. It is the span the task is created under, the same one the SDK already sends in the x-uipath-traceparent-id header (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, and CreateTask / CreateEscalation interrupts) goes through _apply_task_source, so all of them get it without callers having to pass anything.

Changes

  • _tasks_service.py: add ParentSpanId from the current span in _apply_task_source.
  • test_actions_service.py: test that the current span is sent as ParentSpanId.
  • uipath-platform bumped to 0.2.42.

Testing

  • uipath-platform tests: 1892 passed, 11 skipped. The new test fails without this change.
  • ruff format, ruff check and mypy pass.

Demo

For coded agents the spans in trace-view look like:
image

Development Packages

uipath

[project]
dependencies = [
  # Exact version (copy-paste ready):
  "uipath==2.15.0.dev1019488014",

  # Any version from this PR (uncomment to use a range instead):
  # "uipath>=2.15.0.dev1019480000,<2.15.0.dev1019490000",
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath = { index = "testpypi" }
uipath-platform = { index = "testpypi" }

[tool.uv]
override-dependencies = ["uipath-platform==0.3.0.dev1019488014"]

uipath-platform

[project]
dependencies = [
  # Exact version (copy-paste ready):
  "uipath-platform==0.3.0.dev1019488014",

  # Any version from this PR (uncomment to use a range instead):
  # "uipath-platform>=0.3.0.dev1019480000,<0.3.0.dev1019490000",
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-platform = { index = "testpypi" }

@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Oct 19, 2026
@Sahil-Wakode Sahil-Wakode changed the title feat(tasks): accept task_source_metadata when creating quick form tasks [ACTN-11909] feat(tasks): [1/2] accept task_source_metadata when creating quick form tasks [ACTN-11909] Oct 19, 2026
@Sahil-Wakode Sahil-Wakode changed the title feat(tasks): [1/2] accept task_source_metadata when creating quick form tasks [ACTN-11909] feat(tasks): [1/2] accept task_source_metadata on every task create method [ACTN-11909] Oct 19, 2026
@Sahil-Wakode Sahil-Wakode changed the title feat(tasks): [1/2] accept task_source_metadata on every task create method [ACTN-11909] feat(tasks): [1/2] accept task_source_metadata in create_quickform_async [ACTN-11909] Oct 22, 2026
@Sahil-Wakode
Sahil-Wakode force-pushed the feat/quickform-task-source-metadata branch from 6b8b66c to ff73d76 Compare October 22, 2026 09:41
@Sahil-Wakode
Sahil-Wakode marked this pull request as ready for review October 23, 2026 09:17
Copilot AI balanced review requested due to automatic review settings October 23, 2026 09:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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 ParentSpanId is included and InstanceId is preserved.
  • Bumps uipath-platform to 0.2.42 and 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 Sahil-Wakode changed the title feat(tasks): [1/2] accept task_source_metadata in create_quickform_async [ACTN-11909] feat(tasks): [1/2] let quick form tasks send extra task source metadata [ACTN-11909] Oct 23, 2026
@Sahil-Wakode Sahil-Wakode changed the title feat(tasks): [1/2] let quick form tasks send extra task source metadata [ACTN-11909] feat(tasks): send the current span as ParentSpanId in taskSourceMetadata [ACTN-11909] Oct 26, 2026
@dushyant-uipath

Copy link
Copy Markdown
Contributor

@Sahil-Wakode - once the environments are sstable, let's make sure the CIs are green

@Sahil-Wakode
Sahil-Wakode force-pushed the feat/quickform-task-source-metadata branch from f4e8a78 to 0ef02b5 Compare October 26, 2026 15:20
@Sahil-Wakode

Copy link
Copy Markdown
Contributor Author

@Sahil-Wakode - once the environments are sstable, let's make sure the CIs are green

yes I have rebased and working on the CIs thankyou

@Sahil-Wakode Sahil-Wakode added the build:dev Create a dev build from the pr label Oct 30, 2026
@Sahil-Wakode
Sahil-Wakode force-pushed the feat/quickform-task-source-metadata branch from 2449187 to a31b2c0 Compare November 3, 2026 09:42
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🚨 Heads up: uipath-integrations cross-tests are FAILING 🚨

Your changes may break one or more integrations in uipath-integrations-python:

  • uipath-openai-agents
  • uipath-google-adk
  • uipath-agent-framework
  • uipath-llamaindex
  • uipath-pydantic-ai

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@Sahil-Wakode
Sahil-Wakode force-pushed the feat/quickform-task-source-metadata branch from d01142f to 7aa1572 Compare November 4, 2026 09:16
Comment thread packages/uipath/uv.lock Resolved

@radu-mocanu radu-mocanu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

…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.
@Sahil-Wakode
Sahil-Wakode force-pushed the feat/quickform-task-source-metadata branch from 428a28a to 6e75b72 Compare November 4, 2026 12:22
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@Sahil-Wakode
Sahil-Wakode merged commit c6ec3fd into main Nov 4, 2026
187 checks passed
@Sahil-Wakode
Sahil-Wakode deleted the feat/quickform-task-source-metadata branch November 4, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:dev Create a dev build from the pr test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants