(model, systemPrompt, mcpMode)
| 2317 | }, |
| 2318 | |
| 2319 | createChat(model, systemPrompt, mcpMode) { |
| 2320 | const chatId = generateChatId(); |
| 2321 | const now = Date.now(); |
| 2322 | const chat = { |
| 2323 | id: chatId, |
| 2324 | name: "New Chat", |
| 2325 | model: model || getCurrentModel() || "", |
| 2326 | history: [], |
| 2327 | systemPrompt: systemPrompt || "", |
| 2328 | mcpMode: mcpMode || false, |
| 2329 | tokenUsage: { |
| 2330 | promptTokens: 0, |
| 2331 | completionTokens: 0, |
| 2332 | totalTokens: 0, |
| 2333 | currentRequest: null |
| 2334 | }, |
| 2335 | contextSize: null, |
| 2336 | createdAt: now, |
| 2337 | updatedAt: now |
| 2338 | }; |
| 2339 | this.chats.push(chat); |
| 2340 | this.activeChatId = chatId; |
| 2341 | return chat; |
| 2342 | }, |
| 2343 | |
| 2344 | switchChat(chatId) { |
| 2345 | if (this.chats.find(c => c.id === chatId)) { |
nothing calls this directly
no test coverage detected