test(chat): widen intent-router timeout fallback window
Memind CI / Test, build, and release guards (push) Successful in 5m32s
Memind CI / Test, build, and release guards (push) Successful in 5m32s
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 <cursoragent@cursor.com>
This commit is contained in:
@@ -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 () => {
|
test('createChatIntentRouter timeout fallback prefers agent even when policy requests direct_chat', async () => {
|
||||||
const router = createChatIntentRouter({
|
const router = createChatIntentRouter({
|
||||||
enabled: true,
|
enabled: true,
|
||||||
timeoutMs: 5,
|
timeoutMs: 40,
|
||||||
fallbackRoute: CHAT_INTENT_ROUTE.DIRECT_CHAT,
|
fallbackRoute: CHAT_INTENT_ROUTE.DIRECT_CHAT,
|
||||||
llmProviderService: {
|
llmProviderService: {
|
||||||
async createChatCompletion() {
|
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":""}' };
|
return { ok: true, reply: '{"route":"direct_chat","confidence":0.9,"reason":"x","suggested_skill":null,"agent_brief":""}' };
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user