Files
João MouraandClaude Opus 5.5 441ea7fc02 fix(cli): count a crewai eval run that exits with an error as run_failed (#9227)
* fix(cli): count a crewai eval run that exits with an error as run_failed

When the run `crewai eval` starts exits with an error (a JSON crew, a
declarative flow or an agent whose run fails), the SystemExit went straight
through the command: no stop was counted and, with nobody watching, the
error stayed in .crewai/last_run.log. The command now treats it as the run
it is: graded when it was traced, and otherwise counted as
eval_stopped:run_failed, with the log's last lines and a sentence that says
the run failed instead of the three-way guess untraced_after_run gives.
Clean exits and Ctrl-C (130) go through as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cli): exit 1 after grading a crewai eval run that failed

A run that exits with an error and was still traced is graded, by the
command or on the run app's screen, but the command then exited by the
gate alone, so a failed run with a passing grade, or one the app graded
(its marker returned no run), exited 0. It now exits 1 after the verdict
whenever the run failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 20:35:21 -03:00
..