dont forward conversationId to ichatclient (#2632)

This commit is contained in:
Korolev Dmitry
2025-12-05 14:41:50 +00:00
committed by GitHub
parent 9c1b2f9a3f
commit 417a529e0e
4 changed files with 174 additions and 2 deletions
@@ -36,7 +36,13 @@ internal sealed class AIAgentResponseExecutor : IResponseExecutor
// Create options with properties from the request
var chatOptions = new ChatOptions
{
ConversationId = request.Conversation?.Id,
// Note: We intentionally do NOT set ConversationId on ChatOptions here.
// The conversation ID from the client request is used by the hosting layer
// to manage conversation storage, but should not be forwarded to the underlying
// IChatClient as it has its own concept of conversations (or none at all).
// ---
// ConversationId = request.Conversation?.Id,
Temperature = (float?)request.Temperature,
TopP = (float?)request.TopP,
MaxOutputTokens = request.MaxOutputTokens,
@@ -82,9 +82,16 @@ internal sealed class HostedAgentResponseExecutor : IResponseExecutor
{
string agentName = GetAgentName(request)!;
AIAgent agent = this._serviceProvider.GetRequiredKeyedService<AIAgent>(agentName);
var chatOptions = new ChatOptions
{
ConversationId = request.Conversation?.Id,
// Note: We intentionally do NOT set ConversationId on ChatOptions here.
// The conversation ID from the client request is used by the hosting layer
// to manage conversation storage, but should not be forwarded to the underlying
// IChatClient as it has its own concept of conversations (or none at all).
// ---
// ConversationId = request.Conversation?.Id,
Temperature = (float?)request.Temperature,
TopP = (float?)request.TopP,
MaxOutputTokens = request.MaxOutputTokens,