Persist retry diagnostics in rollout outputs#1637
Open
RitwijParmar wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 17030c0. Configure here.
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.

Summary
This adds persisted retry diagnostics for eval rollouts when
max_retriesis used. Today retries are visible in logs, but savedresults.jsonldoes not show whether a rollout needed retries, which retryable error triggered them, or whether retries were exhausted. That makes it hard to debug transient provider and sandbox instability after the run has finished.The PR adds a
retryblock to rollout state and saved output only when a retry actually happens. The block records attempts, retry count, exhaustion status, elapsed retry time, and per-attempt error summaries. It works for both single rollout and grouped rollout retry paths.Related to #1607 and the retry visibility part of #1563.
What changed
maybe_retryfor exception-based failures and retryablestate["error"]failuresretryfield throughstate_to_outputRetryEventandRetryDatatyped output contractsTests
uv run --python 3.12 pytest tests/test_environment.py::TestMaybeRetry tests/test_save_utils.py::TestSavingResults::test_states_to_outputs_includes_retry_metadata -quv run --python 3.12 ruff check verifiers/utils/async_utils.py verifiers/utils/save_utils.py verifiers/types.py tests/test_environment.py tests/test_save_utils.pyuv run --python 3.12 python -m py_compile verifiers/utils/async_utils.py verifiers/utils/save_utils.py verifiers/types.py tests/test_environment.py tests/test_save_utils.pygit diff --checkNote: the first local pytest attempt under Python 3.13 hit a macOS system policy denial while importing the pandas native extension. I reran the focused tests under Python 3.12, which is part of the project CI matrix.
Note
Low Risk
Adds optional serialized metadata on an existing retry path;
state_to_outputnow rejects non-JSON-serializableretryvalues.Overview
When evals use
--max-retries, saved rollout outputs inresults.jsonlnow include aretryblock whenever a rollout actually retried, so transient infra failures are visible after the run—not only in logs.maybe_retryrecords per-attempt error summaries (including retryablestate["error"]and grouped rollouts, withstate_indexwhen one member of a group triggers retry), then attaches a summary with attempts, exhaustion, elapsed time, and events.state_to_outputpersistsretryintoRolloutOutput, with newRetryData/RetryEventtypes and docs/skill guidance for post-run debugging.Reviewed by Cursor Bugbot for commit 129847c. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Persist retry diagnostics in rollout outputs
RetryDataandRetryEventTypedDicts in verifiers/types.py to represent retry metadata, including attempt count, exhaustion status, elapsed time, and per-attempt error summaries.maybe_retryin async_utils.py to track retry lifecycle and attach aretryblock to returned states on both successful retries and exhaustion; for list results, each event records thestate_indexof the triggering error.state_to_outputin save_utils.py to pass through theretryfield from state to the serializedRolloutOutput, raisingValueErrorif not JSON-serializable.Macroscope summarized 129847c.