Skip to content

fix(v1): a raising group reward must not discard the group's completed traces#2018

Open
dumko2001 wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
dumko2001:devin/fix5
Open

fix(v1): a raising group reward must not discard the group's completed traces#2018
dumko2001 wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
dumko2001:devin/fix5

Conversation

@dumko2001

@dumko2001 dumko2001 commented Jul 15, 2026

Copy link
Copy Markdown

Description

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.

This change wraps 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.

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

uv run pytest tests/v1/test_scoring.py -q and the full uv run pytest tests/v1 -m 'not e2e' pass. A manual reproduction confirms the exception still propagates, on_complete runs for every trace, and rollouts reach Phase.DONE.

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

  • Rebased onto the current PrimeIntellect-ai/verifiers:main (commit 9b01a8172).
  • No documentation, recipe, config, or hardware-support changes were required: docs/v1/evaluation.md and 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.
  • Per AGENTS.md, no unit tests were added.

Comment thread verifiers/v1/episode.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread verifiers/v1/episode.py
rollout.phase = Phase.DONE
for trace in traces:
if on_complete is not None:
await on_complete(trace)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Fix All in Cursor

❌ 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.

Comment thread verifiers/v1/episode.py Outdated
…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>
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