Skip to content

Add custom FailureDetails properties - #253

Open
andystaples wants to merge 6 commits into
mainfrom
andystaples-failure-details-properties
Open

Add custom FailureDetails properties#253
andystaples wants to merge 6 commits into
mainfrom
andystaples-failure-details-properties

Conversation

@andystaples

@andystaples andystaples commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add ExceptionPropertiesProvider and worker configuration for portable exception metadata.
  • Preserve recursive failure details and custom properties across task exceptions, orchestration state, history, and entity failures.
  • Document supported values and the intentional dt: / dto: .NET parity gap; add core and Azure Managed changelog entries.

Validation

  • python -m pytest tests\durabletask\test_failure_details.py tests\durabletask\entities\test_entity_failure_handling.py
  • python -m pytest tests\durabletask-azuremanaged\test_azuremanaged_grpc_resiliency.py
  • python -m flake8 durabletask
  • python -m flake8 tests\durabletask
  • python -m flake8 durabletask-azuremanaged
  • python -m flake8 tests\durabletask-azuremanaged
  • python -m pyright on changed production files
  • python -m pymarkdown -c .pymarkdown.json scan README.md

Resolves #67

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 26daf565-a1f4-4bf0-9540-b57f31a4a12b
Copilot AI lite review requested due to automatic review settings August 10, 2026 16:38
Comment thread durabletask/worker.py Fixed
Comment thread tests/durabletask/entities/test_entity_failure_handling.py Fixed

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.

Pull request overview

This PR extends the Durable Task Python SDK to support portable, custom exception metadata by introducing an ExceptionPropertiesProvider and plumbing its output into FailureDetails so properties (and inner failures) round-trip through task exceptions, orchestration state, history, and entity failures.

Changes:

  • Added ExceptionPropertiesProvider (worker option) and propagated it through worker execution paths to enrich protobuf TaskFailureDetails.
  • Extended the public FailureDetails model (inner failures + properties) and updated parsing in client/history/task failure surfaces.
  • Added tests, README documentation, and changelog entries for core + Azure Managed packages.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/durabletask/test_failure_details.py Adds unit tests validating property serialization, inner-failure preservation, and provider failure behavior.
tests/durabletask/entities/test_entity_failure_handling.py Adds an E2E entity test ensuring exception properties are observable by orchestrators.
tests/durabletask-azuremanaged/test_azuremanaged_grpc_resiliency.py Verifies Azure Managed worker forwards the provider to the base worker.
README.md Documents feature usage, supported value shapes, and .NET dt:/dto: parity gap.
durabletask/worker.py Introduces the provider Protocol and threads it through orchestration/activity/entity failure reporting.
durabletask/task.py Extends FailureDetails and ensures TaskFailedError.details uses the shared protobuf-to-model conversion.
durabletask/internal/helpers.py Implements protobuf<->Python value conversion plus failure-details property extraction.
durabletask/history.py Switches history failure-details parsing to the shared protobuf converter (to include properties/inner failures).
durabletask/client.py Switches orchestration-state failure-details parsing to the shared protobuf converter.
durabletask/init.py Exposes ExceptionPropertiesProvider from the package root.
durabletask-azuremanaged/durabletask/azuremanaged/worker.py Adds exception_properties_provider to DurableTaskSchedulerWorker and forwards it to the base worker.
durabletask-azuremanaged/CHANGELOG.md Adds Unreleased entry documenting the new worker option.
CHANGELOG.md Adds Unreleased entry documenting the new provider and failure-details enrichment.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread durabletask/internal/helpers.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 26daf565-a1f4-4bf0-9540-b57f31a4a12b
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 26daf565-a1f4-4bf0-9540-b57f31a4a12b
Comment thread durabletask/exception_properties.py Dismissed
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 26daf565-a1f4-4bf0-9540-b57f31a4a12b

@berndverst Bernd Verst (berndverst) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Requesting changes because an unhandled failed task drops its original custom properties and inner-failure chain when it fails the parent orchestration. Core history-export state metadata also omits the new fields.

Comment thread durabletask/worker.py Outdated
Comment thread durabletask/task.py
andystaples and others added 2 commits August 13, 2026 10:48
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 26daf565-a1f4-4bf0-9540-b57f31a4a12b

@berndverst Bernd Verst (berndverst) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Second pass at cc0cd89: the two previously reported propagation/export regressions are verified fixed. Requesting changes for the remaining public API-boundary issue; the changelog-format note is non-blocking.

Comment thread durabletask/task.py
return self._details

@property
def failure_details(self) -> pb.TaskFailureDetails:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Public API boundary: This accessor is only needed by _RuntimeOrchestrationContext.set_failed, but its public name and return type expose durabletask.internal.orchestrator_service_pb2.TaskFailureDetails and hand callers the mutable transport object that is later re-emitted. Removing it after release would itself be a compatibility break. Please keep this plumbing private/internal and leave .details as the stable public FailureDetails surface.

Comment thread CHANGELOG.md
ADDED

- Added `ExceptionPropertiesProvider` and the
`exception_properties_provider` worker option to attach portable custom

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Non-blocking: repository changelog policy keeps wrapped entry text unindented. Please align these continuation lines with the existing entry below and make the same adjustment in durabletask-azuremanaged/CHANGELOG.md.

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.

Add support for custom properties in FailureDetails

3 participants