diff --git a/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs b/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs index bbebd7a312..6e3f88ee09 100644 --- a/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs @@ -274,8 +274,8 @@ private ResumeSessionConfig CreateResumeConfig() } /// - /// Copies all supported properties from a source into a new instance - /// with set to true. + /// Copies all supported properties from a source into a new instance, + /// including . /// internal static SessionConfig CopySessionConfig(SessionConfig source) { @@ -298,13 +298,13 @@ internal static SessionConfig CopySessionConfig(SessionConfig source) SkillDirectories = source.SkillDirectories, DisabledSkills = source.DisabledSkills, InfiniteSessions = source.InfiniteSessions, - Streaming = true + Streaming = source.Streaming }; } /// /// Copies all supported properties from a source into a new - /// with set to true. + /// , defaulting to true when source is null. /// internal static ResumeSessionConfig CopyResumeSessionConfig(SessionConfig? source) { @@ -327,7 +327,7 @@ internal static ResumeSessionConfig CopyResumeSessionConfig(SessionConfig? sourc SkillDirectories = source?.SkillDirectories, DisabledSkills = source?.DisabledSkills, InfiniteSessions = source?.InfiniteSessions, - Streaming = true + Streaming = source?.Streaming ?? true }; } diff --git a/dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.UnitTests/GitHubCopilotAgentTests.cs b/dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.UnitTests/GitHubCopilotAgentTests.cs index 52ea0026dc..2089f28524 100644 --- a/dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.UnitTests/GitHubCopilotAgentTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.UnitTests/GitHubCopilotAgentTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; @@ -129,6 +129,7 @@ public void CopySessionConfig_CopiesAllProperties() OnUserInputRequest = userInputHandler, McpServers = mcpServers, DisabledSkills = ["skill1"], + Streaming = false, }; // Act @@ -149,7 +150,7 @@ public void CopySessionConfig_CopiesAllProperties() Assert.Same(userInputHandler, result.OnUserInputRequest); Assert.Same(mcpServers, result.McpServers); Assert.Equal(new List { "skill1" }, result.DisabledSkills); - Assert.True(result.Streaming); + Assert.False(result.Streaming); } [Fact] @@ -180,6 +181,7 @@ public void CopyResumeSessionConfig_CopiesAllProperties() OnUserInputRequest = userInputHandler, McpServers = mcpServers, DisabledSkills = ["skill1"], + Streaming = false, }; // Act @@ -200,7 +202,7 @@ public void CopyResumeSessionConfig_CopiesAllProperties() Assert.Same(userInputHandler, result.OnUserInputRequest); Assert.Same(mcpServers, result.McpServers); Assert.Equal(new List { "skill1" }, result.DisabledSkills); - Assert.True(result.Streaming); + Assert.False(result.Streaming); } [Fact]