summaryrefslogtreecommitdiff
path: root/web/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app.js')
-rw-r--r--web/app.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/web/app.js b/web/app.js
index fc6864c..2f5aacf 100644
--- a/web/app.js
+++ b/web/app.js
@@ -665,7 +665,14 @@ export function computeExecutionStats(executions) {
for (const e of executions) {
const outcome = e.state || 'unknown';
byOutcome[outcome] = (byOutcome[outcome] || 0) + 1;
- if (outcome === 'completed') completed++;
+ // Executions carry the task state machine's uppercase values (see
+ // internal/executor.handleRunResult): a top-level task (no parent) that
+ // succeeds lands its execution at READY, not COMPLETED — COMPLETED is
+ // only set for subtask executions. Both represent a successful run from
+ // the executor's perspective; only the human/chatbot accept step (a
+ // separate, later transition) turns READY into COMPLETED.
+ const normalized = outcome.toUpperCase();
+ if (normalized === 'COMPLETED' || normalized === 'READY') completed++;
totalCost += e.cost_usd || 0;
if (e.duration_ms != null) {
durationSum += e.duration_ms;