autonaming error logging

This commit is contained in:
Storme-bit
2026-04-13 20:15:57 -07:00
parent 70959e945a
commit e3f6b9a9db

View File

@@ -90,6 +90,7 @@ async function chat(externalId, userMessage, options = {}) {
// 2. Fetch recent episodes for context // 2. Fetch recent episodes for context
const recentEpisodes = await memory.getRecentEpisodes(session.id, RECENT_EPISODE_LIMIT ); const recentEpisodes = await memory.getRecentEpisodes(session.id, RECENT_EPISODE_LIMIT );
const isFirstMessage = recentEpisodes.length === 0;
const recentIds = new Set(recentEpisodes.map(e => e.id)); const recentIds = new Set(recentEpisodes.map(e => e.id));
// 3. Semantic Search // 3. Semantic Search
@@ -130,6 +131,7 @@ async function chatStream(externalId, userMessage, onChunk, options = {}) {
if (!session) session = await memory.createSession(externalId); if (!session) session = await memory.createSession(externalId);
const recentEpisodes = await memory.getRecentEpisodes(session.id, RECENT_EPISODE_LIMIT); const recentEpisodes = await memory.getRecentEpisodes(session.id, RECENT_EPISODE_LIMIT);
const isFirstMessage = recentEpisodes.length === 0;
const recentIds = new Set(recentEpisodes.map(e => e.id)); const recentIds = new Set(recentEpisodes.map(e => e.id));
const semanticEpisodes = await getSemanticEpisodes(userMessage, session.id, recentIds); const semanticEpisodes = await getSemanticEpisodes(userMessage, session.id, recentIds);
@@ -176,7 +178,6 @@ async function chatStream(externalId, userMessage, onChunk, options = {}) {
} }
} catch (err) { } catch (err) {
console.error('[orchestration] Failed to parse inference SSE event:', raw, err.message); console.error('[orchestration] Failed to parse inference SSE event:', raw, err.message);
throw err; // add this temporarily
} }
} }
} }