diff --git a/scripts/support-chat/verify-stage.cjs b/scripts/support-chat/verify-stage.cjs index df74f274..f4a957e3 100644 --- a/scripts/support-chat/verify-stage.cjs +++ b/scripts/support-chat/verify-stage.cjs @@ -21,10 +21,11 @@ async function check(name, body, expected, token, test=()=>true){ for(const field of ['userId','history','context','sessionId'])await check('reject '+field,{message:'سلام',[field]:ids[1]},400); await Promise.all(ids.map((id,i)=>check('wallet isolation '+i,{message:'کیف پول',scope:'wallet'},201,jwt.sign({sub:id}),d=>d.answer.includes(i?'222':'111')&&!d.answer.includes(i?'111':'222')))); await check('guest public real model',{message:'مکمل سگ کنینا'},201,null,d=>typeof d.answer==='string'&&!/provider|hermes|api.key/i.test(d.answer)); - await check('finglish dog query allowed',{message:'Sagam qaza nemikhore chizi darin?'},201,null,d=>typeof d.answer==='string'&&d.answer.length>10); await new Promise(resolve=>setTimeout(resolve,61000)); + await check('finglish dog query allowed',{message:'Sagam qaza nemikhore chizi darin?'},201,null,d=>typeof d.answer==='string'&&d.answer.length>10); await check('football answered off-topic politely',{message:'فوتبال سگ نتیجه چی شد؟'},201,null,d=>d.answer.includes('حیوانات خانگی')||d.answer.includes('کنینا')); await check('URL denied',{message:'مکمل سگ https://example.com'},201,null,d=>d.answer.includes('پیوند')||d.answer.includes('فقط درباره')); + console.log('LIVE_STAGE_CHECKS_PASSED',count); }finally{await p.user.deleteMany({where:{id:{in:ids}}});await p.$disconnect();} })().catch(()=>{console.error('LIVE_STAGE_CHECK_FAILED (details suppressed)');process.exit(1)});