feat: refine codex live chat flow
This commit is contained in:
@@ -1072,7 +1072,7 @@ export async function updateChatConversationContext(
|
||||
|
||||
const currentChatTypeId = String(current.chat_type_id ?? '').trim() || null;
|
||||
const requestedChatTypeId = payload.chatTypeId?.trim() || null;
|
||||
const nextChatTypeId = currentChatTypeId || requestedChatTypeId || null;
|
||||
const nextChatTypeId = resolveNextConversationChatTypeId(currentChatTypeId, requestedChatTypeId);
|
||||
const requestedContextLabel = payload.contextLabel?.trim() || null;
|
||||
const requestedContextDescription = payload.contextDescription?.trim() || null;
|
||||
|
||||
@@ -1103,6 +1103,12 @@ export async function updateChatConversationContext(
|
||||
return getChatConversation(sessionId, normalizedClientId);
|
||||
}
|
||||
|
||||
export function resolveNextConversationChatTypeId(currentChatTypeId?: string | null, requestedChatTypeId?: string | null) {
|
||||
const normalizedCurrentChatTypeId = String(currentChatTypeId ?? '').trim() || null;
|
||||
const normalizedRequestedChatTypeId = String(requestedChatTypeId ?? '').trim() || null;
|
||||
return normalizedRequestedChatTypeId ?? normalizedCurrentChatTypeId ?? null;
|
||||
}
|
||||
|
||||
export async function listChatConversations(
|
||||
clientId?: string | null,
|
||||
limit = 50,
|
||||
|
||||
Reference in New Issue
Block a user