Repository navigation
Open a new client per game in the Wordle GRPO script - #1560
Merged
Merged
Conversation
1 task done
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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 1f1a26a. Configure here.
Co-authored-by: burtenshaw <burtenshaw@users.noreply.github.com>
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
examples/wordle/grpo.pykeeps one client for the whole run, and the run (about 2 hours 15 minutes) is longer than the interval at which the Space closes WebSockets (about 2 hours). This PR opens a new synchronous client per game, asexamples/sudoku/grpo.pydoes since #1554, so a drop never lands in the middle of a game.examples/wordle/grpo.py:.sync()client, closed and reopened inreset().tests/scripts/test_wordle_training.py: the fake client getssync()andclose().examples/sudoku/grpo.pyandexamples/wordle/grpo.py: drop comments that restate the code or describe our runs (the token header, the per-game connection, the constant learning rate, a token count that contradicted the one above it).docs/source/tutorials/sudoku-grpo.md:SessionLostErrorships in OpenEnv 0.12.0, so the sentence names the release next to Raise SessionLostError when the WebSocket drops mid-episode #1536.Same change for the TRL example: huggingface/trl#8129.
Test plan
pytest tests/scripts/test_wordle_training.py tests/scripts/test_sudoku_training.py: 12 passed.Note
Low Risk
Training-example and documentation changes only; behavior improves rollout reliability against remote Spaces with no auth or core-library changes.
Overview
Wordle GRPO now matches the Sudoku training pattern:
WordleEnvuses a synchronousTextArenaEnvclient that is closed and recreated on everyreset(), so Hugging Face Space WebSocket timeouts (~2 hours) cannot cut a game mid-episode during long GRPO runs.Documentation and inline comments are aligned with that behavior:
MAX_CONCURRENT_ENVS=96(not 64) on duplicated Wordle/Sudoku Spaces, because new sessions start before old ones finish closing asynchronously. The Sudoku tutorial also notes thatSessionLostError(OpenEnv 0.12.0 / #1536) stops silent mid-episode reconnects.The Wordle training test fake client gains
sync()andclose()so rollout tests still exercise the updatedgrpo.pyentrypoint.Reviewed by Cursor Bugbot for commit 4932efa. Bugbot is set up for automated code reviews on this repo. Configure here.