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:
@@ -33,9 +33,11 @@ async function waitForFailureNotice(request:any,seed:any){
|
|||||||
if(!response.ok())return false
|
if(!response.ok())return false
|
||||||
const current=await response.json()
|
const current=await response.json()
|
||||||
const children=current.runs.filter((r:any)=>r.kind==='subagent')
|
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)
|
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))
|
noticeRuns.every((r:any)=>['completed','failed','interrupted'].includes(r.status))
|
||||||
}).toBe(true)
|
}).toBe(true)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user