Repository navigation
Conversation
max_turns / TEXTARENA_MAX_TURNS was stored but never ended an episode. Report done once step_count reaches it.
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
max_turns(andTEXTARENA_MAX_TURNS) was stored in the state but never ended an episode. WithTicTacToe-v0,num_players=2, max_turns=2, four valid moves all returneddone=False. The README documents it as "Maximum turns per episode".step()now setsdoneoncestep_countreachesmax_turns.Type of Change
Alignment Checklist
Before submitting, verify:
.claude/docs/PRINCIPLES.mdand this PR aligns with our principles.claude/docs/INVARIANTS.mdand no invariants are violated/pre-submit-pr(orbash .claude/hooks/lint.shand tests) and addressed all issuesRFC Status
Test Plan
test_max_turns_ends_the_episodeintests/envs/test_textarena_environment.py. The existingfake_textarenafixture now forwards kwargs, so the test runs without textarena. Onmain: 1 failed, 31 passed. With the fix: 32 passed (WSL, Python 3.12).bash .claude/hooks/lint.shpasses.Claude Code Review
Alignment review by Opus 5.5, in the format of
.claude/skills/alignment-review/SKILL.md.Automated Checks
bash .claude/hooks/lint.shTier 1: Fixes Required
None.
Tier 2: Alignment Discussion
None.
Note
Low Risk
Small behavioral fix in episode termination; aligns behavior with documented config and is covered by a targeted test.
Overview
TextArena episodes now honor
max_turns(andTEXTARENA_MAX_TURNS): after eachstep(),observation.doneis true when the wrapped game ends or when a limit is set andstep_counthas reached it—previously the limit lived in state but never terminated the episode.A new unit test drives two steps with
max_turns=2and expectsdoneon the second step. Thefake_textarenafixture forwards constructor kwargs so that test runs without the optional TextArena dependency.Reviewed by Cursor Bugbot for commit 1c93355. Bugbot is set up for automated code reviews on this repo. Configure here.