diff --git a/e2e/work-checkpoints.playwright.ts b/e2e/work-checkpoints.playwright.ts index e2cdeaf..a3c057f 100644 --- a/e2e/work-checkpoints.playwright.ts +++ b/e2e/work-checkpoints.playwright.ts @@ -33,9 +33,11 @@ async function waitForFailureNotice(request:any,seed:any){ if(!response.ok())return false const current=await response.json() const children=current.runs.filter((r:any)=>r.kind==='subagent') - const notices=current.messages.filter((m:any)=>m.role==='system'&&m.parts?.some((p:any)=>p.type==='text'&&p.text?.includes('后台子代理「'))) + const noticeText=current.messages.filter((m:any)=>m.role==='system').flatMap((m:any)=>m.parts??[]) + .filter((p:any)=>p.type==='text').map((p:any)=>p.text??'').join('\n') + const noticeCount=(noticeText.match(/后台子代理「/g)??[]).length const noticeRuns=current.runs.filter((r:any)=>r.kind==='conversation'&&r.id!==seed.sendRunId) - return children.length>0&¬ices.length>=children.length&¬iceRuns.length>=children.length&& + return children.length>0&¬iceCount>=children.length&¬iceRuns.length>0&& noticeRuns.every((r:any)=>['completed','failed','interrupted'].includes(r.status)) }).toBe(true) }