Skip to content

Commit 7541104

Browse files
committed
fix(web-evals): fix running task count to match spinner visibility
- Update running task filter to check tokenUsage like TaskStatus component - Add tokenUsage and usageUpdatedAt to stats useMemo dependencies
1 parent d928b80 commit 7541104

File tree

1 file changed

+11
-3
lines changed
  • apps/web-evals/src/app/runs/[id]

1 file changed

+11
-3
lines changed

apps/web-evals/src/app/runs/[id]/run.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,15 @@ export function Run({ run }: { run: Run }) {
6868

6969
const passed = tasks.filter((t) => t.passed === true).length
7070
const failed = tasks.filter((t) => t.passed === false).length
71-
const running = tasks.filter((t) => t.startedAt && !t.finishedAt).length
72-
const pending = tasks.filter((t) => !t.startedAt && !t.finishedAt).length
71+
// Count running tasks exactly like TaskStatus shows spinner:
72+
// - passed is not true and not false (null/undefined)
73+
// - AND has activity (startedAt or tokenUsage)
74+
const running = tasks.filter(
75+
(t) => t.passed !== true && t.passed !== false && (t.startedAt || tokenUsage.get(t.id)),
76+
).length
77+
const pending = tasks.filter(
78+
(t) => t.passed !== true && t.passed !== false && !t.startedAt && !tokenUsage.get(t.id),
79+
).length
7380
const total = tasks.length
7481
const completed = passed + failed
7582

@@ -117,7 +124,8 @@ export function Run({ run }: { run: Run }) {
117124
totalDuration,
118125
toolUsage,
119126
}
120-
}, [tasks, taskMetrics])
127+
// eslint-disable-next-line react-hooks/exhaustive-deps
128+
}, [tasks, taskMetrics, tokenUsage, usageUpdatedAt])
121129

122130
return (
123131
<>

0 commit comments

Comments
 (0)