autonaming error logging
This commit is contained in:
@@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user