diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs index f6326a7b4..55d80c189 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs @@ -173,12 +173,14 @@ public async Task GetConversationRecordOrCreateNew(string agentId) var state = _services.GetRequiredService(); var channel = state.GetState("channel"); var channelId = state.GetState("channel_id"); + var userId = state.GetState("current_user_id"); var sess = new Conversation { Id = _conversationId, Channel = channel, ChannelId = channelId, - AgentId = agentId + AgentId = agentId, + UserId = userId, }; converation = await NewConversation(sess); }