Skip to content

v1.5 SDK Release

Choose a tag to compare

@tracyboehrer tracyboehrer released this 30 Apr 17:01
· 3 commits to rel/v1.5 since this release
f45546a

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 proper ConversationReference defaults.
  • IResponseValidator / SemanticValidator: Interface and AI-backed implementation for validating agent replies semantically (e.g., against an LLM judge).
  • TestFlow enhancements: AssertNoMoreReplies, AssertTypingIndicator, AssertReplySatisfies (async delegate and IResponseValidator overloads), SendConversationUpdate overload accepting IEnumerable<ChannelAccount>.
  • WeatherAgent sample test: Demonstrates AI-backed response validation using SemanticKernel.
  • Added README documentation for the testing package.

Streaming: Feedback Loop Support

  • StreamingResponse now supports a FeedbackLoop property, allowing agents to signal feedback loop state in streaming responses.
  • FeedbackLoopEnabled added to IStreamingResponse interface with full unit test coverage.
  • Teams channel now supports streaming for agentic requests (#782).

Proactive Messaging

  • AgentApplication.Proactive support added (#694), enabling agents to initiate proactive conversations.

Typing Worker (TypingWorker) (#766)

  • New typing timer implementation with improved reliability.
  • TypingWorker now handles restarting cleanly when the timer needs to be reset mid-turn.
  • Added OnDeleteActivity and OnUpdateActivity handling so the typing indicator stops correctly when activities are deleted or updated.
  • ITypingChannelStrategy now exposes a Typing Activity factory, enabling channel-specific typing activity construction.

Government Cloud Support

  • Added government cloud authentication constants, RestChannelServiceClientFactory settings, AgentClaims updates, 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.
    • ChannelResponseHandler instrumentation: Activity tracing for response handling.
    • Distributed tracing: Improved CloneActivity for 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

  • ChannelAdapter base class: Extracted common IChannelAdapter behavior from CloudAdapter into a new ChannelAdapter base class, reducing duplication and improving extensibility (#759).
  • BackgroundTaskQueue: Replaced Task.Run usage with a proper background task queue for non-blocking request handling (#736).
  • ChannelResponseQueue fixes: Resolved race conditions in CompleteHandlerForRequest and response queue handling; HandleResponsesAsync now properly waits for start before completing.
  • HostedActivityService: Changed from Task.Run to Task.ContinueWith for improved threading behavior.
  • Race condition fixes: Fixed race in ChannelResponseQueue and TestAdapter.GetNextReplyAsync.

Serialization / JSON

  • Source-generation extensibility: Added ProtocolJsonSerializer.AddTypeInfoResolver() for plugging in JsonSerializerContext instances from source generators (#756).
  • CoreJsonContext: New source-generated JsonSerializerContext wired into the default resolver chain, covering core model types.
  • DictionaryOfObjectConverter: Now handles list/array values correctly (#752).
  • Converter cleanup: Migrated model converters to JsonContext and removed now redundant converters.
  • ProtocolJsonSerializer.ToObject: Catch-all conversion now converts to JsonElement first for better type fidelity (#749).

Routing

  • Route builders: Event, Invoke, and Type route builders now accept both name/type string overloads and custom selector delegates, with duplicate registration detection (#746).
  • RouteList: Switched to ReaderWriterLockSlim for 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 defaults Audience and Scopes from configuration rather than relying on Connection.Scope for BotFramework connections (#750).
  • BotServiceAudience setting: Added to RestChannelServiceClientFactory for explicit audience configuration (#772).
  • UserAuthorization: Fixed to always return a valid InvokeResponse (#712).
  • Auth audience bug fix: Fixed audience not being passed to ChannelServiceFactory.CreateUserTokenClientAsync.

Connector

  • Refactoring (no breaking changes): Internal cleanup of Microsoft.Agents.Connector for improved maintainability (#757).
  • URL encoding: Conversation API methods now URL-encode path arguments correctly.
  • AgentClaims: Obsoleted confusingly-named methods with clearer replacements; improved XML documentation (#768).

Startup Simplification (#789)

  • ServiceCollectionExtensions refactored to expose two distinct API surfaces: one for IHostApplicationBuilder and one for IServiceCollection, aligning with ASP.NET Core conventions.
  • AddAgent will now automatically register AgentApplicationOptions eliminating the requirement to explicity do so in startup. However, custom AgentApplicationOptions can still be registered.

Diagnostics: Route Debug Logging (#794)

  • AgentApplication now logs its registered route evaluation order at Debug level on startup.
  • Route handler names are resolved via reflection for clearer log output.
  • RouteList gained Count and FormatRouteList helpers used internally for log formatting.

Diagnostics: Connection Configuration Logging (#795)

  • ConfigurationConnections now logs all connection configurations at Debug level at construction time, making it easier to diagnose authentication/connection issues.
  • Settings are logged per-line; ClientSecret values are redacted from logs.

Bug Fixes

  • TypingTimer deadlock (#764): TypingTimer used a static AutoResetEvent that was overwritten on each call to Start(). Under concurrent turns, one turn could block forever in WaitOne() waiting on a signal that was never sent, causing typing indicators to run indefinitely and subsequent sends (including streaming updates) to hang. Fixed by the TypingWorker redesign in PR #766.
  • ChannelResponseQueue NullReferenceException (#722): A NullReferenceException in ChannelResponseQueue.CompleteHandlerForRequest could 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.
  • DictionaryOfObjectConverter crash with polymorphic dialog state (#729): Deserializing DialogState containing polymorphic types (objects with a [JsonPolymorphic] discriminator) would throw InvalidOperationException: The node must be of type 'JsonValue' because the converter called .AsValue() on JsonObject nodes. Fixed in PR #752 to handle objects and arrays correctly (which was the actual problem).
  • UserAuthorization missing InvokeResponse (#726): A signin/tokenResponse received when no OAuth flow was active (e.g., due to misconfigured non-persistent storage) would fail to return a 501 response to Teams, leaving the channel in an undefined state. Fixed in PR #712.
  • ClientCitationIconName deserialization 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.Name is now treated as a tolerant string type and a back-compat ClientCitationsIconNameEnum is preserved. Fixed in PR #800.
  • CreateConversation: Was not setting ChannelData on the returned ConversationReference.
  • StreamingResponse: Fixed issues with FinalMessage.
  • ActivityExtension.CloneActivity: Added early return for null/empty activity; fixed distributed tracing propagation.
  • AgentClaims scope tests: Fixed parallelization issues causing race conditions in test runs.

New Contributors

Full Changelog: v1.4.83...v1.5.180