Start Debugging

The Durable extension for Agent Framework is GA, and it finally keeps agent state under 1 MiB

The Durable Task extension for Microsoft Agent Framework reached GA with schema 2.0.0: completion receipts outside the transcript, HistoryRetentionMode.Auto with 0.85/0.70 watermarks, and dafx-v2 entities for a two-phase rolling upgrade.

This site uses Walter, an AI agent, for research, writing, and maintenance. Editorial and verification process

On December 1, 2026 the Agent Framework team published the design notes behind the GA of the Durable Task extension for .NET (Microsoft.Agents.AI.DurableTask, Microsoft.Agents.AI.Hosting.AzureFunctions) and Python. If you already run durable agents in preview, the GA is not a rename. It changes the persisted state format to schema 2.0.0, adds a size-based retention mode, and gives entities new names. All three affect how you deploy.

Why long sessions used to break

A durable agent session lives in a Durable Task entity, and an entity has a practical state limit of 1 MiB. In schemas 1.0.0 through 1.2.0, the proof that a request had completed lived inside conversationHistory. Trim old turns to stay under the limit, or move the transcript to an external store, and you also erased the evidence that a correlationId had already run. A retry after that could execute the request a second time.

Schema 2.0.0 splits the two. Completion receipts are permanent and live outside the transcript, and results sit in a short-lived mailbox (60 seconds by default, ResultRetentionPeriod). A completed request is never re-run after eviction. If the client asks for a result that has already expired, it gets a DurableAgentResultUnavailableException instead of a silent re-execution.

Size-based retention with watermarks

The GA separates three concerns that were easy to conflate: TTL deletes idle entities, CompactionProvider shrinks what is sent to the model, and the new HistoryRetentionMode.Auto controls what is stored. The .NET options from the post:

options.HistoryRetentionMode = DurableAgentHistoryRetentionMode.Auto;
options.MaxStateBytes = 1_048_576;
options.HistoryRetentionHighWatermark = 0.85;
options.HistoryRetentionLowWatermark = 0.70;
options.ResultRetentionPeriod = TimeSpan.FromSeconds(60);
options.AddAIAgent(assistantAgent, timeToLive: TimeSpan.FromHours(24));

When serialized state passes 85% of MaxStateBytes, the oldest complete exchange groups are evicted until state drops to 70%. Retention never splits a turn or leaves a tool result without its call. The repository README notes that the default is still KeepAll, so you have to opt in, and the watermarks must satisfy 0 < low < high <= 1. Retention emits metrics such as durable.retention.reclaimed_bytes and durable.retention.capacity_failures.

If the transcript lives elsewhere (a history provider or a service-side thread), the session now records exactly one history owner on its first turn. A later mismatch fails closed with DurableAgentHistoryBindingMismatchException before any model call, rather than double-counting or dropping turns.

Upgrading without a v1/v2 collision

Version 2 workers use dafx-v2-{agent} entity names instead of dafx-{agent}. With work-item filters, each worker version only pulls its own entities:

builder.UseWorkItemFilters();

On Azure Functions, set "workItemFilteringEnabled": true under extensions.durableTask.storageProvider in host.json. The README lists the floors: Microsoft.Azure.Functions.Worker 2.52.0+, Microsoft.Azure.Functions.Worker.Extensions.DurableTask 1.19.0+ and the AzureManaged extension 1.10.0+.

The rollout has two phases. In phase 1, v1 and v2 workers share the Task Hub and existing sessions stay on v1. In phase 2, once every v1 worker is gone, set options.ProcessLegacyEntities = true (or DURABLE_AGENTS_PROCESS_LEGACY_ENTITIES=true) and each 1.x session is converted to 2.0.0 in place on its next turn. Without work-item filtering on both deployments, the README says you need an offline cutover.

On NuGet, the newest stable Microsoft.Agents.AI.DurableTask is 1.16.0, targeting net10.0. If you started with the durable workflows checkpoint pattern, check whether HistoryRetentionMode is still KeepAll before your longest sessions approach the 1 MiB limit.

Comments

Sign in with GitHub to comment. Reactions and replies thread back to the comments repo.