fixed token count reading
This commit is contained in:
@@ -317,6 +317,7 @@ async function chatStream(externalId, userMessage, onChunk, options = {}) {
|
||||
console.log("[orchestration] final streamed text length:", fullText.length);
|
||||
|
||||
if (fullText.trim()) {
|
||||
console.log('[chat] tokenCount before save:', tokenCount);
|
||||
await memory.createEpisode(session.id, userMessage, fullText, tokenCount, session.project_id ?? null);
|
||||
const allEpisodes = await memory.getRecentEpisodes(session.id, 9999);
|
||||
triggerSummary(session, allEpisodes);
|
||||
|
||||
Reference in New Issue
Block a user