v1.5 SDK Release
What's Changed
New Features
Agent Testing Framework (Microsoft.Agents.Builder.Testing)
Re-introduced and significantly expanded the Builder.Testing package for agent unit and integration testing:
AgentTestHost: DI-based test harness for end-to-end agent testing with full service container support.TestAdapter.Create: Static factory method for easy adapter construction with properConversationReferencedefaults.IResponseValidator/SemanticValidator: Interface and AI-backed implementation for validating agent replies semantically (e.g., against an LLM judge).TestFlowenhancements:AssertNoMoreReplies,AssertTypingIndicator,AssertReplySatisfies(async delegate andIResponseValidatoroverloads),SendConversationUpdateoverload acceptingIEnumerable<ChannelAccount>.WeatherAgentsample test: Demonstrates AI-backed response validation using SemanticKernel.- Added README documentation for the testing package.
Streaming: Feedback Loop Support
StreamingResponsenow supports aFeedbackLoopproperty, allowing agents to signal feedback loop state in streaming responses.FeedbackLoopEnabledadded toIStreamingResponseinterface with full unit test coverage.- Teams channel now supports streaming for agentic requests (#782).
Proactive Messaging
AgentApplication.Proactivesupport added (#694), enabling agents to initiate proactive conversations.
Typing Worker (TypingWorker) (#766)
- New typing timer implementation with improved reliability.
TypingWorkernow handles restarting cleanly when the timer needs to be reset mid-turn.- Added
OnDeleteActivityandOnUpdateActivityhandling so the typing indicator stops correctly when activities are deleted or updated. ITypingChannelStrategynow exposes a Typing Activity factory, enabling channel-specific typing activity construction.
Government Cloud Support
- Added government cloud authentication constants,
RestChannelServiceClientFactorysettings,AgentClaimsupdates, and sample AspNet auth changes to support sovereign cloud deployments (#771).
Telemetry / OpenTelemetry
- New telemetry infrastructure across the SDK:
- Connector instrumentation: HTTP spans for connector client calls.
- Storage instrumentation: OpenTelemetry spans for storage read/write operations.
ChannelResponseHandlerinstrumentation: Activity tracing for response handling.- Distributed tracing: Improved
CloneActivityfor better trace context propagation.
- Removed old OTelAgent sample in favor of integrated instrumentation throughout the SDK.
Orchestrated Client (Microsoft.Agents.CopilotStudio.Client)
New OrchestratedClient added to Microsoft.Agents.CopilotStudio.Client for calling Copilot Studio agents via the External Orchestration API. The client handles conversation lifecycle, passes conversation ID and client request ID headers automatically, supports strongly-typed error codes (OrchestratedErrorCode), and accepts OrchestratedRequestProperties for injecting additional HTTP headers. An end-to-end sample is included.
Teams: Targeted Messaging
- Sending a targeted message (e.g., to a specific user in a group chat) now throws if the conversation is not a group chat, providing clear feedback rather than silently failing.
Improvements
CloudAdapter / Channel Adapter
ChannelAdapterbase class: Extracted commonIChannelAdapterbehavior fromCloudAdapterinto a newChannelAdapterbase class, reducing duplication and improving extensibility (#759).BackgroundTaskQueue: ReplacedTask.Runusage with a proper background task queue for non-blocking request handling (#736).ChannelResponseQueuefixes: Resolved race conditions inCompleteHandlerForRequestand response queue handling;HandleResponsesAsyncnow properly waits for start before completing.HostedActivityService: Changed fromTask.RuntoTask.ContinueWithfor improved threading behavior.- Race condition fixes: Fixed race in
ChannelResponseQueueandTestAdapter.GetNextReplyAsync.
Serialization / JSON
- Source-generation extensibility: Added
ProtocolJsonSerializer.AddTypeInfoResolver()for plugging inJsonSerializerContextinstances from source generators (#756). CoreJsonContext: New source-generatedJsonSerializerContextwired into the default resolver chain, covering core model types.DictionaryOfObjectConverter: Now handles list/array values correctly (#752).- Converter cleanup: Migrated model converters to
JsonContextand removed now redundant converters. ProtocolJsonSerializer.ToObject: Catch-all conversion now converts toJsonElementfirst for better type fidelity (#749).
Routing
- Route builders:
Event,Invoke, andTyperoute builders now accept bothname/typestring overloads and custom selector delegates, with duplicate registration detection (#746). RouteList: Switched toReaderWriterLockSlimfor improved thread safety under concurrent route registration.- Agentic route ordering: Added integration tests verifying correct ordering of agentic routes (#767).
OAuth / Authentication
AgenticUserAuthorization: Now retrieves both AI and AU (user) tokens in a single authorization step (#769).RestChannelServiceClientFactory: Now properly defaultsAudienceandScopesfrom configuration rather than relying onConnection.Scopefor BotFramework connections (#750).BotServiceAudiencesetting: Added toRestChannelServiceClientFactoryfor explicit audience configuration (#772).UserAuthorization: Fixed to always return a validInvokeResponse(#712).- Auth audience bug fix: Fixed audience not being passed to
ChannelServiceFactory.CreateUserTokenClientAsync.
Connector
- Refactoring (no breaking changes): Internal cleanup of
Microsoft.Agents.Connectorfor improved maintainability (#757). - URL encoding:
ConversationAPI methods now URL-encode path arguments correctly. AgentClaims: Obsoleted confusingly-named methods with clearer replacements; improved XML documentation (#768).
Startup Simplification (#789)
ServiceCollectionExtensionsrefactored to expose two distinct API surfaces: one forIHostApplicationBuilderand one forIServiceCollection, aligning with ASP.NET Core conventions.AddAgentwill now automatically registerAgentApplicationOptionseliminating the requirement to explicity do so in startup. However, custom AgentApplicationOptions can still be registered.
Diagnostics: Route Debug Logging (#794)
AgentApplicationnow logs its registered route evaluation order atDebuglevel on startup.- Route handler names are resolved via reflection for clearer log output.
RouteListgainedCountandFormatRouteListhelpers used internally for log formatting.
Diagnostics: Connection Configuration Logging (#795)
ConfigurationConnectionsnow logs all connection configurations atDebuglevel at construction time, making it easier to diagnose authentication/connection issues.- Settings are logged per-line;
ClientSecretvalues are redacted from logs.
Bug Fixes
TypingTimerdeadlock (#764):TypingTimerused astatic AutoResetEventthat was overwritten on each call toStart(). Under concurrent turns, one turn could block forever inWaitOne()waiting on a signal that was never sent, causing typing indicators to run indefinitely and subsequent sends (including streaming updates) to hang. Fixed by theTypingWorkerredesign in PR #766.ChannelResponseQueueNullReferenceException(#722): ANullReferenceExceptioninChannelResponseQueue.CompleteHandlerForRequestcould occur when an invoke request was cancelled (e.g., during a Teams query extension flow), leaving the response handler in an inconsistent state. Fixed in PR #731.DictionaryOfObjectConvertercrash with polymorphic dialog state (#729): DeserializingDialogStatecontaining polymorphic types (objects with a[JsonPolymorphic]discriminator) would throwInvalidOperationException: The node must be of type 'JsonValue'because the converter called.AsValue()onJsonObjectnodes. Fixed in PR #752 to handle objects and arrays correctly (which was the actual problem).UserAuthorizationmissingInvokeResponse(#726): Asignin/tokenResponsereceived when no OAuth flow was active (e.g., due to misconfigured non-persistent storage) would fail to return a501response to Teams, leaving the channel in an undefined state. Fixed in PR #712.ClientCitationIconNamedeserialization crash (#793): Activities from Copilot Studio containing citation image names not present in the SDK enum (e.g.,"Microsoft SharePoint","Unknown") threw a deserialization exception, dropping the entire activity.AppearanceImage.Nameis now treated as a tolerant string type and a back-compatClientCitationsIconNameEnumis preserved. Fixed in PR #800.CreateConversation: Was not settingChannelDataon the returnedConversationReference.StreamingResponse: Fixed issues withFinalMessage.ActivityExtension.CloneActivity: Added early return for null/empty activity; fixed distributed tracing propagation.AgentClaimsscope tests: Fixed parallelization issues causing race conditions in test runs.
New Contributors
- @sudoaccessdenied made their first contribution in #731
- @mdesalvo made their first contribution in #770
- @flaviocdc made their first contribution in #767
- @rodrigobr-msft made their first contribution in #763
Full Changelog: v1.4.83...v1.5.180