Count batched failure notices in browser validation

Why: One system reminder can contain multiple failed child notices, so the browser test must wait for the whole batch rather than one message per child.

Evidence: The first post-merge HTTP/Playwright run failed only at this false one-to-one assumption; all six task-owned browser cases passed after counting notice entries in the persisted reminder.

Impact: Test-only correction; no production UI behavior change.

Refs: U3 r0.4 Task 6 review closure
This commit is contained in:
2026-10-14 04:06:22 +00:00
parent 139f2ce654
commit c9d5acf089
+4 -2
View File
@@ -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&&notices.length>=children.length&&noticeRuns.length>=children.length&&
return children.length>0&&noticeCount>=children.length&&noticeRuns.length>0&&
noticeRuns.every((r:any)=>['completed','failed','interrupted'].includes(r.status))
}).toBe(true)
}