iCreatAI News
Skip to content
Pydantic AI Articles· Laís Carvalho·· 12 hr agoFeaturedAI score60

Durable Pydantic AI agents with Azure Durable Task

Durable Pydantic AI agents with Azure Durable Task

AI summary

Pydantic AI Harness now includes AzureDurableTaskDurability, a capability that runs the agent loop on Microsoft's Durable Task engine, 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 on the local DTS emulator, shows a worker killed mid-refund resuming without repeating completed activities, and covers replay rules (at-least-once activities, idempotency keys from ctx.run_id and ctx.tool_call_id, deterministic orchestrator code), human approvals via external events, per-role RetryPolicy settings, and deployment to Azure Durable Task Scheduler.

Why it matters

It gives a concrete, tested account of what actually happens when a durable agent worker dies mid-tool-call, plus the replay rules and approval pattern that follow from it.

Source: Pydantic AI Articles · pydantic.dev