From 8b1395a90c48f26064768e40020a195fa9072275 Mon Sep 17 00:00:00 2001 From: martbost Date: Tue, 20 Oct 2026 05:57:31 -0500 Subject: [PATCH] Chatbot: replies never carry an em dash (scrubbed to a comma) Co-Authored-By: Claude Opus 5.5 --- chatbot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chatbot.js b/chatbot.js index 6f281ca..5058a36 100644 --- a/chatbot.js +++ b/chatbot.js @@ -325,7 +325,9 @@ function askAI(message, historyText, kbBlock) { } const UNSURE_RE = /(not sure|do not know|don't know|cannot help|can't help|unable to help|no way for me|i (can|could) not (see|check|look)|contact support|reach support|support (ticket|desk)|\/support\b|my#help)/i; -async function answer(message, historyText) { +// every reply leaves without em dashes (Marty's voice rule; the model slips one in now and then, 2026-10-20) +async function answer(message, historyText) { const r = await answerRaw(message, historyText); if (r && typeof r.reply === 'string') r.reply = r.reply.replace(/\s*\u2014\s*/g, ', '); return r; } +async function answerRaw(message, historyText) { const msg = String(message || '').trim(); if (!msg) return { error: 'Say something first.' }; // fast path: the knowledge base's instant answers (seeded from CANNED); the in-code list only if the KB store is down