Skip to content

.NET: [Bug]: CopySessionConfig() hardcodes Streaming = true, ignoring SessionConfig.Streaming value #4732

@greenie-msft

Description

@greenie-msft

Description

GitHubCopilotAgent.CopySessionConfig() and CopyResumeSessionConfig() in Microsoft.Agents.AI.GitHub.Copilot always hardcode Streaming = true on the copied config, ignoring any value the caller sets on source.Streaming. There are scenarios where we want to disable streaming

This means there is no way to disable streaming when using AsAIAgent() with the GitHub Copilot SDK, even though SessionConfig.Streaming exists as a settable property.

Steps to Reproduce

var sessionConfig = new SessionConfig
{
    Streaming = false, // caller explicitly disables streaming
    SystemMessage = "You are a helpful assistant.",
    OnPermissionRequest = PermissionHandler.ApproveAll,
};
 
var agent = copilotClient.AsAIAgent(sessionConfig);
// Agent always uses streaming regardless — CopySessionConfig ignores source.Streaming

Root Cause

internal static SessionConfig CopySessionConfig(SessionConfig source)
{
    return new SessionConfig
    {
        Model = source.Model,
        ReasoningEffort = source.ReasoningEffort,
        // ... all other properties copied from source ...
        InfiniteSessions = source.InfiniteSessions,
        Streaming = true  // ← hardcoded, should be: source.Streaming
    };
}

Package Versions

Microsoft.Agents.AI.GitHub.Copilot (verified in 1.0.0-preview.260311.1, likely since 1.0.0-preview.260225.1)

.NET Version

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETbugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions