From e0e2e642677b9340c6e3e2a0f058ac9a6c056092 Mon Sep 17 00:00:00 2001 From: feiyun0112 Date: Thu, 19 Mar 2026 03:33:32 +0000 Subject: [PATCH 1/2] explicitly streaming --- .../GitHubCopilotAgent.cs | 11 +++--- .../GitHubCopilotAgentTests.cs | 36 +++++++++++++++++++ 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs b/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs index bbebd7a312..bb0b2c6990 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, + /// preserving the value from . /// internal static SessionConfig CopySessionConfig(SessionConfig source) { @@ -298,13 +298,14 @@ 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. + /// , preserving the value + /// from . When is null, streaming defaults to true. /// internal static ResumeSessionConfig CopyResumeSessionConfig(SessionConfig? source) { @@ -327,7 +328,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..5fb9c44dd7 100644 --- a/dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.UnitTests/GitHubCopilotAgentTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.UnitTests/GitHubCopilotAgentTests.cs @@ -129,6 +129,7 @@ public void CopySessionConfig_CopiesAllProperties() OnUserInputRequest = userInputHandler, McpServers = mcpServers, DisabledSkills = ["skill1"], + Streaming = true, }; // Act @@ -180,6 +181,7 @@ public void CopyResumeSessionConfig_CopiesAllProperties() OnUserInputRequest = userInputHandler, McpServers = mcpServers, DisabledSkills = ["skill1"], + Streaming = true, }; // Act @@ -222,6 +224,40 @@ public void CopyResumeSessionConfig_WithNullSource_ReturnsDefaults() Assert.True(result.Streaming); } + [Fact] + public void CopySessionConfig_WithStreamingFalse_PreservesStreamingFalse() + { + // Arrange — caller explicitly disables streaming (issue #4732) + var source = new SessionConfig + { + Streaming = false, + SystemMessage = new SystemMessageConfig { Mode = SystemMessageMode.Append, Content = "You are a helpful assistant." }, + }; + + // Act + SessionConfig result = GitHubCopilotAgent.CopySessionConfig(source); + + // Assert + Assert.False(result.Streaming); + } + + [Fact] + public void CopyResumeSessionConfig_WithStreamingFalse_PreservesStreamingFalse() + { + // Arrange — caller explicitly disables streaming (issue #4732) + var source = new SessionConfig + { + Streaming = false, + SystemMessage = new SystemMessageConfig { Mode = SystemMessageMode.Append, Content = "You are a helpful assistant." }, + }; + + // Act + ResumeSessionConfig result = GitHubCopilotAgent.CopyResumeSessionConfig(source); + + // Assert + Assert.False(result.Streaming); + } + [Fact] public void ConvertToAgentResponseUpdate_AssistantMessageEvent_DoesNotEmitTextContent() { From 55402ade8f58a04100b0f77c64ace92529b1cbe5 Mon Sep 17 00:00:00 2001 From: feiyun0112 Date: Thu, 19 Mar 2026 07:03:41 +0000 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs b/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs index bb0b2c6990..77f312617d 100644 --- a/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs @@ -275,7 +275,8 @@ private ResumeSessionConfig CreateResumeConfig() /// /// Copies all supported properties from a source into a new instance, - /// preserving the value from . + /// preserving the value from when set. + /// When has no explicit value, streaming defaults to true. /// internal static SessionConfig CopySessionConfig(SessionConfig source) { @@ -298,7 +299,7 @@ internal static SessionConfig CopySessionConfig(SessionConfig source) SkillDirectories = source.SkillDirectories, DisabledSkills = source.DisabledSkills, InfiniteSessions = source.InfiniteSessions, - Streaming = source.Streaming + Streaming = source.Streaming ?? true }; }