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:
Kilo
2026-05-06 17:38:24 +00:00
Unverified
parent 994c5481bf
commit 20d5cc08fc
3 changed files with 30 additions and 22 deletions

View File

@@ -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);