2.0.0b1 (2026-04-14)
This is a major architectural rewrite. The package has been redesigned as a lightweight hosting
foundation. Protocol implementations that were previously bundled in this package have moved to
dedicated protocol packages (azure-ai-agentserver-responses, azure-ai-agentserver-invocations).
See the Migration Guide
for upgrading from 1.x versions.
Breaking Changes
- Package split: All Responses API protocol types (models, handler decorators, SSE streaming)
have moved toazure-ai-agentserver-responses. All Invocations protocol types have moved to
azure-ai-agentserver-invocations. This package now contains only the shared hosting foundation. FoundryCBAgentremoved: Replaced byAgentServerHost, a Starlette subclass that IS the
ASGI app (no separate.appproperty orregister_routes()).AgentRunContextremoved: Protocol packages provide their own context types
(ResponseContextin Responses,request.statein Invocations).TracingHelperclass removed: Replaced by module-level functions (request_span,
end_span,record_error,trace_stream) for a simpler functional API.AgentLogger/get_logger()removed: Uselogging.getLogger("azure.ai.agentserver")
directly, or rely on the SDK's automatic console logging setup.ErrorResponse.create()removed: Replaced bycreate_error_response()module-level function.- Health endpoint renamed:
/healthy→/readiness. - OpenTelemetry is now a required dependency (was optional
[tracing]extras in 1.x). - Environment variables changed:
AGENT_LOG_LEVELandAGENT_GRACEFUL_SHUTDOWN_TIMEOUTare
no longer read fromConstants. Use thelog_levelandgraceful_shutdown_timeoutconstructor
parameters instead.
Features Added
AgentServerHostbase class with built-in health probe (/readiness), graceful shutdown
(configurable timeout), and Hypercorn-based ASGI serving.- Cooperative mixin inheritance for multi-protocol composition — a single server can host both
Responses and Invocations endpoints. - Automatic OpenTelemetry tracing with Azure Monitor and OTLP exporters.
configure_observabilityconstructor parameter for overridable logging + tracing setup.
ConsoleStreamHandleris attached to the root logger by default so userlogging.info()
calls are visible without any extra configuration.request_span()context manager for creating request-scoped OTel spans with GenAI semantic
convention attributes.end_span(),record_error(),flush_spans(),trace_stream()public functions for
protocol SDK tracing lifecycle.set_current_span()/detach_context()for explicit OTel context management during
streaming, ensuring child spans are correctly parented.AgentConfigdataclass for resolved configuration from environment variables (Foundry agent
name, version, project ID, session ID, etc.).create_error_response()utility for standard error envelope JSON responses.build_server_version()for constructingx-platform-serverheader segments.- HTTP access logging with configurable format via
access_logandaccess_log_format
constructor parameters.