Skip to content

Commit 817b5cd

Browse files
jrvb-rlclaude
andauthored
fix(cli): show failure reason when benchmark job fails with no outcomes (#182)
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 <noreply@anthropic.com>
1 parent 6cc35a7 commit 817b5cd

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/commands/benchmark-job/summary.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ function printResultsTable(job: BenchmarkJob, extended: boolean = false): void {
151151
const outcomes = job.benchmark_outcomes || [];
152152

153153
if (outcomes.length === 0) {
154-
console.log(chalk.yellow("No benchmark outcomes found"));
154+
if (job.failure_reason) {
155+
console.log(chalk.red(`Job failed: ${job.failure_reason}`));
156+
} else {
157+
console.log(chalk.yellow("No benchmark outcomes found"));
158+
}
155159
return;
156160
}
157161

src/commands/benchmark-job/watch.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,11 @@ function printResultsTable(job: BenchmarkJob): void {
253253
const outcomes = job.benchmark_outcomes || [];
254254

255255
if (outcomes.length === 0) {
256-
console.log(chalk.yellow("No benchmark outcomes found"));
256+
if (job.failure_reason) {
257+
console.log(chalk.red(`Job failed: ${job.failure_reason}`));
258+
} else {
259+
console.log(chalk.yellow("No benchmark outcomes found"));
260+
}
257261
return;
258262
}
259263

@@ -478,7 +482,11 @@ export async function watchBenchmarkJob(id: string) {
478482
const totalElapsedStr = formatDuration(Date.now() - jobStartMs);
479483

480484
// Show completion message
481-
console.log(chalk.green.bold("Benchmark job completed!"));
485+
if (job.state === "failed") {
486+
console.log(chalk.red.bold("Benchmark job failed."));
487+
} else {
488+
console.log(chalk.green.bold("Benchmark job completed!"));
489+
}
482490
console.log(chalk.dim(`Total time: ${totalElapsedStr}`));
483491

484492
// Show final results (summary only)

0 commit comments

Comments
 (0)