@@ -136,9 +136,13 @@ const countTaskStatusesLight = (
136136 if ( statusStats ) {
137137 const childStatusCounts =
138138 convertExecutionStatsToStatusCounts ( statusStats ) ;
139- const aggregateStatus = getRunStatus ( childStatusCounts ) ;
140- const mappedStatus = mapStatus ( aggregateStatus ) ;
141- statusCounts [ mappedStatus as keyof TaskStatusCounts ] ++ ;
139+ statusCounts . succeeded += childStatusCounts . succeeded ;
140+ statusCounts . failed += childStatusCounts . failed ;
141+ statusCounts . running += childStatusCounts . running ;
142+ statusCounts . pending += childStatusCounts . pending ;
143+ statusCounts . waiting += childStatusCounts . waiting ;
144+ statusCounts . skipped += childStatusCounts . skipped ;
145+ statusCounts . cancelled += childStatusCounts . cancelled ;
142146 } else {
143147 // If no status stats, assume waiting, likely we may receive none at all
144148 statusCounts . waiting ++ ;
@@ -266,10 +270,15 @@ export const countTaskStatuses = (
266270 if ( statusStats ) {
267271 const childStatusCounts =
268272 convertExecutionStatsToStatusCounts ( statusStats ) ;
269- const aggregateStatus = getRunStatus ( childStatusCounts ) ;
270- const mappedStatus = mapStatus ( aggregateStatus ) ;
271- statusCounts [ mappedStatus as keyof TaskStatusCounts ] ++ ;
273+ statusCounts . succeeded += childStatusCounts . succeeded ;
274+ statusCounts . failed += childStatusCounts . failed ;
275+ statusCounts . running += childStatusCounts . running ;
276+ statusCounts . pending += childStatusCounts . pending ;
277+ statusCounts . waiting += childStatusCounts . waiting ;
278+ statusCounts . skipped += childStatusCounts . skipped ;
279+ statusCounts . cancelled += childStatusCounts . cancelled ;
272280 } else {
281+ // No stats at all: count as a single waiting unit (we can't infer nested size).
273282 statusCounts . waiting ++ ;
274283 }
275284 } ) ;
@@ -287,6 +296,30 @@ export const countTaskStatuses = (
287296 return { ...statusCounts , total } ;
288297} ;
289298
299+ export const sumExecutionStatusStatsFromChildStats = (
300+ details : GetExecutionInfoResponse ,
301+ stateData : GetGraphExecutionStateResponse ,
302+ ) : Record < string , number > => {
303+ const totals : Record < string , number > = { } ;
304+
305+ if ( ! details . child_task_execution_ids || ! stateData . child_execution_status_stats ) {
306+ return totals ;
307+ }
308+
309+ Object . values ( details . child_task_execution_ids ) . forEach ( ( executionId ) => {
310+ const executionIdStr = String ( executionId ) ;
311+ const statusStats = stateData . child_execution_status_stats [ executionIdStr ] ;
312+ if ( ! statusStats ) return ;
313+
314+ Object . entries ( statusStats ) . forEach ( ( [ status , count ] ) => {
315+ if ( ! count ) return ;
316+ totals [ status ] = ( totals [ status ] ?? 0 ) + count ;
317+ } ) ;
318+ } ) ;
319+
320+ return totals ;
321+ } ;
322+
290323export const getExecutionArtifacts = async (
291324 executionId : string ,
292325 backendUrl : string ,
0 commit comments