fix(api): return float zero after async reward timeout - #1541
Conversation
AsyncRewardWrapper returned an integer zero when reward computation timed out, despite declaring a float result. The v1 OpenAI proxy only accepts dictionary or float rewards, so the fallback could raise ValueError instead of recording a zero reward. Return 0.0 from both wrapper-owned fallback paths and strengthen the existing timeout tests to verify the result type. Signed-off-by: Bo Yang <yb550079@antgroup.com>
There was a problem hiding this comment.
Code Review
The pull request updates the return values in AsyncRewardWrapper from integer 0 to float 0.0 to align with the declared float return type. It also updates the corresponding unit tests to verify that the returned value is of type float and equals 0.0. I have no feedback to provide as the changes are correct and consistent.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
This pull request has been automatically marked as stale because it has not had recent activity within the last 14 days. Please add a comment or push new commits to keep it active. Thank you for your contribution! |
Description
AsyncRewardWrapper.__call__declares afloatresult, but itswrapper-owned timeout fallbacks return the integer
0. This can be rejectedby the v1 OpenAI proxy workflow; v2 happens to normalize numeric rewards,
but switching controller versions is not a drop-in fix and v1 remains the
default.
Return
0.0from both fallback paths and strengthen the existing timeouttests to verify the result type. Successful user reward values are unchanged.
Related Issue
No issue filed.
Type of Change
Checklist
Contributing Guide
pre-commit run --all-files)main/review-pr/create-prBreaking Change Details (if applicable):
Not applicable.
Additional Context
Validation:
python -m pytest -q tests/test_async_reward_wrapper.py— 15 passedSKIP=generate-cli-docs pre-commit run --all-files