Expose render_completion + add_trajectory_step, private/final guardrails#679
Merged
Expose render_completion + add_trajectory_step, private/final guardrails#679
Conversation
snimu
reviewed
Jan 4, 2026
snimu
approved these changes
Jan 4, 2026
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.
Description
Elevates
render_completionto an overridable MultiTurnEnv method, and adds an overridable methodadd_trajectory_stepfor setting step-level rewards/advantages/extras. Logic not intended for overriding is marked as final if public-facing, private if internal. Additional methods in Environment/EnvGroup are marked as private/final (or removed if no longer needed).Minor reorganizations + docstring improvements.
Type of Change
Testing
uv run pytestlocally.Checklist
Additional Notes
Note
API additions and overrides
MultiTurnEnv: new overridablerender_completionandadd_trajectory_step;rolloutmarkedfinal;env_responseis abstract; completion rendered at end of rollout.experimental/RLMEnv: implementsrender_completionto ignore sub-LLM steps when computingcompletion.Core refactors and guardrails
Environment: internal helpers renamed private (_format_dataset,_format_completion_dataset,_get_eval_inputs); several public methods markedfinal(get_dataset,get_eval_dataset,init_state,is_completed,run_rollout,run_group); removed internal completion rendering; minor doc/docstring updates.EnvGroup: aligns to private dataset formatters (_format_dataset,_format_completion_dataset);rolloutmarkedfinal; docstrings clarified.Misc
ToolRubricanddata_utils: minor typing/cast cleanups without behavior changes.Written by Cursor Bugbot for commit 4546247. This will update automatically on new commits. Configure here.