Repository navigation
Python: reject non-boolean passed values when score is present in evaluator dict - #10176
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 2 commits intoNov 10, 2026
Conversation
…luator dict (Fixes microsoft#10165)
Dhruv Shaswat (Dhruv-Sh-git)
temporarily deployed
to
github-app-auth
November 8, 2026 13:14 — with
GitHub Actions
Inactive
Dhruv Shaswat (Dhruv-Sh-git)
temporarily deployed
to
github-app-auth
November 8, 2026 13:14 — with
GitHub Actions
Inactive
Dhruv Shaswat (Dhruv-Sh-git)
temporarily deployed
to
github-app-auth
November 8, 2026 13:15 — with
GitHub Actions
Inactive
Dhruv Shaswat (Dhruv-Sh-git)
temporarily deployed
to
github-app-auth
November 8, 2026 13:16 — with
GitHub Actions
Inactive
Dhruv Shaswat (Dhruv-Sh-git)
temporarily deployed
to
github-app-auth
November 9, 2026 10:28 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Nov 10, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10165.
Motivation & Context
When a function evaluator returned a dictionary containing both
scoreand a non-booleanpassedvalue (such as"passed": "false"),_coerce_result()directly coercedpassed = bool(d["passed"]).Since non-empty strings are truthy in Python,
"false"evaluated toTrue, potentially allowing failing evaluations to silently pass CI quality gates.Description
_evaluation.py::_coerce_result, moved theisinstance(d["passed"], (bool, int))validation to run whenever"passed"is present in the dictionary.TypeErroracross both scored and unscored branches.Nonevalues forpassedwhenscoreis present.TrueandFalse) remain supported.Validation
uv run pytest packages/core/tests/core/test_local_eval.py— 97 passed.uv run pytest packages/core/tests) — 9,499 passed, 0 failures.uv run poe syntax -P core— Passed.uv run poe pyright -P core— 0 errors.AI Assistance
AI assistance was used to investigate, develop, and test this fix. The changes were reviewed and verified locally.