mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
coach: keep cancelled-turn markers out of summary and fact folds
The rolling-summary and fact-extraction workers read message bodies directly, so an empty cancelled marker would ride their prompts as a blank assistant line. Skip empty bodies in both folds. Refs #781
This commit is contained in:
1 parent
a1b1617d0f
commit
ce6364f265
2 files changed
+6
No files matched your search
@@ -182,6 +182,9 @@ export async function refreshConversationSummary(
|
||||
// fail-closed like every other decrypt in the Coach stack.
|
||||
return [];
|
||||
}
|
||||
// #781 — skip empty bodies: a cancelled-turn marker (an empty
|
||||
// assistant row closing an aborted turn) carries no content to fold.
|
||||
if (!content.trim()) return [];
|
||||
return [{ role: m.role === "assistant" ? "assistant" : "user", content }];
|
||||
});
|
||||
|
||||
|
||||
@@ -255,6 +255,9 @@ async function loadRecentTurns(
|
||||
for (const m of [...row.messages].reverse()) {
|
||||
const content = decryptOrNull(m.encryptedContent);
|
||||
if (content === null) continue;
|
||||
// #781 — skip empty bodies: a cancelled-turn marker (an empty assistant
|
||||
// row closing an aborted turn) carries nothing to extract from.
|
||||
if (!content.trim()) continue;
|
||||
turns.push({ role: m.role, content });
|
||||
}
|
||||
return turns;
|
||||
|
||||
Reference in new issue
Block a user