From 43ae6097aaeb1f0cb816fc9dbd4579c48e66d95c Mon Sep 17 00:00:00 2001 From: Garrison Snelling Date: Fri, 17 Jul 2026 18:35:25 +0000 Subject: [PATCH] fix: don't count failing phase as completed in dax benchmark The script's phase() function emits BENCH_PHASE even for the failing phase (it prints timing before checking exit code). When there's an error, subtract 1 from phasesCompleted so e.g. E2B shows 6/7 instead of 7/7 when typecheck fails. --- src/sandbox/dax.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sandbox/dax.ts b/src/sandbox/dax.ts index 6f070f89..e1670ae4 100644 --- a/src/sandbox/dax.ts +++ b/src/sandbox/dax.ts @@ -194,7 +194,10 @@ if (result.error) { // Count completed phases const phaseKeys = ['prepare', 'cache_clear', 'bun_download', 'bun_unpack', 'clone', 'install', 'typecheck']; -const phasesCompleted = phaseKeys.filter(k => phases[k] !== undefined).length; +const rawPhasesCompleted = phaseKeys.filter(k => phases[k] !== undefined).length; +// The script's phase() function emits BENCH_PHASE even for the failing phase (it prints timing before checking exit code). +// When there's an error, the last phase that emitted a BENCH_PHASE line is the one that failed, so don't count it. +const phasesCompleted = benchError ? Math.max(0, rawPhasesCompleted - 1) : rawPhasesCompleted; // If no phases completed, the script didn't actually run (e.g. curl missing) if (phasesCompleted === 0 && !benchError) {