(env, key, fallback = "", aliases = [])
| 4801 | } |
| 4802 | throw error; |
| 4803 | } |
| 4804 | state.chatHistoryLoaded = true; |
| 4805 | renderChatHistory(data); |
| 4806 | if (options.openLatest && !state.chatSessionId) { |
| 4807 | const latest = state.chatHistory[0]; |
| 4808 | if (latest?.session_id) { |
| 4809 | await loadChatSession(latest.session_id); |
| 4810 | } else { |
| 4811 | resetChatThread(); |
| 4812 | } |
| 4813 | } |
| 4814 | } |
| 4815 | |
| 4816 | async function loadChatSession(sessionId) { |
| 4817 | const normalizedSessionId = String(sessionId || "").trim(); |
| 4818 | if (!normalizedSessionId) { |
| 4819 | startNewChat({ silent: true }); |
| 4820 | return; |
no outgoing calls
no test coverage detected