Skip to content

return last result if retries exhausted#782

Merged
mikasenghaas merged 3 commits intomainfrom
dont-reraise
Jan 25, 2026
Merged

return last result if retries exhausted#782
mikasenghaas merged 3 commits intomainfrom
dont-reraise

Conversation

@mikasenghaas
Copy link
Member

@mikasenghaas mikasenghaas commented Jan 24, 2026

Description

previously, when retries are exhausted, we raise and crash an eval run. now we return the final state (with the last error in the state), mirroring the behavior when not setting retries

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes


Note

Implements non-crashing retry exhaustion behavior and aligns tests.

  • Update verifiers/utils/async_utils.py maybe_retry to store last_result and use tenacity's retry_error_callback to return it when retries are exhausted; add error-level log and keep raising only for configured error types during retries
  • Wrap SimpleEnvironment.rollout in try/except vf.Error to record errors in state instead of raising
  • Revise retry tests in tests/test_environment.py:
    • Retry succeeds after transient retryable errors
    • Non-retryable errors are not retried and are captured in state
    • After max retries, error persists in state rather than raising

Written by Cursor Bugbot for commit 34040ee. This will update automatically on new commits. Configure here.

@mikasenghaas mikasenghaas marked this pull request as ready for review January 25, 2026 11:49
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@mikasenghaas mikasenghaas merged commit 3ed6cdf into main Jan 25, 2026
6 checks passed
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.

2 participants