autonaming error logging
This commit is contained in:
@@ -90,6 +90,7 @@ async function chat(externalId, userMessage, options = {}) {
|
||||
|
||||
// 2. Fetch recent episodes for context
|
||||
const recentEpisodes = await memory.getRecentEpisodes(session.id, RECENT_EPISODE_LIMIT );
|
||||
const isFirstMessage = recentEpisodes.length === 0;
|
||||
const recentIds = new Set(recentEpisodes.map(e => e.id));
|
||||
|
||||
// 3. Semantic Search
|
||||
@@ -125,11 +126,12 @@ async function chat(externalId, userMessage, options = {}) {
|
||||
}
|
||||
|
||||
async function chatStream(externalId, userMessage, onChunk, options = {}) {
|
||||
console.log('[orchestration] chatStream called:', { externalId, userMessage: userMessage.slice(0, 50) });
|
||||
console.log('[orchestration] chatStream called:', { externalId, userMessage: userMessage.slice(0, 50) });
|
||||
let session = await memory.getSessionByExternalId(externalId);
|
||||
if (!session) session = await memory.createSession(externalId);
|
||||
|
||||
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 semanticEpisodes = await getSemanticEpisodes(userMessage, session.id, recentIds);
|
||||
|
||||
@@ -176,7 +178,6 @@ async function chatStream(externalId, userMessage, onChunk, options = {}) {
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[orchestration] Failed to parse inference SSE event:', raw, err.message);
|
||||
throw err; // add this temporarily
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user