From 36d3a91f8dc0c400f3515827f11a995030ee17a4 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 13 Aug 2026 16:15:16 +0800 Subject: [PATCH] test(chat): widen intent-router timeout fallback window CI failed on a 5ms/20ms race that let the LLM reply win before the timeout fallback. Give the abort path more slack so the guard stays deterministic. Co-authored-by: Cursor --- chat-intent-router.test.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chat-intent-router.test.mjs b/chat-intent-router.test.mjs index cd4be9c..071f746 100644 --- a/chat-intent-router.test.mjs +++ b/chat-intent-router.test.mjs @@ -1243,11 +1243,11 @@ test('createChatIntentRouter coerces LLM search route to web for realtime query' test('createChatIntentRouter timeout fallback prefers agent even when policy requests direct_chat', async () => { const router = createChatIntentRouter({ enabled: true, - timeoutMs: 5, + timeoutMs: 40, fallbackRoute: CHAT_INTENT_ROUTE.DIRECT_CHAT, llmProviderService: { async createChatCompletion() { - await new Promise((resolve) => setTimeout(resolve, 20)); + await new Promise((resolve) => setTimeout(resolve, 250)); return { ok: true, reply: '{"route":"direct_chat","confidence":0.9,"reason":"x","suggested_skill":null,"agent_brief":""}' }; }, },