Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d054b0e
feat(durabletask): host MAF workflows on a standalone Durable Task wo…
ahmedmuhsin Jun 9, 2026
6c5d838
refactor(azurefunctions): delegate workflow execution to agent-framew…
ahmedmuhsin Jun 9, 2026
389bf8a
feat(core): expose durabletask workflow symbols via agent_framework.a…
ahmedmuhsin Jun 9, 2026
8b1f513
docs(samples): add standalone durabletask workflow and HITL samples
ahmedmuhsin Jun 9, 2026
594a80b
fix: address PR review feedback
ahmedmuhsin Jun 9, 2026
30667cb
fix: resolve pyright Package Checks errors
ahmedmuhsin Jun 9, 2026
0134a2d
fix(durabletask): agent-executor identity and typed workflow input
ahmedmuhsin Jun 10, 2026
59dc371
fix(samples): type durable workflow start executors for reconstructed…
ahmedmuhsin Jun 10, 2026
f95019b
test(durabletask): unit coverage for registration, client, worker, an…
ahmedmuhsin Jun 10, 2026
28989b0
test(durabletask): HITL and parallel durable workflow integration tests
ahmedmuhsin Jun 10, 2026
789d5af
refactor(durabletask): group workflow modules into a _workflows subpa…
ahmedmuhsin Jun 10, 2026
5aedc91
fix(durabletask): harden workflow type resolution and HITL response h…
ahmedmuhsin Jun 10, 2026
e773d2a
fix(durabletask): treat async edge conditions as not-matched on the s…
ahmedmuhsin Jun 10, 2026
6680091
fix(durabletask): reconstruct typed workflow outputs at the host boun…
ahmedmuhsin Jun 10, 2026
68ef123
fix(durabletask): address review findings on workflow hosting
ahmedmuhsin Jun 10, 2026
8c760ec
fix(durabletask): wait indefinitely for HITL responses, matching core
ahmedmuhsin Jun 15, 2026
ea321b8
feat(durabletask): typed workflow event streaming and async client API
ahmedmuhsin Jun 16, 2026
71ad318
docs(samples): standalone durabletask workflow streaming sample
ahmedmuhsin Jun 16, 2026
b0d6ec6
refactor(durabletask): internal-only checkpoint codec and host-scoped…
ahmedmuhsin Jun 19, 2026
245a0fb
fix(azurefunctions): scope workflow status/respond endpoints to the w…
ahmedmuhsin Jun 19, 2026
5dbb0b4
fix(durabletask): resolve CI typing failures
ahmedmuhsin Jun 19, 2026
e4badc3
Merge branch 'main' into feature/python-durabletask-standalone-workflows
gavin-aguiar Jun 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 120 additions & 166 deletions python/packages/azurefunctions/agent_framework_azurefunctions/_app.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from __future__ import annotations

import asyncio
import logging
from collections.abc import Callable
from typing import Any, cast
Expand All @@ -20,6 +19,7 @@
AgentEntity,
AgentEntityStateProviderMixin,
AgentResponseCallbackProtocol,
run_agent_coroutine,
)

logger = logging.getLogger("agent_framework.azurefunctions")
Expand Down Expand Up @@ -101,23 +101,16 @@ async def _entity_coroutine(context: df.DurableEntityContext) -> None:
context.set_result({"error": str(exc), "status": "error"})

def entity_function(context: df.DurableEntityContext) -> None:
"""Synchronous wrapper invoked by the Durable Functions runtime."""
"""Synchronous wrapper invoked by the Durable Functions runtime.

All agent coroutines run on a single process-wide persistent event loop
(see ``run_agent_coroutine``). This keeps async resources created by
shared agent clients/credentials bound to a live loop across every
invocation, preventing cross-loop hangs when the host dispatches
successive entity operations onto different worker threads.
"""
try:
try:
loop = asyncio.get_event_loop()
except RuntimeError:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

if loop.is_running():
temp_loop = asyncio.new_event_loop()
try:
temp_loop.run_until_complete(_entity_coroutine(context))
finally:
temp_loop.close()
else:
loop.run_until_complete(_entity_coroutine(context))

run_agent_coroutine(_entity_coroutine(context))
except Exception as exc: # pragma: no cover - defensive logging
logger.error("[entity_function] Unexpected error executing entity: %s", exc, exc_info=True)
context.set_result({"error": str(exc), "status": "error"})
Expand Down

This file was deleted.

Loading
Loading