.NET: Fix CopySessionConfig to respect SessionConfig.Streaming#4797
.NET: Fix CopySessionConfig to respect SessionConfig.Streaming#4797Protocol-zero-0 wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Fixes a bug in the .NET GitHub Copilot agent adapter where session config copying forced streaming on, preventing callers from disabling streaming output.
Changes:
- Update
CopySessionConfig()to copyStreamingfrom the sourceSessionConfig. - Update
CopyResumeSessionConfig()to copyStreamingwhen provided, defaulting totruewhensourceis null. - Update XML docs to reflect the new streaming behavior.
| @@ -1,4 +1,4 @@ | |||
| // Copyright (c) Microsoft. All rights reserved. | |||
| // Copyright (c) Microsoft. All rights reserved. | |||
There was a problem hiding this comment.
This file appears to have been saved without the UTF-8 BOM (many repo C# files start with //, and dotnet/.editorconfig specifies charset = utf-8-bom). Please re-save/format this file to restore the BOM to match repo conventions and avoid formatting churn/tooling mismatches.
| // Copyright (c) Microsoft. All rights reserved. | |
| // Copyright (c) Microsoft. All rights reserved. |
| DisabledSkills = source.DisabledSkills, | ||
| InfiniteSessions = source.InfiniteSessions, | ||
| Streaming = true | ||
| Streaming = source.Streaming |
There was a problem hiding this comment.
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).
| DisabledSkills = source?.DisabledSkills, | ||
| InfiniteSessions = source?.InfiniteSessions, | ||
| Streaming = true | ||
| Streaming = source?.Streaming ?? true |
There was a problem hiding this comment.
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.
Made-with: Cursor
|
Updated. I restored the file BOM to match the repository encoding convention, and I expanded the unit coverage so both copy helpers now verify that an explicit |
|
@microsoft-github-policy-service agree |
Description
CopySessionConfig()andCopyResumeSessionConfig()inGitHubCopilotAgent.cshardcodeStreaming = true, ignoring the value fromSessionConfig.Streaming. This makes it impossible to disable streaming output.Changes
CopySessionConfig: ChangedStreaming = truetoStreaming = source.StreamingCopyResumeSessionConfig: ChangedStreaming = truetoStreaming = source?.Streaming ?? true(preserves default behavior when source is null)Fixes #4732
Made with Cursor