adding response quality validation for retry#344
Open
morgendave wants to merge 3 commits intoeval-protocol:mainfrom
Open
adding response quality validation for retry#344morgendave wants to merge 3 commits intoeval-protocol:mainfrom
morgendave wants to merge 3 commits intoeval-protocol:mainfrom
Conversation
mayinghan
reviewed
Nov 25, 2025
tests/test_retry_mechanism.py
Outdated
| mode="pointwise", | ||
| exception_handler_config=ExceptionHandlerConfig( | ||
| backoff_config=BackoffConfig(max_tries=3, base_delay=0.1, strategy="constant"), | ||
| exception_backoff_overrides={ |
Collaborator
There was a problem hiding this comment.
will the default backoff retry logic not fit in this case? is it necessary to override it for quality error?
Collaborator
Author
There was a problem hiding this comment.
Default will backoff, but I imagine we don't want to backoff in quality case. Though if we unify them the code complexity will be much smaller
dphuang2
reviewed
Nov 25, 2025
Comment on lines
+371
to
+379
| if config.post_processor is not None: | ||
| try: | ||
| config.post_processor.process(result) | ||
| except ResponseQualityError as quality_error: | ||
| # Re-raise ResponseQualityError to trigger retry logic | ||
| raise quality_error | ||
| except Exception as post_process_error: | ||
| # Wrap unexpected post-processor errors in ResponseQualityError | ||
| raise ResponseQualityError(f"Post-processor failed: {post_process_error}") from post_process_error |
Collaborator
There was a problem hiding this comment.
so all errors are ResponseQualityError if a post_processor is set?
Collaborator
Author
There was a problem hiding this comment.
My bad, let me change this
dphuang2
reviewed
Nov 25, 2025
Collaborator
dphuang2
left a comment
There was a problem hiding this comment.
can we make sure this works with remote rollout processor?
3d209f5 to
2eeb478
Compare
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.
name: Adding response quality validation for retry
about: response quality validation for retryable error
title: "Adding response quality validation for retry"
labels: ''
assignees: ''
Description
For bad rollouts that makes the final output bad which has quality issues, eg, gibberish, repetitions, etc, fail it with this plugin with customizations. Default no-op
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Test with current tests and added decorator tests
Checklist:
black .,isort .,flake8 .)Screenshots (if applicable)
If applicable, add screenshots to help showcase your changes.
Additional context
Add any other context about the PR here.
Note
Introduces
RESPONSE_QUALITY_ERROR(103) and a post-processing hook to validate rollout results and trigger retries; updates retry config and adds tests.ResponseQualityError(code103) ineval_protocol/exceptions.pyand map inSTATUS_CODE_TO_EXCEPTION.Status.CodewithRESPONSE_QUALITY_ERRORand addStatus.response_quality_error()ineval_protocol/models.py.eval_protocol/pytest/rollout_result_post_processor.pywithRolloutResultPostProcessorandNoOpRolloutResultPostProcessor(exported ineval_protocol/pytest/__init__.py).post_processortoRolloutProcessorConfigineval_protocol/pytest/types.py.evaluation_test_utils.rollout_processor_with_retry(); raisingResponseQualityErrortriggers backoff retries.ResponseQualityErrorinDEFAULT_RETRYABLE_EXCEPTIONSand minor typing/format adjustments ineval_protocol/pytest/exception_config.py.tests/test_exception_config.pycovering backoff decorator and inclusion ofResponseQualityError.tests/test_exceptions.pyfor code103mapping and behavior.tests/test_retry_mechanism.pywith scenarios verifying retry onResponseQualityError.Written by Cursor Bugbot for commit 2eeb478. This will update automatically on new commits. Configure here.