Skip to content

chore: migrate to Durable Functions Python 2.x - #189

Merged
Tsuyoshi Ushio (TsuyoshiUshio) merged 9 commits into
mainfrom
tsuyoshiushio-durable-v2-migration
Sep 2, 2026
Merged

chore: migrate to Durable Functions Python 2.x#189
Tsuyoshi Ushio (TsuyoshiUshio) merged 9 commits into
mainfrom
tsuyoshiushio-durable-v2-migration

Conversation

@TsuyoshiUshio

@TsuyoshiUshio Tsuyoshi Ushio (TsuyoshiUshio) commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • upgrade azure-functions-durable from 1.x to 2.0.0b2
  • adapt Durable client typing and lifetime management, including an owned client for SSE streams
  • preserve workflow failure/cancellation behavior under the 2.x task implementation
  • make E2E apps load dependencies through the Functions customer dependency path

This is the migration-only prerequisite split requested for #185. It intentionally contains no Activity retry schema, policy, sample, or documentation.

Why the compatibility changes are included

Durable 2.x injects an asynchronous DurableFunctionsClient into async functions and closes invocation-scoped clients when the function returns. Streaming responses therefore need to own a client through stream consumption. Durable 2.x also changes failed Task.result behavior, and nested composite tasks do not propagate completion to their parent, so workflow waves now select over leaf tasks and fail immediately on the first task error.

Validation

  • python -m ruff check src tests
  • python -m mypy src
  • uv lock --check
  • python -m pytest --cache-clear --cov=./src/azure_functions_agents --cov-report=xml --cov-branch tests — 1104 passed locally
  • local Functions host startup passed for both the non-workflow samples/basic-chat sample and the Dynamic Workflow samples/workflow-incident-triage sample using the E2E customer dependency layout
  • official public-build unit tests passed on Python 3.13 and 3.14
  • official E2E tests passed on Python 3.13 and 3.14, including the repository-configured live-model sample coverage

Follow-up

After this merges, #185 will rebase onto main and remove its migration-only commits, leaving the Durable native Activity retry feature as the focused follow-up.

Tsuyoshi Ushio and others added 5 commits September 1, 2026 07:06
Durable native Activity retry needs the Python 2.x RetryPolicy (backoff
coefficient, maximum interval, and retry timeout); the 1.x RetryOptions can
only express a constant first interval and an attempt count.

Carry only the collateral the bump requires: the DurableFunctionsClient
binding type, Task.result now raising instead of returning its failure, the
2.x trigger decorator typing, and a Durable client whose lifetime spans SSE
stream consumption instead of the invocation that created it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Durable Functions Python 2.x pulls in durabletask, which depends on grpcio.
The Python worker bundles its own grpcio, and with no customer dependency
path the worker resolved a mixed grpcio/protobuf set and segfaulted (exit 139)
while importing function_app.py — so every E2E app failed to start, including
ones that never touch workflows.

Install the runtime once into a shared tree, link it in as .python_packages
for every app with a host.json, and put that path ahead of the worker's own
packages. This is what a deployed app already looks like.

The extension bundle is unchanged: the host's LATEST channel already selects
4.37.1 for the existing [4.*, 5.0.0) and [4.32.0, 5.0.0) ranges.

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

Copilot-Session: 6638e540-8004-4e8e-82ae-b11f8bdb00b8
The docs workflow syncs with --locked, so the pin change has to be reflected
in uv.lock. Resolution adds durabletask and its grpcio/protobuf/asyncio
dependencies, drops furl and orderedmultidict, and moves azure-functions from
2.1.0 to 2.3.0 because azure-functions-durable 2.0.0b2 requires >=2.3.0b2.

Artifact URLs for packages that did not change are kept as committed: the
Microsoft feed proxy hands out a different mirror host on every resolution,
which would otherwise rewrite every URL in the file for no change in content.

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

Copilot-Session: 6638e540-8004-4e8e-82ae-b11f8bdb00b8
Comment thread eng/templates/official/jobs/e2e-tests.yml Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6638e540-8004-4e8e-82ae-b11f8bdb00b8
Comment thread eng/templates/official/jobs/e2e-tests.yml Outdated
Comment thread eng/templates/official/jobs/e2e-tests.yml Outdated
Comment thread src/azure_functions_agents/registration/endpoints.py Outdated
Comment thread src/azure_functions_agents/workflows/engine.py Outdated
Comment thread src/azure_functions_agents/workflows/engine.py Outdated
Comment thread src/azure_functions_agents/workflows/engine.py Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6638e540-8004-4e8e-82ae-b11f8bdb00b8
Comment thread src/azure_functions_agents/registration/endpoints.py Outdated
Comment thread tests/test_install_e2e_dependencies.py Outdated
Tsuyoshi Ushio added 2 commits September 1, 2026 20:45
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6638e540-8004-4e8e-82ae-b11f8bdb00b8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6638e540-8004-4e8e-82ae-b11f8bdb00b8
@TsuyoshiUshio
Tsuyoshi Ushio (TsuyoshiUshio) merged commit 769f481 into main Sep 2, 2026
16 checks passed
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.

3 participants