René's URL Explorer Experiment


Title: [Async stack 4/6] Add cold async orchestration context by andystaples · Pull Request #361 · microsoft/durabletask-python · GitHub

Open Graph Title: [Async stack 4/6] Add cold async orchestration context by andystaples · Pull Request #361 · microsoft/durabletask-python

X Title: [Async stack 4/6] Add cold async orchestration context by andystaples · Pull Request #361 · microsoft/durabletask-python

Description: WarningThis PR is part of a review-only stack and must not be merged individually. The whole stack will be squash-merged after every PR is approved. Layer 4/6. Async orchestrators receive a cold, await-only AsyncOrchestrationContext. Durable operations return native, single-use coroutines: validation, serialization, scheduling, and relative deadline evaluation occur when execution starts, not when the coroutine is constructed. Inputs are not copied. Timers and event receives own their local registrations and withdraw them when the waiter exits; cancelling remote-work waiters does not cancel the underlying work. An operation can be created before other awaits and awaited later, even in a later dispatch; it is scheduled at its first await. The context weakly tracks the operation coroutines it creates, and dispatch teardown closes any that never started. That schedules nothing, leaves the response unchanged, and avoids a never-awaited RuntimeWarning. Operations that have already started are left to the normal loop teardown. as_task_context() is the explicit escape hatch to eager scheduling and reusable durable task handles, including independent borrowed waiters through Task.wait(), task.when_any winner identification, and completion checks. The synchronous OrchestrationContext and generator orchestration behavior remain unchanged. Async sub-orchestration calls without return_type are typed as Any. Tests Adds tests/durabletask/test_async_context.py, covering context selection for supported async callable shapes, replay/action parity, cancellation ownership, timeout ordering, operations awaited in a later dispatch without never-awaited warnings, public result-type inference, and the race-winner, completion-check, and result idioms. Adds a public API parity test that compares AsyncOrchestrationContext with OrchestrationContext against an explicit allowlist of intentional differences (as_task_context, async-only timeout, and which members are coroutines), plus a metadata parity test for instance_id, parent_instance_id, version, current_utc_datetime, and is_replaying. Moves the existing coroutine and asyncio tests from layers 1-3 to task.AsyncOrchestrationContext, using ctx.as_task_context() where they need eager handles. Adds tests/durabletask/typing/async_context.py for static typing checks. Docs and CI docs/async-orchestrators.md documents sub-orchestration result typing, un-awaited operations, operations created before other awaits (with asyncio.create_task to start one immediately), and an example of the winner, completion-check, and result idioms. Extends the async-runtime-windows CI job from #360 to run test_async_context.py. Builds on #360. Functions integration (#363) and final documentation and release notes (#364) follow. The stack splits the closed #293.

Open Graph Description: WarningThis PR is part of a review-only stack and must not be merged individually. The whole stack will be squash-merged after every PR is approved. Layer 4/6. Async orchestrators receive a cold, ...

X Description: WarningThis PR is part of a review-only stack and must not be merged individually. The whole stack will be squash-merged after every PR is approved. Layer 4/6. Async orchestrators receive a cold, ...

