fix: catch Exception instead of BaseException in MathRubric.verify_response#1062
Open
dieutx wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
Open
fix: catch Exception instead of BaseException in MathRubric.verify_response#1062dieutx wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
dieutx wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
Conversation
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.
Problem
verify_response()inverifiers/rubrics/math_rubric.py(line 46) catchesBaseException, which interceptsKeyboardInterrupt,SystemExit, andGeneratorExitin addition to regular exceptions. This makes worker processes that are running math verification effectively unkillable viaCtrl+CorSIGTERM— the signal is silently swallowed and the function returns0.0as if verification simply failed.Fix
Replace
except BaseExceptionwithexcept Exception. This still catches all regular exceptions (parsing errors, timeouts, value errors, etc.) but allows the three criticalBaseExceptionsubclasses to propagate normally so processes can be interrupted and terminated as expected.Testing
Existing math rubric tests continue to pass (
pytest tests/ -k "math").Note
Low Risk
Low risk: a one-line change to exception handling that only affects how interruptions/termination signals propagate out of math verification workers.
Overview
Stops
verifiers/rubrics/math_rubric.py::verify_responsefrom catchingBaseExceptionand instead catches onlyException, soKeyboardInterrupt/SystemExit/GeneratorExitcan propagate rather than being silently converted into a failed verification score.Written by Cursor Bugbot for commit 625394f. This will update automatically on new commits. Configure here.