.Net ChatClientAgent Streaming API Impl. - #69
Merged
Roger Barreto (rogerbarreto) merged 5 commits intoJun 12, 2025
Merged
Conversation
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
June 11, 2025 12:54 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
June 11, 2025 12:54 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements full streaming support for the ChatClientAgent and updates related configuration, extensions, logging, and tests.
- Adds streaming logic to
ChatClientAgent.RunStreamingAsyncwith proper thread/message preparation and logging - Introduces
InstructionsRoleinChatClientAgentOptionsand extends the agent API withRunStreamingAsyncin extensions - Renames and updates unit tests to cover the new streaming behavior
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/tests/.../ChatClientAgentTests.cs | Renamed tests, removed outdated ones, added new streaming test |
| dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentOptions.cs | Added InstructionsRole property |
| dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentLogMessages.cs | Updated log messages to reference client type instead of service |
| dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentExtensions.cs | Added RunStreamingAsync extension and renamed parameter for clarity |
| dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgent.cs | Implemented streaming API, refactored thread/message preparation |
Comments suppressed due to low confidence (4)
dotnet/tests/Microsoft.Agents.UnitTests/ChatCompletion/ChatClientAgentTests.cs:546
- Add a unit test to verify that supplying
InstructionsRoleviaChatClientAgentOptionscorrectly overrides the defaultChatClientAgent.InstructionsRolevalue.
}
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentExtensions.cs:49
- [nitpick] Add a
<returns>XML comment to describe that this method yields an asynchronous stream ofChatResponseUpdateitems.
public static IAsyncEnumerable<ChatResponseUpdate> RunStreamingAsync(
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentLogMessages.cs:27
- [nitpick] Consider renaming this method to
LogAgentChatClientInvokingClientto reflect that it logs invocation of the chat client, matching the{ClientType}token in the message template.
public static partial void LogAgentChatClientInvokingAgent(
dotnet/src/Microsoft.Agents/ChatCompletion/ChatClientAgentLogMessages.cs:24
- All logger messages currently share
EventId = 0. Assign distinct event IDs to each log entry to make filtering and diagnostics easier.
EventId = 0,
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
June 11, 2025 14:55 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
had a problem deploying
to
integration
June 11, 2025 14:55 — with
GitHub Actions
Failure
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
June 11, 2025 15:24 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
June 11, 2025 15:24 — with
GitHub Actions
Inactive
westey (westey-m)
approved these changes
Jun 11, 2025
Roger Barreto (rogerbarreto)
enabled auto-merge
June 11, 2025 17:32
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
June 11, 2025 18:25 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
June 11, 2025 18:25 — with
GitHub Actions
Inactive
Mark Wallace (markwallace-microsoft)
approved these changes
Jun 12, 2025
Roger Barreto (rogerbarreto)
deleted the
issues/68-chatclientagent-streaming
branch
June 12, 2025 06:21
Reuben Bond (ReubenBond)
pushed a commit
to ReubenBond/agent-framework
that referenced
this pull request
Oct 28, 2025
* Add Streaming API * Removing InstructionsRole * Updating thread notification strategy * Fix net472 failing * Address typo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#Motivation