-
Notifications
You must be signed in to change notification settings - Fork 839
Fix bug to yield remaining buffered FCC #6903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses two critical bugs in the FunctionInvokingChatClient's streaming functionality related to function call content (FCC) buffering and yielding behavior. The fix ensures that all buffered updates are properly yielded when the stream ends, particularly in scenarios involving mixed approval requirements for function calls.
Key changes:
- Enhanced condition to yield updates when no function calls are present yet
- Added logic to yield remaining buffered updates at stream end
- Extended test coverage for mixed approval scenarios with multi-round testing
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs |
Fixed streaming logic to yield remaining buffered updates and handle pre-FCC scenarios |
test/Libraries/Microsoft.Extensions.AI.Tests/ChatCompletion/FunctionInvokingChatClientApprovalsTests.cs |
Added comprehensive test for mixed approval scenarios and refactored existing test methods to support multi-round testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Address two issues:
Fixes microsoft/agent-framework#1295
Microsoft Reviewers: Open in CodeFlow