You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(gymnasium): release subclass state when an episode ends #3157
Wave 0 — immediate independent bug fix. No framework dependency.
Problem
GymnasiumServer._step_endpoint() calls inherited cleanup after terminal or truncated steps, but the base method removes only session_state. Sokoban and Tetris store environments in session_id_to_state; the multi-turn example stores counters in session_turns. Their actual subclass state therefore leaks.
Essential scope
Remove subclass-owned state immediately on terminal and truncated episodes.
Close closeable environments exactly once.
Use one idempotent local cleanup helper shared by terminal release and reset replacement.
Make repeated and concurrent cleanup safe.
Later integration
When #2609 lands, release_session() delegates to this same helper. Do not create a second ownership path.
Acceptance criteria
Terminal and truncated Sokoban/Tetris episodes remove session_id_to_state and close the environment exactly once.
Terminal and truncated multi-turn example episodes remove session_turns.
Reset replacement and terminal release share one idempotent cleanup path.
Activity
athitten commentedon Sep 9, 2026
Hi @ananthsub can I take this one ?
fix(gymnasium): release subclass state when episodes end (NVIDIA-NeMo…