From bcd1356b01a80277e425dced84c5264f8a4bbb5b Mon Sep 17 00:00:00 2001 From: Rob von Behren Date: Wed, 25 Mar 2026 01:53:56 -0700 Subject: [PATCH] fix(cli): show failure reason when benchmark job fails with no outcomes When a benchmark job failed (e.g., scenario setup failure), the watch and summary commands showed a generic 'No benchmark outcomes found' message. Now displays the job failure_reason in red, and shows 'Benchmark job failed.' instead of 'completed!' for failed jobs. Co-Authored-By: Claude Opus 4.6 --- src/commands/benchmark-job/summary.ts | 6 +++++- src/commands/benchmark-job/watch.ts | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/commands/benchmark-job/summary.ts b/src/commands/benchmark-job/summary.ts index a144e3e..814e622 100644 --- a/src/commands/benchmark-job/summary.ts +++ b/src/commands/benchmark-job/summary.ts @@ -151,7 +151,11 @@ function printResultsTable(job: BenchmarkJob, extended: boolean = false): void { const outcomes = job.benchmark_outcomes || []; if (outcomes.length === 0) { - console.log(chalk.yellow("No benchmark outcomes found")); + if (job.failure_reason) { + console.log(chalk.red(`Job failed: ${job.failure_reason}`)); + } else { + console.log(chalk.yellow("No benchmark outcomes found")); + } return; } diff --git a/src/commands/benchmark-job/watch.ts b/src/commands/benchmark-job/watch.ts index fe00578..ea829fb 100644 --- a/src/commands/benchmark-job/watch.ts +++ b/src/commands/benchmark-job/watch.ts @@ -253,7 +253,11 @@ function printResultsTable(job: BenchmarkJob): void { const outcomes = job.benchmark_outcomes || []; if (outcomes.length === 0) { - console.log(chalk.yellow("No benchmark outcomes found")); + if (job.failure_reason) { + console.log(chalk.red(`Job failed: ${job.failure_reason}`)); + } else { + console.log(chalk.yellow("No benchmark outcomes found")); + } return; } @@ -478,7 +482,11 @@ export async function watchBenchmarkJob(id: string) { const totalElapsedStr = formatDuration(Date.now() - jobStartMs); // Show completion message - console.log(chalk.green.bold("Benchmark job completed!")); + if (job.state === "failed") { + console.log(chalk.red.bold("Benchmark job failed.")); + } else { + console.log(chalk.green.bold("Benchmark job completed!")); + } console.log(chalk.dim(`Total time: ${totalElapsedStr}`)); // Show final results (summary only)