Skip to content

fix: catch Exception instead of BaseException in MathRubric.verify_response#1062

Open
dieutx wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
dieutx:fix/math-rubric-base-exception
Open

fix: catch Exception instead of BaseException in MathRubric.verify_response#1062
dieutx wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
dieutx:fix/math-rubric-base-exception

Conversation

@dieutx
Copy link
Copy Markdown

@dieutx dieutx commented Mar 24, 2026

Problem

verify_response() in verifiers/rubrics/math_rubric.py (line 46) catches BaseException, which intercepts KeyboardInterrupt, SystemExit, and GeneratorExit in addition to regular exceptions. This makes worker processes that are running math verification effectively unkillable via Ctrl+C or SIGTERM — the signal is silently swallowed and the function returns 0.0 as if verification simply failed.

Fix

Replace except BaseException with except Exception. This still catches all regular exceptions (parsing errors, timeouts, value errors, etc.) but allows the three critical BaseException subclasses 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_response from catching BaseException and instead catches only Exception, so KeyboardInterrupt/SystemExit/GeneratorExit can 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant