MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / renameBufferKey

Function renameBufferKey

src/stores/aiChat.ts:395–405  ·  view source on GitHub ↗
(state: AIChatSessionState, fromKey: string, toKey: string)

Source from the content-addressed store, hash-verified

393 }
394
395 function renameBufferKey(state: AIChatSessionState, fromKey: string, toKey: string): AIChatBuffer {
396 const buffer = getOrCreateBuffer(state, fromKey)
397 state.aiChatBuffers[toKey] = buffer
398 if (fromKey !== toKey) {
399 delete state.aiChatBuffers[fromKey]
400 }
401 if (state.currentAIChatId === null && fromKey === DRAFT_AI_CHAT_KEY) {
402 state.currentAIChatId = toKey
403 }
404 return buffer
405 }
406
407 function applySessionAssistantSelection(chatKey: string): void {
408 const state = getSessionState(chatKey)

Callers 1

sendMessageFunction · 0.85

Calls 1

getOrCreateBufferFunction · 0.85

Tested by

no test coverage detected