From 0f2875585a6029dbcdd37c6d2452f92b6e5c72b6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Dec 2025 11:04:16 +0000 Subject: [PATCH 1/2] Initial plan From d14a67a82df8add45bebee8a6f53cc7d27e64967 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Dec 2025 11:10:16 +0000 Subject: [PATCH 2/2] Change AllowBackgroundResponses property from bool? to bool Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> --- dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunOptions.cs | 2 +- dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunOptions.cs b/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunOptions.cs index 9cd6d51680..0af00bbaca 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunOptions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunOptions.cs @@ -75,7 +75,7 @@ public AgentRunOptions(AgentRunOptions options) /// If the implementation does not support background responses, this property will be ignored. /// /// - public bool? AllowBackgroundResponses { get; set; } + public bool AllowBackgroundResponses { get; set; } /// /// Gets or sets additional properties associated with these options. diff --git a/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs b/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs index a5a34d24a9..416352fad9 100644 --- a/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs @@ -584,7 +584,7 @@ await thread.AIContextProvider.InvokedAsync(new(inputMessages, aiContextProvider static ChatOptions? ApplyBackgroundResponsesProperties(ChatOptions? chatOptions, AgentRunOptions? agentRunOptions) { // If any of the background response properties are set in the run options, we should apply both to the chat options. - if (agentRunOptions?.AllowBackgroundResponses is not null || agentRunOptions?.ContinuationToken is not null) + if (agentRunOptions?.AllowBackgroundResponses == true || agentRunOptions?.ContinuationToken is not null) { chatOptions ??= new ChatOptions(); chatOptions.AllowBackgroundResponses = agentRunOptions.AllowBackgroundResponses;