Repository navigation
fix(training): refuse an OpenEnv episode whose first-turn tools differ from its config group's probed task - #840
Merged
Merged
Conversation
… reveals (UGML-1707) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ns without args; README says only a by-name deny hides a revealed tool; real-gateway reveal test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ow-up; falsy non-list reveal replies fail; a reveal on an env with no tool access to change enables nothing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fig; a reveal on a record with no or an empty stored card fails Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… toolset docstring names where config can make tasks differ Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r from its config group's probed task
… paragraphs) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agutmanstein-scale
approved these changes
Dec 1, 2026
agutmanstein-scale
left a comment
Collaborator
There was a problem hiding this comment.
Claude, on Alec's behalf: approving. The exact match only applies to apply_server_config groups and compares tool-name sets, rows without first_turn_tools keep the old subset check, and tasks_and_tools is private to the package with every caller updated.
Non-blocking: TRL takes exactly from the live probe, so a config bundle whose later task reveals fewer tools than task 1 now stops with a RuntimeError instead of training. That's worth a release-note line.
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.
Tasks that apply server config share one probe, because their config replies can reveal tools and no static key tells apart what they reveal. When a later task in that group offers more tools than the probed one, its rollout is already refused (
Misgrouped). When it offers fewer, it trains silently on a tool list that includes tools its episode refuses. With this PR, a trainer checks an episode of such a group against the tools the probed task offered at its first turn, and refuses an episode whose first turn offers any other set, in either direction.tasks_and_toolsalso returns, for each toolset whose tasks apply server config, the tools its probed task offered at its first turn.probealready measured these.first_turn_toolsfield: chat (Miles, slime), verl and SkyRL (a new nullable string column in their parquet schemas) and NeMo Gym (a top-level row field its seed request reads). TRL passes it straight toShared.exactly.Sessionrefuses (Misgrouped) an episode whose first-turn tools differ fromShared.exactly. A row without the field skips this check and keeps today's check: it refuses only tools beyond the ones the row shows. That covers rows written before this change and toolsets without config.Rollout
New rows for config toolsets carry the field. Old rows, and toolsets without config, behave as today. A bundle that mixes tasks whose configs reveal different tools now fails loudly where it used to train silently:
RuntimeError, and SkyRL raisesValueError, as both already do for an episode offering more tools.keep_scored_groupsdrops its group. Now a rollout that offers fewer is left out the same way.No server change and no extra probe. #833, which this was stacked on, has merged; this PR now targets
main. Ships with the next tagged release. Revert: revert this PR.Validation
Head
c9318394(retargeted tomainafter #833 merged, mainbfd69f35merged in; the only conflict was the protocol README, which takes main's text; the PR's own diff is unchanged sinced778fb383).test_a_task_whose_config_reveals_other_tools_than_its_probed_tasks_is_refused_and_an_older_row_plays[fewer]and TRLtest_a_rollout_whose_config_reveals_fewer_tools_than_its_classs_stops_training[fewer], through the real server,probeandSession; both fail on the base branch[more](the existing check), andtest_a_task_revealing_at_its_first_turn_what_its_probed_task_reveals_later_is_refused, which only the new check refusestest_tasks_whose_configs_reveal_the_same_tools_share_one_probe_whatever_their_args_and_play[reveal-the-same, reveal-nothing]: one probe throughwrite_rows/tasks_and_toolstest_a_row_of_a_task_with_server_config_keeps_its_toolsets_first_turn_tools), which fail when the parquet column is dropped; the chat[fewer]test plays the same row with the field removedtst/verl/loop_test.pyandtst/skyrl/generator_test.py: a row whose storedfirst_turn_toolsdiffers is refused and one that matches plays;tst/nemo_gym/server_test.py: a differing row is maskedtest_a_config_between_turns_is_compared_on_the_first_turns_tools_not_on_every_turnsfails when the field is built from every turn's toolsc9318394:ruff check src/agent_env/training: all checks passed;pytest -n0 tst/unit/training: 125 passed.d778fb383:ruff check: all checks passed. Unit suite (pytest tst/unit packages/agentenv-protocol/tests -n 3 --timeout 300): 17587 passed, 70 skipped, 9 failed, the 9 that also fail on the base branch on this machine (Windows disk recipe, computer exec, MCP CLI builder, docker GitHub clone). None is in this diff.Not in this PR
Known limitations:
fail_task_on_error: falsethat fails in one rollout makes that rollout offer fewer tools, so it is refused: TRL and SkyRL stop, with an error that suggests separate bundles though both tasks carry the same config. Before this change it trained on tools the episode did not offer, which is the case this PR refuses.fail_task_on_errordefaults to true, and noapply_server_configstep in the bundles this was checked against opts out.Quality bar
Head
c9318394(rows ond778fb383predate the retarget and main merge; the PR's diff is the same).ruff check, unit suite)d778fb3833f747300dd7b3551to113e3941ed778fb383d778fb383d778fb383d778fb383d778fb383pr_gate.py checkc9318394Relaxations: none.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Adds
first_turn_toolsfor config toolsets and refuses episodes whose first-turn tools differ from the probed task.cikowski explicitly accepts that later-turn config differences remain unchecked, mixed groups are refused rather than split, and verl and NeMo Gym leave refused rollouts out instead of stopping training. cikowski also accepts that stale rows and tolerated config failures can trigger refusal with advice to separate bundles.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Probe one task per toolset] --> B[Keep tools from every turn] A --> C[Keep first-turn names for config toolsets] B --> D[Trainer row or TRL class] C --> D D --> E[Reset episode and list first-turn tools] E --> F{Tools fit stored checks?} F -->|Yes| G[Play and score] F -->|No| H[Refuse rollout through existing trainer path]Reviews (15) · Last reviewed commit: "merge main after #833 landed: protocol R..." · Reviewed by Greptile