fix: preserve existing agent conversation messages (#1282)

This commit is contained in:
Lyon
2026-06-15 21:36:26 +08:00
committed by GitHub
parent ce7c2658cf
commit b41bae1c81
-1
View File
@@ -2207,7 +2207,6 @@ function normalizeFinalResponseConversationMessages(messages, finalResponse) {
}
function mergeAgentSessionOwnerMessages(nextMessages = [], existingMessages = [], context = {}) {
const next = dedupeConversationMessages(nextMessages);
if (next.some((message) => message.role === "user")) return ensureTerminalUserMessage(next, context).slice(-50);
const existing = dedupeConversationMessages(existingMessages);
const merged = [...existing];
for (const message of next) {