fix: keep notification summaries in plain text

- Force notification summaries to avoid markdown formatting
- Normalize generated notification text before system display
- Cover plain-text notification formatting with tests
This commit is contained in:
Bohdan Triapitsyn
2026-04-06 17:40:20 +03:00
parent 9254ec0783
commit f884919165
5 changed files with 40 additions and 4 deletions
@@ -138,7 +138,7 @@ export const createNotificationTemplateRuntime = (deps) => {
if (!text || typeof text !== 'string' || text.trim().length === 0) return text;
try {
const prompt = `Summarize the following text in approximately ${targetLength} characters. Be concise and capture the key point. Output ONLY the summary text, nothing else.\n\nText:\n${text}`;
const prompt = `Summarize the following text in approximately ${targetLength} characters. Be concise and capture the key point. Output plain text only. Do not use markdown, bullets, headings, code fences, backticks, or quotes. Output only the summary text.\n\nText:\n${text}`;
const completionTimeout = createTimeoutSignal(15000);
let response;