Chatbot: replies never carry an em dash (scrubbed to a comma)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-20 05:57:38 -05:00
parent a736d68c30
commit 24814c9a41
+3 -1
View File
@@ -206,7 +206,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|\/help\b)/i; 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|\/help\b)/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(); const msg = String(message || '').trim();
if (!msg) return { error: 'Say something first.' }; 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 // fast path: the knowledge base's instant answers (seeded from CANNED); the in-code list only if the KB store is down