Repository navigation
Open a new client per game in the Wordle GRPO script - #1560
Open
sergiopaniego wants to merge 4 commits into
Open
sergiopaniego wants to merge 4 commits into
sergiopaniego wants to merge 4 commits into
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.
This branch has not been deployed
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
Changes affect example GRPO training scripts, test doubles, and documentation only—not production services or security-sensitive paths.
Overview
Wordle GRPO now matches the Sudoku training pattern: it uses a synchronous
TextArenaEnvclient and closes and recreates the connection on everyreset(), so Hugging Face Space WebSocket timeouts (~2h) cannot cut a game off mid-episode during long runs.Docs and READMEs update
MAX_CONCURRENT_ENVSfrom 64 to 96 for Wordle (and clarify the same headroom in Sudoku comments), because each game starts a new session before the server has finished releasing the old one. The Sudoku tutorial also tiesSessionLostErrorto OpenEnv 0.12.0 alongside PR #1536.tests/scripts/test_wordle_training.pyextends the fake env client withsync()andclose()so tests still pass. Sudoku/Wordlegrpo.pyfiles mostly drop or tighten redundant comments (token header, constant LR rationale).Reviewed by Cursor Bugbot for commit da8d6a8. Bugbot is set up for automated code reviews on this repo. Configure here.