mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Fix streaming path to include chat history in messages sent to chat client (#3798)
RunCoreStreamingAsync was passing inputMessagesForProviders (which lacks chat history) to GetStreamingResponseAsync instead of inputMessagesForChatClient (which includes chat history). This caused streaming runs to lose conversation context on subsequent calls. The non-streaming path (RunCoreAsync) already correctly used inputMessagesForChatClient. This aligns the streaming path to match. Also adds a unit test that validates chat history is included in messages sent to the chat client during streaming on subsequent calls. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com>
This commit is contained in:
co-authored by
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
lokitoth
parent
8ad66637d8
commit
6c37ce8450
@@ -226,7 +226,7 @@ public sealed partial class ChatClientAgent : AIAgent
|
||||
try
|
||||
{
|
||||
// Using the enumerator to ensure we consider the case where no updates are returned for notification.
|
||||
responseUpdatesEnumerator = chatClient.GetStreamingResponseAsync(inputMessagesForProviders, chatOptions, cancellationToken).GetAsyncEnumerator(cancellationToken);
|
||||
responseUpdatesEnumerator = chatClient.GetStreamingResponseAsync(inputMessagesForChatClient, chatOptions, cancellationToken).GetAsyncEnumerator(cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user