fix: grade None provider completions as empty answers instead of crashing - #44
Merged
Conversation
…hing Found by the first live multi-model pilot: gemini-2.5-pro returned a response whose message content was None (providers do this on safety blocks, thinking-only responses, or truncation). ModelGeneration.text carried the None into parse_artifact -> strip_code_fences, which crashed the whole run with AttributeError. An empty completion is a model output, not a harness fault: normalize to "" at the extraction point so the test grades as an empty answer (score 0) and the run continues. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
What
First real multi-model pilot run (gemini-2.5-pro + flash on the hardened dataset) crashed with:
litellm can hand back a choice whose
message.contentisNone— providers do this on safety blocks, thinking-only responses, or truncation.ModelGeneration.textcarried theNoneintoparse_artifact, killing the entire run on one bad completion.Fix
Normalize at the single extraction point in
ModelInterface.generate_with_metadata:content or "". An empty completion is a model output, not a harness fault, so it should grade as an empty answer (score 0 for that test) and let the run continue. This also composes withrun.continue_on_errorfor the remaining per-test failure modes.Includes a regression test with a mocked
None-content response.🤖 Generated with Claude Code