Preserve activity tags across retry attempts - #263
Merged
andystaples merged 1 commit intoSep 4, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Tsuyoshi Ushio (TsuyoshiUshio)
September 4, 2026 02:41
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, includes a targeted regression test, and updates the changelog to reflect the user-visible behavior fix.
Pull request overview
This PR fixes a Durable Task Python SDK bug where ScheduleTaskAction tags (e.g., durabletask.displayName) were lost when an activity was rescheduled due to retries, causing retry attempts to drop caller-provided metadata.
Changes:
- Preserve activity
ScheduleTaskAction.tagswhen reconstructing activity schedule actions after a retry timer fires. - Add a regression test ensuring tags are retained for each retry-generated activity schedule action.
- Document the user-visible bug fix in the root changelog under Unreleased.
File summaries
| File | Description |
|---|---|
| tests/durabletask/test_orchestration_executor.py | Adds a regression test validating that activity tags persist across retry attempts. |
| durabletask/worker.py | Copies tags from the saved original activity schedule action into the reconstructed retry schedule action. |
| CHANGELOG.md | Records the fix under ## Unreleased as a user-visible behavior correction. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
andystaples
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Activity tags are currently dropped when an activity is retried. This causes retry attempts to lose metadata such as
durabletask.displayName, so dashboards fall back to the registered function name even though the initial attempt used the caller-provided display name.Raw orchestration history demonstrates the symptom: the initial
taskScheduledevent containsdurabletask.displayName, while retry-generatedtaskScheduledevents contain an empty tags map.Root cause
When a retry timer fires, the worker reconstructs the activity schedule action from the saved original action but forwards only its name and input. The saved tags are not passed to the reconstructed action.
Fix
Copy the saved Activity tag map into each reconstructed schedule action. This preserves
durabletask.displayNameand all other caller-provided Activity tags without changing sub-orchestration retry behavior.Regression coverage
Added an orchestration executor test that schedules a tagged Activity with a retry policy, fails two attempts, fires both retry timers, and verifies every retry-generated
ScheduleTaskActionretains the original tags.