Repository navigation
fix(textarena): forward seed to underlying TextArena env on reset - #1148
Closed
caiotheodoro wants to merge 1 commit into
Closed
caiotheodoro wants to merge 1 commit into
caiotheodoro wants to merge 1 commit into
Conversation
TextArenaEnvironment.reset() accepted a seed parameter but never passed it to the wrapped TextArena env's reset(), so repeated resets with the same seed drew a different secret word every time. TextArena's own reset() already accepts seed, it was just being dropped. Fixes #1102
Contributor
Author
|
Closing — #1127 already fixes this exact issue (same root cause, same one-line forward of |
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.
Problem
TextArenaEnvironment.reset()takes aseedparameter (required by theEnvironmentbase class interface) but never forwards it to the wrappedTextArena env's own
reset(). TextArena'sreset(num_players, seed=None)does accept a seed - it was just being dropped on the way through.
Result:
reset(seed=1234)called repeatedly draws a different secret wordevery time, even though the signature advertises reproducibility.
Fix
Pass
seedthrough inTextArenaEnvironment.reset():(Left the constructor's initial
reset()call alone - there's no seed inscope there.)
Test plan
test_reset_seed_is_forwarded_to_textarena, which resets twice withthe same seed and asserts the secret word matches. Confirmed it fails on
main(different word each time) and passes with the fix.PYTHONPATH=src:envs uv run pytest tests/ -v- full suite passes(1653 passed, 133 skipped, no failures).
uv run ruff format --check/ruff checkon the touched files - clean.textarenainstalled (Wordle-v0, seed 1234 vs varying).Fixes #1102
Note
Low Risk
Single-parameter pass-through on reset with a targeted regression test; no auth, data, or infrastructure changes.
Overview
TextArenaEnvironment.reset()now passesseedthrough to the wrapped TextArena env (self._ta_env.reset(..., seed=seed)). Previously the OpenEnvreset(seed=...)argument was ignored, so repeated resets with the same seed still randomized game setup (e.g. different Wordle secret words).A regression test resets
Wordle-v0twice withseed=1234and asserts the secret word matches.Reviewed by Cursor Bugbot for commit 66c0bf5. Bugbot is set up for automated code reviews on this repo. Configure here.