Durable Pydantic AI agents with Azure Durable Task
Durable Pydantic AI agents with Azure Durable Task
Pydantic AI Harness now includes AzureDurableTaskDurability, a capability that runs the agent loop on Microsoft's Durable Task engine (the one behind Azure Durable Functions), recording each model request, tool call, MCP call, and durable operation as an activity so a replacement worker can replay history and resume after a crash. The post walks through a support-agent example against the Docker emulator, shows a worker killed mid-refund resuming without repeating completed activities, and covers replay rules (idempotent tools, deterministic orchestrator code, persisted names), human approvals via external events, per-role retry policies, and deployment to Azure Durable Task Scheduler.
It gives a concrete, tested account of what durable execution does and does not guarantee for agents, including the at-least-once tool execution and replay costs that are easy to overlook.
Source: Pydantic AI Articles · pydantic.dev