fix: resolve typing hang, intent detector reversed .test() bugs, and 'now' false positive
- Add missing clearInterval(typingInterval) in intent bypass early return path - Fix intent-detector category detection: pattern.test(regex) → regex.test(trimmed) - Fix short-answer patterns: same reversed .test() bug - Prevent 'now' being matched as 'no' by adding \b word boundary to greeting regex - Also tighten other greeting patterns with $ anchor where appropriate
This commit is contained in:
@@ -1256,14 +1256,14 @@ export async function initBot(config, api, tools, skills, agents) {
|
||||
try {
|
||||
// ── Intent detection: bypass AI for simple messages ──
|
||||
const intent = detectIntent(text);
|
||||
if (intent && intent.bypassAI) {
|
||||
logger.info(`🎯 Intent: ${intent.type} — bypassing AI`);
|
||||
const reply = intent.response || 'Got it.';
|
||||
await queueRequest(key, text, async () => {
|
||||
await sendFormatted(ctx, reply);
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (intent && intent.bypassAI) {
|
||||
logger.info(`🎯 Intent: ${intent.type} — bypassing AI`);
|
||||
clearInterval(typingInterval);
|
||||
const reply = intent.response || 'Got it.';
|
||||
await sendFormatted(ctx, reply);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// ── Load conversation history for this chat ──
|
||||
const chatKey = conversation._key(ctx.chat.id, ctx.message?.message_thread_id);
|
||||
|
||||
Reference in New Issue
Block a user