2.0.0b9 (2026-07-28)
Features Added
- Added Agent Server-managed OTLP/gRPC export when
OTEL_EXPORTER_OTLP_PROTOCOL=grpcis configured. - Task-record schema cleanup: framework-reserved wire keys in the persisted task record no longer carry a leading
_(e.g. thetask_nametag; theschema_version/last_input_id/turn_started_at/retry_attempt/steeringpayload keys; theinput/steering_input_<seq>/outputattachment keys) — only the__attachment_ref__discriminator keeps its marker. Thesourcestamp now includeshosting_environment(fromFOUNDRY_HOSTING_ENVIRONMENT), and the payload now carries aschema_version(currently"1"). Tasks persisted before this change (lackingpayload.schema_version) are deleted rather than recovered by the recovery scan. - Added a resilient task primitive for building long-running agents that survive container restarts, out-of-memory kills, and redeployments. Decorate an async function with
@task(one-shot) or@multi_turn_task(multi-turn conversations); the framework persists task state to a task store and automatically recovers and re-invokes in-flight work after a crash. Available fromazure.ai.agentserver.core.tasks, withTaskContext,TaskRun, configurable retries (RetryPolicy), cancellation, steering, and a typed exception set (TaskFailed,TaskCancelled,TaskConflictError,TaskManagerNotInitialized, and others). See the Resilient Task Developer Guide. - Added an event streaming API (
azure.ai.agentserver.core.streaming) for publishing incremental task output to one or more subscribers, with in-memory and file-backed buffering and live or replay delivery. This makes it straightforward to serve Server-Sent Events (SSE) responses that a client can disconnect from and resume. See the Streaming Developer Guide. - Exposed
resolve_state_subdir(name)on the publicazure.ai.agentserver.coresurface. It resolves an on-disk state subdirectory (e.g."tasks","streams","responses") under the shared agent-server state root (AGENTSERVER_STATE_ROOT, or~/.agentserverwhen unset), so protocol packages persist state under the same operator-controlled root.
Other Changes
streams.use_file_backed_replay(...)now has ergonomic defaults so the common case is a single call supplying onlycursor_fn:storage_dirdefaults toresolve_state_subdir("streams")(astreamsdirectory under the agent-server state root, alongsidetasks),ttl_secondsdefaults to 600 (10 minutes), and serialization defaults to JSON.- File-backed replay streams now sanitize the stream id before using it as an on-disk filename: well-formed ids (
[A-Za-z0-9._-], no./..segment) are used verbatim, and any id containing a path separator or other unsafe character is SHA-256 hash-encoded to anh_<hex>filename so it can never escape the storage directory or collide with another stream. The file-backed terminal sentinel is now written as{"__terminal__": true}(the non-durableemit_timefield was dropped; close-time is best-effort on rehydration). - The per-attachment value cap was raised from 2 MiB to 10 MiB (per-input payloads spill into
task.attachments). The 1 MBtask.payloadbudget, the inline-promotion thresholds (_input200 KiB, steering input 20 KiB), and the 20-attachments-per-task limit are unchanged. @task/@multi_turn_tasknow require an explicitname=(the stable recovery/identity anchor); the previousfunc.__qualname__fallback is removed because it silently rebound task identity when a handler was renamed or moved, orphaning in-flight tasks. Omittingname(or passing whitespace) now raisesValueErrorat decoration.- The per-turn task
timeoutnow defaults to 1 day when unset (previously unbounded) and enforces 1 day as a hard ceiling — a larger or negative value is rejected at registration (ValueError). This caps a single handler invocation only; multi-turn chains still live indefinitely across turns (the budget resets each turn). - A caller-supplied
input_idonTask.start/Task.run(and the multi-turn equivalents) is now validated against the same charset/length pattern astask_id; an invalid id raisesValueErrorbefore any provider call. RetryPolicynow enforces hard caps at construction (fail-fast, not clamped):max_attemptsmust be 1–10 andmax_delaymust be 0–1 hour; out-of-range values raiseValueError. The zero-argument module-level presets (exponential_backoff(),fixed_delay(),linear_backoff()) now match theirRetryPolicy.<preset>()classmethod values so retry cadence is identical across the Python and .NET implementations.- Added
azure-coreas a dependency, and ahostedoptional-dependencies extra (pulling inazure-identity) for hosted-agent deployments. resolve_graceful_shutdown_timeout()now honors theAGENTSERVER_GRACEFUL_SHUTDOWN_TIMEOUT_SECONDSenvironment variable, letting operators shorten shutdown so task checkpoints can flush before long-running requests finish.- Added diagnostic logging (logger
azure.ai.agentserver.streaming) to the event-streaming subsystem covering stream creation/deletion, crash-recovery rehydration of file-backed streams, and corruption/lock-contention failures, to aid debugging in production.