ExperimentRunner._assert_scores only checks the intersection of expected/actual dict keys, so a multi-metric expected_score passes even when other metrics silently produced no score
In ExperimentRunner._assert_scores (runner.py:155-163), when both expected and actual are dicts, the check only evaluates the intersection of keys and silently drops any expected key absent from actual — which happens whenever that metric's evaluator returned score=None ('not applicable', ordinary control flow in every LLM-judge evaluator) or raised (agent_evaluator.py:264-292 swallows the exception and never populates result.metrics for that metric_category). A multi-metric expected_score therefore passes as long as any one of its keys is present and clears its bar, even if every other named metric silently failed to produce a score at all — verified by direct reproduction against the repo's own test fixture. This is a distinct defect from the already-tracked #7575/#7578/#7587/#7588/#7603 family (which only covers a fully empty expected dict) and is not currently pinned by any test — the closest test, test_run_success_with_unknown_metric, only exercises a metric name that was never a real MetricCategory, not a real metric that legitimately scored None. Fix: change the dict/dict branch to fail when set(expected) - set(actual) is non-empty, matching the fail-closed principle the maintainers already accepted in PR #7578, and update test_run_success_with_unknown_metric's expected outcome accordingly (or add a MetricCategory validation step if unrecognized keys should instead raise).
Relation to #7575
This is the same function (ExperimentRunner._assert_scores, runner.py:155-163) but a different
branch and a different root cause from #7575, which is currently tracked by five open, unmerged
PRs (#7578, #7584, #7587, #7588, #7603) covering the case where expected_score is entirely empty.
None of those PRs touch the dict/dict intersection logic this issue is about: a multi-metric
expected_score where some keys are present in actual and pass, while others are silently
missing because that metric legitimately returned None or its evaluator raised. set(expected) - set(actual) is never checked. Filing separately so it doesn't get folded into or lost in the
existing PR race, since a fix for the empty-dict case doesn't touch this path at all.
Happy to open the PR.
Source: crewAIInc/crewAI