Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
1489b63 to
52027f1
Compare
ca2793f to
207c76a
Compare
207c76a to
5613767
Compare
| while messages_for_request and messages_for_request[-1].role == "assistant": | ||
| messages_for_request.pop() | ||
|
|
||
| messages_payload = [message.model_dump() for message in messages_for_request] |
There was a problem hiding this comment.
Bug: Empty Payload After Message Filtering
Missing validation after filtering trailing assistant messages. If all messages in row.messages are assistant messages and drop_trailing_assistant_messages=True, the messages_for_request list becomes empty, resulting in an empty messages_payload being sent to the LLM API. This will fail with an API error rather than being caught by the existing validation on line 42-43. A check should be added after the filtering loop (lines 47-49) to ensure messages_for_request is not empty before proceeding.
Note
SingleTurnRolloutProcessor now optionally trims trailing assistant messages (on by default), with new unit tests and simplified pytest examples removing dataset adapters.
SingleTurnRolloutProcessor: add__init__(drop_trailing_assistant_messages=True)and strip trailingassistantmessages before LLM call; use trimmed messages when building final conversation.tests/pytest/test_single_turn_rollout_processor.pycovering default drop and opt-out behaviors.tests/pytest/gsm8k/test_pytest_math_example.pyusing direct dataset and simple digit check.dataset_adapterusage fromtest_pytest_math_format_length.pyandtest_pytest_word_count_example.py.tests/pytest/gsm8k/requirements.txtwitheval-protocol.Written by Cursor Bugbot for commit 5613767. This will update automatically on new commits. Configure here.