From 86ba268752bedcc2a923440109e747d72e12d468 Mon Sep 17 00:00:00 2001 From: "nick.yi" Date: Tue, 21 Apr 2026 16:43:30 +0800 Subject: [PATCH] optimize AI Context, GetDialogHistory default return Plain, RecordOnly messages --- .../Conversations/Services/ConversationService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs index 9cffd3d9d..1b71f5efa 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs @@ -169,7 +169,8 @@ public async Task> GetDialogHistory(int lastCount = 100, b } else { - dialogs = dialogs.Where(x => string.IsNullOrEmpty(x.MessageType) || x.MessageType.IsEqualTo(MessageTypeName.Plain)).ToList(); + var defaultMessageTypes = new List { MessageTypeName.Plain, MessageTypeName.RecordOnly }; + dialogs = dialogs.Where(x => string.IsNullOrEmpty(x.MessageType) || defaultMessageTypes.Contains(x.MessageType)).ToList(); } if (fromBreakpoint)