Repository navigation
Conversation
zyzhou5
marked this pull request as ready for review
October 21, 2026 22:32
zyzhou5
force-pushed
the
fix-coding-agent-generation-controls
branch
from
October 21, 2026 23:17
eeca3a4 to
ce58397
Compare
Contributor
Author
|
/ok to test ce58397 |
Contributor
zyzhou5
force-pushed
the
fix-coding-agent-generation-controls
branch
from
October 21, 2026 23:37
ce58397 to
5ca238b
Compare
Contributor
Author
|
/ok to test 5ca238b |
Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
zyzhou5
force-pushed
the
fix-coding-agent-generation-controls
branch
from
October 22, 2026 19:15
f52a47c to
8635ca1
Compare
Contributor
Author
|
/ok to test 8635ca1 |
Signed-off-by: Zeyu Zhou <[email protected]>
Contributor
Author
|
/ok to test 69687e6 |
Signed-off-by: Zeyu Zhou <[email protected]>
Contributor
Author
|
/ok to test 9ccebc4 |
Signed-off-by: Zeyu Zhou <[email protected]>
This was referenced Oct 27, 2026
This was referenced Nov 2, 2026
Contributor
Author
|
Closing in favor of a broader approach. Instead of each harness agent accepting sampling fields in its requests, the training framework sends its sampling values with each rollout, and Gym carries them to every model call the trained agent makes, whatever the agent:
The review comments here that still apply are carried over; #5463's description lists each one. Thanks for the reviews. |
zyzhou5
added a commit
to zyzhou5/Gym
that referenced
this pull request
Nov 3, 2026
… model call A training framework that serves the policy needs every model call of the agents it trains sampled with its own values: its training values, or its validation values for a validation rollout. NeMo RL writes them into each row's responses_create_params today. Harness agents reject those fields (NVIDIA-NeMo#4656), CLI harnesses do not send them on every call, and multi-agent rows have no single responses_create_params to write into. The framework now sets the values on each row as _ng_model_sampling, next to _ng_rollout_id, and leaves the task unchanged. Gym carries them into the URL of every model call the rollout's agent makes, as /ng-sampling/<values> after any rollout prefix. The Model Server writes them into the request before policy admission and capture see it: temperature and top_p replace the call's, and max_output_tokens caps the call's own limit under each endpoint's name. - Typed rows: the collector copies the field into the episode request, and single_agent_turn and harbor add the segment to the agent's activation URL. single_agent_turn_legacy reads it from the flat row. - Flat rows: the agent reads it from its /run body. - Agents: an inbound segment becomes the request's, and Gym's URL helpers and ServerClient put it on every model URL the agent builds. - In a run that sets the model_call_sampling block, resources servers send /ng-sampling/null with their model calls, so a verifier's LLM judge keeps its own sampling or its Model Server's sampling_overrides. vllm_model forwards null to its generation server as the header x-ng-sampling: null. - A Model Server in model_call_sampling.required_model_servers refuses a generation call without a segment and cannot set sampling_overrides. Gym-only evaluation sets neither the field nor the block, so its URLs and requests are unchanged. Replaces NVIDIA-NeMo#4867. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
zyzhou5
added a commit
to zyzhou5/Gym
that referenced
this pull request
Nov 3, 2026
… model call A training framework that serves the policy needs every model call of the agents it trains sampled with its own values: its training values, or its validation values for a validation rollout. NeMo RL writes them into each row's responses_create_params today. Harness agents reject those fields (NVIDIA-NeMo#4656), CLI harnesses do not send them on every call, and multi-agent rows have no single responses_create_params to write into. The framework now sets the values on each row as _ng_model_sampling, next to _ng_rollout_id, and leaves the task unchanged. Gym carries them into the URL of every model call the rollout's agent makes, as /ng-sampling/<values> after any rollout prefix. The Model Server writes them into the request before policy admission and capture see it: temperature and top_p replace the call's, and max_output_tokens caps the call's own limit under each endpoint's name. - Typed rows: the collector copies the field into the episode request, and single_agent_turn and harbor add the segment to the agent's activation URL. single_agent_turn_legacy reads it from the flat row. - Flat rows: the agent reads it from its /run body. - Agents: an inbound segment becomes the request's, and Gym's URL helpers and ServerClient put it on every model URL the agent builds. - In a run that sets the model_call_sampling block, resources servers send /ng-sampling/null with their model calls, so a verifier's LLM judge keeps its own sampling or its Model Server's sampling_overrides. vllm_model forwards null to its generation server as the header x-ng-sampling: null. - A Model Server in model_call_sampling.required_model_servers refuses a generation call without a segment and cannot set sampling_overrides. Gym-only evaluation sets neither the field nor the block, so its URLs and requests are unchanged. Replaces NVIDIA-NeMo#4867. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
zyzhou5
added a commit
to zyzhou5/Gym
that referenced
this pull request
Nov 3, 2026
… model call A training framework that serves the policy needs every model call of the agents it trains sampled with its own values: its training values, or its validation values for a validation rollout. NeMo RL writes them into each row's responses_create_params today. Harness agents reject those fields (NVIDIA-NeMo#4656), CLI harnesses do not send them on every call, and multi-agent rows have no single responses_create_params to write into. The framework now sets the values on each row as _ng_model_sampling, next to _ng_rollout_id, and leaves the task unchanged. Gym carries them into the URL of every model call the rollout's agent makes, as /ng-sampling/<values> after any rollout prefix. The Model Server writes them into the request before policy admission and capture see it: temperature and top_p replace the call's, and max_output_tokens caps the call's own limit under each endpoint's name. - Typed rows: the collector copies the field into the episode request, and single_agent_turn and harbor add the segment to the agent's activation URL. single_agent_turn_legacy reads it from the flat row. - Flat rows: the agent reads it from its /run body. - Agents: an inbound segment becomes the request's, and Gym's URL helpers and ServerClient put it on every model URL the agent builds. - In a run that sets the model_call_sampling block, resources servers send /ng-sampling/null with their model calls, so a verifier's LLM judge keeps its own sampling or its Model Server's sampling_overrides. vllm_model forwards null to its generation server as the header x-ng-sampling: null. - A Model Server in model_call_sampling.required_model_servers refuses a generation call without a segment and cannot set sampling_overrides. Gym-only evaluation sets neither the field nor the block, so its URLs and requests are unchanged. Replaces NVIDIA-NeMo#4867. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
zyzhou5
added a commit
to zyzhou5/Gym
that referenced
this pull request
Nov 4, 2026
… model call A training framework that serves the policy needs every model call of the agents it trains sampled with its own values: its training values, or its validation values for a validation rollout. NeMo RL writes them into each row's responses_create_params today. Harness agents reject those fields (NVIDIA-NeMo#4656), CLI harnesses do not send them on every call, and multi-agent rows have no single responses_create_params to write into. The framework now sets the values on each row as _ng_model_sampling, next to _ng_rollout_id, and leaves the task unchanged. Gym carries them into the URL of every model call the rollout's agent makes, as /ng-sampling/<values> after any rollout prefix. The Model Server writes them into the request before policy admission and capture see it: temperature and top_p replace the call's, and max_output_tokens caps the call's own limit under each endpoint's name. - Typed rows: the collector copies the field into the episode request, and single_agent_turn and harbor add the segment to the agent's activation URL. single_agent_turn_legacy reads it from the flat row. - Flat rows: the agent reads it from its /run body. - Agents: an inbound segment becomes the request's, and Gym's URL helpers and ServerClient put it on every model URL the agent builds. - In a run that sets the model_call_sampling block, resources servers send /ng-sampling/null with their model calls, so a verifier's LLM judge keeps its own sampling or its Model Server's sampling_overrides. vllm_model forwards null to its generation server as the header x-ng-sampling: null. - A Model Server in model_call_sampling.required_model_servers refuses a generation call without a segment and cannot set sampling_overrides. Gym-only evaluation sets neither the field nor the block, so its URLs and requests are unchanged. Replaces NVIDIA-NeMo#4867. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
zyzhou5
added a commit
to zyzhou5/Gym
that referenced
this pull request
Nov 4, 2026
… model call A training framework that serves the policy needs every model call of the agents it trains sampled with its own values: its training values, or its validation values for a validation rollout. NeMo RL writes them into each row's responses_create_params today. Harness agents reject those fields (NVIDIA-NeMo#4656), CLI harnesses do not send them on every call, and multi-agent rows have no single responses_create_params to write into. The framework now sets the values on each row as _ng_model_sampling, next to _ng_rollout_id, and leaves the task unchanged. Gym carries them into the URL of every model call the rollout's agent makes, as /ng-sampling/<values> after any rollout prefix. The Model Server writes them into the request before policy admission and capture see it: temperature and top_p replace the call's, and max_output_tokens caps the call's own limit under each endpoint's name. - Typed rows: the collector copies the field into the episode request, and single_agent_turn and harbor add the segment to the agent's activation URL. single_agent_turn_legacy reads it from the flat row. - Flat rows: the agent reads it from its /run body. - Agents: an inbound segment becomes the request's, and Gym's URL helpers and ServerClient put it on every model URL the agent builds. - In a run that sets the model_call_sampling block, resources servers send /ng-sampling/null with their model calls, so a verifier's LLM judge keeps its own sampling or its Model Server's sampling_overrides. vllm_model forwards null to its generation server as the header x-ng-sampling: null. - A Model Server in model_call_sampling.required_model_servers refuses a generation call without a segment and cannot set sampling_overrides. Gym-only evaluation sets neither the field nor the block, so its URLs and requests are unchanged. Replaces NVIDIA-NeMo#4867. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
zyzhou5
added a commit
to zyzhou5/Gym
that referenced
this pull request
Nov 6, 2026
… model call A training framework that serves the policy needs every model call of the agents it trains sampled with its own values: its training values, or its validation values for a validation rollout. NeMo RL writes them into each row's responses_create_params today. Harness agents reject those fields (NVIDIA-NeMo#4656), CLI harnesses do not send them on every call, and multi-agent rows have no single responses_create_params to write into. The framework now sets the values on each row as _ng_model_sampling, next to _ng_rollout_id, and leaves the task unchanged. Gym carries them into the URL of every model call the rollout's agent makes, as /ng-sampling/<values> after any rollout prefix. The Model Server writes them into the request before policy admission and capture see it: temperature and top_p replace the call's, and max_output_tokens caps the call's own limit under each endpoint's name. - Typed rows: the collector copies the field into the episode request, and single_agent_turn and harbor add the segment to the agent's activation URL. single_agent_turn_legacy reads it from the flat row. - Flat rows: the agent reads it from its /run body. - Agents: an inbound segment becomes the request's, and Gym's URL helpers and ServerClient put it on every model URL the agent builds. - In a run that sets the model_call_sampling block, resources servers send /ng-sampling/null with their model calls, so a verifier's LLM judge keeps its own sampling or its Model Server's sampling_overrides. vllm_model forwards null to its generation server as the header x-ng-sampling: null. - A Model Server in model_call_sampling.required_model_servers refuses a generation call without a segment and cannot set sampling_overrides. Gym-only evaluation sets neither the field nor the block, so its URLs and requests are unchanged. Replaces NVIDIA-NeMo#4867. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
zyzhou5
added a commit
to zyzhou5/Gym
that referenced
this pull request
Nov 9, 2026
… model call A training framework that serves the policy needs every model call of the agents it trains sampled with its own values: its training values, or its validation values for a validation rollout. NeMo RL writes them into each row's responses_create_params today. Harness agents reject those fields (NVIDIA-NeMo#4656), CLI harnesses do not send them on every call, and multi-agent rows have no single responses_create_params to write into. The framework now sets the values on each row as _ng_model_sampling, next to _ng_rollout_id, and leaves the task unchanged. Gym carries them into the URL of every model call the rollout's agent makes, as /ng-sampling/<values> after any rollout prefix. The Model Server writes them into the request before policy admission and capture see it: temperature and top_p replace the call's, and max_output_tokens caps the call's own limit under each endpoint's name. - Typed rows: the collector copies the field into the episode request, and single_agent_turn and harbor add the segment to the agent's activation URL. single_agent_turn_legacy reads it from the flat row. - Flat rows: the agent reads it from its /run body. - Agents: an inbound segment becomes the request's, and Gym's URL helpers and ServerClient put it on every model URL the agent builds. - In a run that sets the model_call_sampling block, resources servers send /ng-sampling/null with their model calls, so a verifier's LLM judge keeps its own sampling or its Model Server's sampling_overrides. vllm_model forwards null to its generation server as the header x-ng-sampling: null. - A Model Server in model_call_sampling.required_model_servers refuses a generation call without a segment and cannot set sampling_overrides. Gym-only evaluation sets neither the field nor the block, so its URLs and requests are unchanged. Replaces NVIDIA-NeMo#4867. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
zyzhou5
added a commit
to zyzhou5/Gym
that referenced
this pull request
Nov 10, 2026
… model call A training framework that serves the policy needs every model call of the agents it trains sampled with its own values: its training values, or its validation values for a validation rollout. NeMo RL writes them into each row's responses_create_params today. Harness agents reject those fields (NVIDIA-NeMo#4656), CLI harnesses do not send them on every call, and multi-agent rows have no single responses_create_params to write into. The framework now sets the values on each row as _ng_model_sampling, next to _ng_rollout_id, and leaves the task unchanged. Gym carries them into the URL of every model call the rollout's agent makes, as /ng-sampling/<values> after any rollout prefix. The Model Server writes them into the request before policy admission and capture see it: temperature and top_p replace the call's, and max_output_tokens caps the call's own limit under each endpoint's name. - Typed rows: the collector copies the field into the episode request, and single_agent_turn and harbor add the segment to the agent's activation URL. single_agent_turn_legacy reads it from the flat row. - Flat rows: the agent reads it from its /run body. - Agents: an inbound segment becomes the request's, and Gym's URL helpers and ServerClient put it on every model URL the agent builds. - In a run that sets the model_call_sampling block, resources servers send /ng-sampling/null with their model calls, so a verifier's LLM judge keeps its own sampling or its Model Server's sampling_overrides. vllm_model forwards null to its generation server as the header x-ng-sampling: null. - A Model Server in model_call_sampling.required_model_servers refuses a generation call without a segment and cannot set sampling_overrides. Gym-only evaluation sets neither the field nor the block, so its URLs and requests are unchanged. Replaces NVIDIA-NeMo#4867. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
zyzhou5
added a commit
to zyzhou5/Gym
that referenced
this pull request
Nov 10, 2026
… model call A training framework that serves the policy needs every model call of the agents it trains sampled with its own values: its training values, or its validation values for a validation rollout. NeMo RL writes them into each row's responses_create_params today. Harness agents reject those fields (NVIDIA-NeMo#4656), CLI harnesses do not send them on every call, and multi-agent rows have no single responses_create_params to write into. The framework now sets the values on each row as _ng_model_sampling, next to _ng_rollout_id, and leaves the task unchanged. Gym carries them into the URL of every model call the rollout's agent makes, as /ng-sampling/<values> after any rollout prefix. The Model Server writes them into the request before policy admission and capture see it: temperature and top_p replace the call's, and max_output_tokens caps the call's own limit under each endpoint's name. - Typed rows: the collector copies the field into the episode request, and single_agent_turn and harbor add the segment to the agent's activation URL. single_agent_turn_legacy reads it from the flat row. - Flat rows: the agent reads it from its /run body. - Agents: an inbound segment becomes the request's, and Gym's URL helpers and ServerClient put it on every model URL the agent builds. - In a run that sets the model_call_sampling block, resources servers send /ng-sampling/null with their model calls, so a verifier's LLM judge keeps its own sampling or its Model Server's sampling_overrides. vllm_model forwards null to its generation server as the header x-ng-sampling: null. - A Model Server in model_call_sampling.required_model_servers refuses a generation call without a segment and cannot set sampling_overrides. Gym-only evaluation sets neither the field nor the block, so its URLs and requests are unchanged. Replaces NVIDIA-NeMo#4867. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
RyaliNvidia
pushed a commit
to RyaliNvidia/Gym
that referenced
this pull request
Nov 10, 2026
… model call (NVIDIA-NeMo#5463) * feat(rollouts): carry a training framework's sampling values to every model call A training framework that serves the policy needs every model call of the agents it trains sampled with its own values: its training values, or its validation values for a validation rollout. NeMo RL writes them into each row's responses_create_params today. Harness agents reject those fields (NVIDIA-NeMo#4656), CLI harnesses do not send them on every call, and multi-agent rows have no single responses_create_params to write into. The framework now sets the values on each row as _ng_model_sampling, next to _ng_rollout_id, and leaves the task unchanged. Gym carries them into the URL of every model call the rollout's agent makes, as /ng-sampling/<values> after any rollout prefix. The Model Server writes them into the request before policy admission and capture see it: temperature and top_p replace the call's, and max_output_tokens caps the call's own limit under each endpoint's name. - Typed rows: the collector copies the field into the episode request, and single_agent_turn and harbor add the segment to the agent's activation URL. single_agent_turn_legacy reads it from the flat row. - Flat rows: the agent reads it from its /run body. - Agents: an inbound segment becomes the request's, and Gym's URL helpers and ServerClient put it on every model URL the agent builds. - In a run that sets the model_call_sampling block, resources servers send /ng-sampling/null with their model calls, so a verifier's LLM judge keeps its own sampling or its Model Server's sampling_overrides. vllm_model forwards null to its generation server as the header x-ng-sampling: null. - A Model Server in model_call_sampling.required_model_servers refuses a generation call without a segment and cannot set sampling_overrides. Gym-only evaluation sets neither the field nor the block, so its URLs and requests are unchanged. Replaces NVIDIA-NeMo#4867. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(harbor): keep a sidecar's own sampling in training runs Harbor's compose sidecars, such as a simulated user, call a model server through URLs that harbor builds for them. They are never the agent being trained, so in a run that sets model_call_sampling their URLs now carry /ng-sampling/null. Their calls keep their own sampling instead of failing policy_model's missing-segment check or the training framework's check on the policy's values. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(agents): carry the rollout's sampling in three agents' own model URLs verifiers_agent, mini_swe_agent and harbor_agent build their model URLs without Gym's URL helpers. In a training run, their calls therefore reached the trained agent's model server without the rollout's sampling values and were refused. NeMo RL's QA distillation recipe runs verifiers_agent this way. - verifiers_agent uses its per-rollout client copy whenever the rollout carries values, not only when capture is on. The shared client's URL, built once for every rollout, still carries none. - mini_swe_agent builds its model URL with base_url_for_run, as mini_swe_agent_2 already does. A caller's policy_base_url is still used as given. - harbor_agent builds its model URL with base_url_for_run. With observability or capture on, mini_swe_agent's and harbor_agent's calls now also carry the rollout prefix, so they appear in per-rollout capture. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(vllm_model): allow a trained agent's server to pin what the engine reports NeMo RL's score centering pins logprobs and top_logprobs on policy_model, which a training run lists as required, so score-centering runs failed at startup. These fields change what the engine reports, not how it samples: both the startup refusal and the per-call refusal now ignore them. A real pin conflict is a configuration error, so the per-call refusal answers 409 instead of a plain error that surfaced as a retryable 500. A test also checks that a null call's x-ng-sampling header reaches the HTTP request. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zeyu Zhou <[email protected]> * fix(client): carry the sampling segment on an agent's self-call ServerClient gave the current segment only to calls aimed at a model server, so an agent calling its own /v1/responses (langgraph, haystack, finance_agent) started a request without it, and its model calls got a 422 from a required policy_model. Generation calls to agents now carry it too; /run does not. apply_rollout_prefix now keeps an explicitly passed segment even with trace_context=False, as its docstring said. CallerSamplingMiddleware declares applies_to_mcp_requests, so a resources server that exposes tools over MCP starts in a training run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zeyu Zhou <[email protected]> * fix(swe_agents): hand OpenHands the per-run URL whenever the rollout carries sampling OpenHands ignores llm.base_url and reads the model server from the global config unless the overlay redirects it, and the overlay was installed only under token capture. With capture off, as in NeMo RL's SWE2 recipes, every policy call lost the sampling segment and got a 422. Gym-only evaluation, which carries no segment, keeps the bare URL. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zeyu Zhou <[email protected]> * fix(agents): keep the sampling of roles an agent runs but does not train An agent's URL helpers gave every model URL it built the run's segment, so a role the agent runs besides the one a training framework trains sampled with the framework's values: tau2's simulated user, pinchbench's judge (when judge_model_server is set) and conversational_tool_use_policy_tool_generation's judge. On a Model Server with its own sampling_overrides, every such call failed with 409. url_path_for_run, base_url_for_run and resolve_model_base_url take trained=False for such a role, which then gets null wherever the run carries a segment, and those three agents pass it. A run without values is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zeyu Zhou <[email protected]> * feat(environments): refuse sampling values on environment servers that ignore them An episode request carries a training framework's sampling values in model_sampling, but only single_agent_turn (and its legacy variant) and harbor put them in the trained agent's URLs. Every other environment server accepted them and ran its agents without them: the agent the framework trains then got a 422 from its required Model Server, which agent sessions turn into failed, empty turns, so an RL run continued, or failed much later with an unrelated error. Environment servers now declare applies_model_sampling. An episode that carries values is refused at admission, terminally, by a server that does not declare it; Gym-only evaluation sends no values and is unaffected. single_agent_turn and harbor declare it. model_sampling_segment gives one participant's segment value: the episode's values for a participant the framework trains, null for every other one, none without values. single_agent_turn and harbor use it for their agent's path. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zeyu Zhou <[email protected]> * docs(rollouts): state the sampling rules as Gym enforces them A trained agent's server may still pin logprobs and top_logprobs. The null header is sent on Chat Completions requests. Only model calls a resources server makes through Gym's server client while handling a request are marked null; judges with their own clients and agent-driven untrained roles are not yet. The middleware comment says where it runs instead of calling it outermost. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zeyu Zhou <[email protected]> --------- Signed-off-by: Zeyu Zhou <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
What does this PR do?
Fixes #4656. Accepts NeMo-RL's
temperature,top_p, andmax_output_tokensin Hermes, Pi, Codex, OpenCode, and OpenClaw agent sessions and applies them to the actual model calls. Hermes host execution uses the same contract.Each activation carries its settings in its Model Server URL. The Model Server applies them before capture and checkpoint admission, keeping concurrent rollouts independent.
max_output_tokensis a per-call cap, including summary calls, and preserves smaller limits selected by the harness.Validation
3ba458eb. The nonblocking Kilocode conformance failure matches the previous revision. CI run.3ba458eb: 125 focused tests passed across sampling middleware, vLLM conversion/overrides, and Pi request validation. Full pre-commit checks passed.pre-commit run --all-filesandgit diff --checkpassed.Focused test selections
These suite selections cover the initial and post-rebase runs. Tests were invoked through
pytest.mainin the existing project environments, with editable imports redirected to this checkout. Equivalent pytest selections:pytest -q \ tests/unit_tests/test_model_sampling.py \ tests/unit_tests/test_base_responses_api_model.py \ tests/unit_tests/test_base_responses_api_agent.py \ tests/unit_tests/test_rollout_correlation.py \ responses_api_models/{openai_model,switchyard_model,vllm_model}/tests/test_app.py \ responses_api_models/vllm_model/tests/test_model_sampling.py pytest -q \ responses_api_agents/{hermes_agent,pi_agent,codex_agent,opencode_agent,openclaw_agent}/tests/test_app.py \ responses_api_agents/hermes_agent/tests/test_sandbox.py \ responses_api_agents/hermes_agent/tests/test_sandbox_runner.py \ responses_api_agents/pi_agent/tests/test_sandbox.py \ responses_api_agents/codex_agent/tests/test_sandbox_sessions.py \ responses_api_agents/codex_agent/tests/test_sandbox_transport.py \ responses_api_agents/codex_agent/tests/test_sandbox_runner.py \ responses_api_agents/opencode_agent/tests/test_sandbox_sessions.py \ responses_api_agents/opencode_agent/tests/test_continuation.py \ responses_api_agents/openclaw_agent/tests/test_sandbox.py python -m coverage report --include='*/nemo_gym/model_sampling.py' --fail-under=96 pre-commit run --all-files git diff --checkCI also ran
responses_api_agents/pi_sandboxed_agent/tests/test_app.py: 51 passed in server-suite shard 0. This is CI evidence, separate from the local selections above.Rollouts
Real-model validation on AGA used
NVIDIA-Nemotron-3-Nano-30B-A3B-BF16throughsingle_agent_turn, withtemperature=0.6,top_p=0.85, and a per-call output cap of 2,048 tokens.1396409).mgettask on four GPUs completed two GRPO steps, with two generations per prompt: four rollouts and 66 captured model calls. Sampling checks passed, losses were finite, gradients were nonzero, and there were zero invalid rows or poisoned captures. Job exited0. W&B run (AGA job1396416).Tested revisions and run notes
3ba458eband RL1f299a8c. Run-local setup included an RL logging accessor correction, Codex prompt guidance naming its available tools, and request/process diagnostics.OpenClaw produced no terminal assistant result. After repeated requests for an unavailable tool, its CLI exited0with finalstopReason=toolUse, without a terminalstoprecord. Gym's existing, unchanged completion check rejected that state. Full HTTP error, stdout, stderr, and native transcript were retained; all 20 model calls returned HTTP 200 with the requested controls.0.prev_logprobswere not retained.Compatibility and benchmark impact
Omitted controls retain existing defaults, and Model Server
sampling_overridesretain precedence. Pi, Codex, OpenCode, and OpenClaw's older local entrypoints are unchanged. Explicit controls can change generated trajectories; no benchmark-score equivalence is claimed.Checklist