This commit is contained in:
Timothy Jaeryang Baek
2026-07-26 21:12:14 -04:00
parent f867825bf3
commit 71c4da8c06
8 changed files with 65 additions and 40 deletions
+10
View File
@@ -0,0 +1,10 @@
const TEMPORARY_CHAT_ID_PREFIX = 'temporary:';
const LEGACY_TEMPORARY_CHAT_ID_PREFIX = 'local:'; // Legacy temporary chat prefix.
export const createTemporaryChatId = (sessionId: string | undefined) =>
`${TEMPORARY_CHAT_ID_PREFIX}${sessionId}`;
export const isTemporaryChatId = (chatId: string | null | undefined) =>
!!chatId &&
(chatId.startsWith(TEMPORARY_CHAT_ID_PREFIX) ||
chatId.startsWith(LEGACY_TEMPORARY_CHAT_ID_PREFIX));