fix(v1): a raising group reward must not discard the group's completed traces#2018
fix(v1): a raising group reward must not discard the group's completed traces#2018dumko2001 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62449b046a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| rollout.phase = Phase.DONE | ||
| for trace in traces: | ||
| if on_complete is not None: | ||
| await on_complete(trace) |
There was a problem hiding this comment.
Mark failed group scores before completing traces
When a @group_reward raises or group scoring is cancelled, this finally still calls on_complete with traces that have no trace.errors and may be missing the group reward. In the eval path on_complete appends those rows to traces.jsonl, and resume.load() keeps any saved group-scored task whose rows have no errors and the expected rollout count, so a failed group-scoring run can later resume as “already complete” with unscored/partial rewards. Please record the group-scoring failure on each trace or avoid completing/persisting them as clean results when score_group does not finish successfully.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 130dd65. Configure here.
…d traces Episode.run marked each rollout Phase.DONE and ran on_complete only after score_group returned. If score_group raised, the finally block was skipped and every completed trace in the group was lost, not just the group score. Wrap score_group in try/finally. If it raises, every rollout is still marked Phase.DONE, the scoring failure is recorded as an Error on each trace, and every on_complete callback runs before the exception re-raises. The caller still sees the scoring failure, but the traces are persisted for debugging and resume. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
cc9186e to
cb0b5ef
Compare

Description
Episode.runmarked each rolloutPhase.DONEand ranon_completeonly afterscore_groupreturned. Ifscore_groupraised, thefinallyblock was skipped and every completed trace in the group was lost, not just the group score.This change wraps
score_groupintry/finally. If it raises, every rollout is still markedPhase.DONE, the scoring failure is recorded as anErroron each trace, and everyon_completecallback runs before the exception re-raises. The caller still sees the scoring failure, but the traces are persisted for debugging and resume.Type of Change
Testing
uv run pytestlocally.uv run pytest tests/v1/test_scoring.py -qand the fulluv run pytest tests/v1 -m 'not e2e'pass. A manual reproduction confirms the exception still propagates,on_completeruns for every trace, and rollouts reachPhase.DONE.Checklist
Additional Notes
PrimeIntellect-ai/verifiers:main(commit9b01a8172).docs/v1/evaluation.mdand the resume reference already describe group-scored tasks as being rerun as a whole group when incomplete. Recording the scoring error on each trace makes a failed group-score resume-safe.AGENTS.md, no unit tests were added.