fix: use system-reminder tags for conversation switch context (#933)

This commit is contained in:
Charles Packer
2026-02-12 14:18:16 -08:00
committed by GitHub
parent 25c11ed0a5
commit 28e67dadae
3 changed files with 25 additions and 5 deletions

View File

@@ -1,7 +1,5 @@
import type { Message } from "@letta-ai/letta-client/resources/agents/messages";
const SYSTEM_ALERT_OPEN = "<system-alert>";
const SYSTEM_ALERT_CLOSE = "</system-alert>";
import { SYSTEM_REMINDER_CLOSE, SYSTEM_REMINDER_OPEN } from "../../constants";
const MAX_HISTORY_MESSAGES = 8;
const MAX_MESSAGE_CHARS = 500;
@@ -83,7 +81,7 @@ export function buildConversationSwitchAlert(
parts.push("Review the in-context messages for full conversation history.");
}
return `${SYSTEM_ALERT_OPEN}\n${parts.join("\n")}\n${SYSTEM_ALERT_CLOSE}\n\n`;
return `${SYSTEM_REMINDER_OPEN}\n${parts.join("\n")}\n${SYSTEM_REMINDER_CLOSE}\n\n`;
}
function pushConversationMeta(