Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ private ResumeSessionConfig CreateResumeConfig()
}

/// <summary>
/// Copies all supported properties from a source <see cref="SessionConfig"/> into a new instance
/// with <see cref="SessionConfig.Streaming"/> set to <c>true</c>.
/// Copies all supported properties from a source <see cref="SessionConfig"/> into a new instance,
/// including <see cref="SessionConfig.Streaming"/>.
/// </summary>
internal static SessionConfig CopySessionConfig(SessionConfig source)
{
Expand All @@ -298,13 +298,13 @@ internal static SessionConfig CopySessionConfig(SessionConfig source)
SkillDirectories = source.SkillDirectories,
DisabledSkills = source.DisabledSkills,
InfiniteSessions = source.InfiniteSessions,
Streaming = true
Streaming = source.Streaming
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit tests for CopySessionConfig currently only assert the default Streaming value; they don’t cover the bug fix scenario where source.Streaming is explicitly set to false. Please add/adjust tests to verify Streaming is preserved from the source (including the false case).

Copilot uses AI. Check for mistakes.
};
}

/// <summary>
/// Copies all supported properties from a source <see cref="SessionConfig"/> into a new
/// <see cref="ResumeSessionConfig"/> with <see cref="ResumeSessionConfig.Streaming"/> set to <c>true</c>.
/// <see cref="ResumeSessionConfig"/>, defaulting <see cref="ResumeSessionConfig.Streaming"/> to <c>true</c> when source is null.
/// </summary>
internal static ResumeSessionConfig CopyResumeSessionConfig(SessionConfig? source)
{
Expand All @@ -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
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit tests for CopyResumeSessionConfig currently assert Streaming is true but don’t validate that an explicitly disabled source.Streaming = false is carried over. Please add/adjust tests to cover both source.Streaming = false and the source is null => Streaming defaults to true behavior.

Copilot uses AI. Check for mistakes.
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -129,6 +129,7 @@ public void CopySessionConfig_CopiesAllProperties()
OnUserInputRequest = userInputHandler,
McpServers = mcpServers,
DisabledSkills = ["skill1"],
Streaming = false,
};

// Act
Expand All @@ -149,7 +150,7 @@ public void CopySessionConfig_CopiesAllProperties()
Assert.Same(userInputHandler, result.OnUserInputRequest);
Assert.Same(mcpServers, result.McpServers);
Assert.Equal(new List<string> { "skill1" }, result.DisabledSkills);
Assert.True(result.Streaming);
Assert.False(result.Streaming);
}

[Fact]
Expand Down Expand Up @@ -180,6 +181,7 @@ public void CopyResumeSessionConfig_CopiesAllProperties()
OnUserInputRequest = userInputHandler,
McpServers = mcpServers,
DisabledSkills = ["skill1"],
Streaming = false,
};

// Act
Expand All @@ -200,7 +202,7 @@ public void CopyResumeSessionConfig_CopiesAllProperties()
Assert.Same(userInputHandler, result.OnUserInputRequest);
Assert.Same(mcpServers, result.McpServers);
Assert.Equal(new List<string> { "skill1" }, result.DisabledSkills);
Assert.True(result.Streaming);
Assert.False(result.Streaming);
}

[Fact]
Expand Down