Opengraph URL: https://github.com/microsoft/durabletask-python/pull/361

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e4f7d6b2-8016-2cc1-66ff-49eb50e52ed1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA548:2F8567:D00412:1226B6B:6AFE2F0D
html-safe-noncec16a67635ee1d2ac35ddb8fa701da1fb6b5ad5c9bfc58838280938213bd8c96f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTQ4OjJGODU2NzpEMDA0MTI6MTIyNkI2Qjo2QUZFMkYwRCIsInZpc2l0b3JfaWQiOiI4ODU0NDc3Njg4NDM4NDAyODI5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd5648932b91ec87feccd6439025a9f3b6c5cfe923a08f12d01546d0e5ec6a2bd
hovercard-subject-tagpull_request:5266147251
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/microsoft/durabletask-python/pull/361/files
twitter:imagehttps://avatars.githubusercontent.com/u/77818326?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/77818326?s=400&v=4
og:image:altWarningThis PR is part of a review-only stack and must not be merged individually. The whole stack will be squash-merged after every PR is approved. Layer 4/6. Async orchestrators receive a cold, ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned70e31220a67f6376c108d2416fa8e7df854c1065b1672ab7a88ab6dc3a809e2
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/microsoft/durabletask-python git https://github.com/microsoft/durabletask-python.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id627664515
octolytics-dimension-repository_nwomicrosoft/durabletask-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id627664515
octolytics-dimension-repository_network_root_nwomicrosoft/durabletask-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseccb88d9c92abe69245b429398c8a57ae87070c7c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/microsoft/durabletask-python/pull/361/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fdurabletask-python%2Fpull%2F361%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fdurabletask-python%2Fpull%2F361%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=microsoft%2Fdurabletask-python
Reloadhttps://github.com/microsoft/durabletask-python/pull/361/files
Reloadhttps://github.com/microsoft/durabletask-python/pull/361/files
Reloadhttps://github.com/microsoft/durabletask-python/pull/361/files
microsofthttps://github.com/microsoft
durabletask-pythonhttps://github.com/microsoft/durabletask-python
Codehttps://github.com/microsoft/durabletask-python
Issues15 (15)https://github.com/microsoft/durabletask-python/issues
Pull requests12 (12)https://github.com/microsoft/durabletask-python/pulls
Actionshttps://github.com/microsoft/durabletask-python/actions
Projectshttps://github.com/microsoft/durabletask-python/projects
Security and qualityhttps://github.com/microsoft/durabletask-python/security
Insightshttps://github.com/microsoft/durabletask-python/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fmicrosoft%2Fdurabletask-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmicrosoft%2Fdurabletask-python%2Fissues%2Fnew%2Fchoose
andystapleshttps://github.com/andystaples
andystaples-async-stack-3-dispatch-cleanuphttps://github.com/microsoft/durabletask-python/tree/andystaples-async-stack-3-dispatch-cleanup
andystaples-async-stack-4-async-contexthttps://github.com/microsoft/durabletask-python/tree/andystaples-async-stack-4-async-context
Conversation 22 https://github.com/microsoft/durabletask-python/pull/361
Commits 14 https://github.com/microsoft/durabletask-python/pull/361/commits
Checks 30 https://github.com/microsoft/durabletask-python/pull/361/checks
Files changed https://github.com/microsoft/durabletask-python/pull/361/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/361/files
[Async stack 4/6] Add cold async orchestration context https://github.com/microsoft/durabletask-python/pull/361/files#top
Show all changes 14 commits https://github.com/microsoft/durabletask-python/pull/361/files
a2139cd Add cold async orchestration context andystaples Nov 11, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/a2139cd5da752b6d69ddc3b295c8687251fbcbfb
bf3cf4b Adapt replay regressions to cold async context andystaples Nov 12, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/bf3cf4bf7deef238da399d398eb385664f7b6982
8b769da Correct async sub-orchestration result typing andystaples Nov 12, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/8b769dadbe617fac6b0b70d5b9b2eaecfdae3d28
f8347b8 Check cold-context routing in wrapped orchestrator regressions andystaples Nov 12, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/f8347b8759b865a7dd3f08eecad2991d5d801526
5a77c20 Merge andystaples-async-stack-3-dispatch-cleanup into andystaples-asy… andystaples Nov 12, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/5a77c20411b312fa1de9336a4a50bdccd58c458d
704b30b Merge andystaples-async-stack-3-dispatch-cleanup into andystaples-asy… andystaples Nov 12, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/704b30bee2b1c5bb30d18deed59588c0bc42617a
95e411c Merge andystaples-async-stack-3-dispatch-cleanup into andystaples-asy… andystaples Nov 12, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/95e411ce52790ae1bc620c31dcc715b71f9ddc8d
c01686b Merge andystaples-async-stack-3-dispatch-cleanup into andystaples-asy… andystaples Nov 12, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/c01686b7107fd574149380fee1ebba50a3c4a6fc
3a684c6 Add async context parity checks and reject non-finite timer delays andystaples Nov 12, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/3a684c6e4951d59ea6a182e27af394f1f58d4263
6ad2922 Merge andystaples-async-stack-3-dispatch-cleanup into andystaples-asy… andystaples Nov 16, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/6ad2922dc11410e6ba5557c416ff807ac9bbc73d
5e5f061 Merge andystaples-async-stack-3-dispatch-cleanup into andystaples-asy… andystaples Nov 16, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/5e5f0618291dafd0af00d17d454c9003c5e32907
0c04d3e Merge andystaples-async-stack-3-dispatch-cleanup into andystaples-asy… andystaples Nov 16, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/0c04d3ea611e65210864d74e1c527f4316b2427c
5bea017 Merge andystaples-async-stack-3-dispatch-cleanup into andystaples-asy… andystaples Nov 16, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/5bea017e122324e1c1107ae189c0c01d232ff0d6
9b79875 Close unstarted cold operations at dispatch teardown andystaples Nov 16, 2026 https://github.com/microsoft/durabletask-python/pull/361/commits/9b79875a9b1e761480eebb83043d2f21be1c60c9
Clear filters https://github.com/microsoft/durabletask-python/pull/361/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/361/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/361/files
durabletask.yml https://github.com/microsoft/durabletask-python/pull/361/files#diff-67f446127cd48d3d60af952eaf0e91c7626d3de562e98a55864e17b9a6575162
async-orchestrators.md https://github.com/microsoft/durabletask-python/pull/361/files#diff-4041f5af72d58e9641665b5b94354c8039eedd8ff6b1d3356ae76eecd8a22fcc
async_context.py https://github.com/microsoft/durabletask-python/pull/361/files#diff-180f15dec60a0bc699425fa1119b76127887b8f1f12ca5aebf0ecc69d22d0ce6
task.py https://github.com/microsoft/durabletask-python/pull/361/files#diff-36492640add0941ee3934088b514e433cd929fa6120e74f93e37e5484bfe7981
worker.py https://github.com/microsoft/durabletask-python/pull/361/files#diff-821cca3b6d2d4c27b83bc2ea2c1dfbce058c46419967498ae26dc12693418899
test_async_context.py https://github.com/microsoft/durabletask-python/pull/361/files#diff-dedd703a67d1fb580e1d15e2137a63586a999cb77c9f518eba6084966b63c86e
test_asyncio_orchestrators.py https://github.com/microsoft/durabletask-python/pull/361/files#diff-3f4f24b2fcba2e5d488f7876e8ad325f8de6a46896d88007d62be7f4bf3c9484
test_coroutine_orchestrators.py https://github.com/microsoft/durabletask-python/pull/361/files#diff-b0f87c14cdff5ff60109ff89e27ae6fcf0a30c4b0e555249eb6fcb88435abb3c
async_context.py https://github.com/microsoft/durabletask-python/pull/361/files#diff-f260f65d88276e716ecea0d63556f84f9c2788ca147fcd62ff5191791c34fdd0
.github/workflows/durabletask.ymlhttps://github.com/microsoft/durabletask-python/pull/361/files#diff-67f446127cd48d3d60af952eaf0e91c7626d3de562e98a55864e17b9a6575162
View file https://github.com/microsoft/durabletask-python/blob/9b79875a9b1e761480eebb83043d2f21be1c60c9/.github/workflows/durabletask.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/microsoft/durabletask-python/pull/361/{{ revealButtonHref }}
https://github.com/microsoft/durabletask-python/pull/361/files#diff-67f446127cd48d3d60af952eaf0e91c7626d3de562e98a55864e17b9a6575162
https://github.com/microsoft/durabletask-python/pull/361/files#diff-67f446127cd48d3d60af952eaf0e91c7626d3de562e98a55864e17b9a6575162
docs/async-orchestrators.mdhttps://github.com/microsoft/durabletask-python/pull/361/files#diff-4041f5af72d58e9641665b5b94354c8039eedd8ff6b1d3356ae76eecd8a22fcc
View file https://github.com/microsoft/durabletask-python/blob/9b79875a9b1e761480eebb83043d2f21be1c60c9/docs/async-orchestrators.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/microsoft/durabletask-python/pull/361/{{ revealButtonHref }}
https://github.com/microsoft/durabletask-python/pull/361/files#diff-4041f5af72d58e9641665b5b94354c8039eedd8ff6b1d3356ae76eecd8a22fcc
https://github.com/microsoft/durabletask-python/pull/361/files#diff-4041f5af72d58e9641665b5b94354c8039eedd8ff6b1d3356ae76eecd8a22fcc
https://github.com/microsoft/durabletask-python/pull/361/files#diff-4041f5af72d58e9641665b5b94354c8039eedd8ff6b1d3356ae76eecd8a22fcc
https://github.com/microsoft/durabletask-python/pull/361/files#diff-4041f5af72d58e9641665b5b94354c8039eedd8ff6b1d3356ae76eecd8a22fcc
https://github.com/microsoft/durabletask-python/pull/361/files#diff-4041f5af72d58e9641665b5b94354c8039eedd8ff6b1d3356ae76eecd8a22fcc
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/361/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/361/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.