Skip to content

feat(config): export the reserved keys of a server block as SERVER_BLOCK_RESERVED_KEYS - #7278

Draft
alexandery-nvidia wants to merge 1 commit into
mainfrom
alexandery/server-settings-keys
Draft

alexandery-nvidia wants to merge 1 commit into
mainfrom
alexandery/server-settings-keys

Conversation

@alexandery-nvidia

Copy link
Copy Markdown
Contributor

What does this PR do?

A server's block in a Gym config holds the server's own settings and keys that Gym reads without the server's config class declaring them, such as datasets, description, allowed_agents and, in an agent's block, resources_server and model_server. The config class of a resources server, an agent server or a model server ignores a key that it does not declare, unless it forbids extra keys, so a misspelled setting keeps its default. A config class or a test that refuses such a key has to accept the keys that Gym reads. Each one keeps a list of its own today: test_browsecomp_presets.py of opencode_search, test_harness_configs.py of gdpval, and the config class of critpt_custom_grader, which declares the keys as fields. This PR adds the list to nemo_gym.config as SERVER_BLOCK_RESERVED_KEYS.

What changes:

  • SERVER_BLOCK_RESERVED_KEYS is one list for all server types. It holds the fields of BaseRunServerTypeConfig, which Gym validates in every block, the fields of ServerMetadata, the keys that Gym carries onto a composed agent, which add resources_server and model_server, and allowed_agents, allowed_model_types and grading_mode.
  • A unit test gives readers of these keys blocks that state only reserved keys, so a reader that takes its value from another key fails it. The test sees only the readers that it calls, and no second key that a reader falls back to.
  • The two tests named above use the list in place of their own lists. Each now accepts every reserved key. That includes keys that its own list lacked, such as verified_url, and a key in a block from which Gym does not read it, such as allowed_agents in the agent block of a GDPVal harness config.
  • The helpers of test_browsecomp_presets.py return the composed config alone, because no test reads the parser.
  • The configuration reference gains the section "Reserved Keys of a Server Block", which states the keys by server type, and the harness guide points to it.

What does not change: only tests read the list, and no config class changes. critpt_custom_grader, arena and nooa_agent forbid extra keys and keep the reserved keys that they accept as typed fields of their own.

No issue is linked: the PR adds one constant.

Validation

  • pytest on tests/unit_tests/config, test_public_api_facades.py, test_public_api.py, test_import_linter_coverage.py, test_moved_paths.py and test_fern_docs_links.py: 1713 passed. On resources_servers/opencode_search/tests: 267 passed. On resources_servers/gdpval/tests/test_harness_configs.py: 4 passed. The other tests of resources_servers/gdpval were not run.
  • With nemo_gym/config of main, the new test and the two changed tests fail at their import, and test_every_name_code_outside_the_library_imports_from_a_public_api_resolves fails. Without resources_server and model_server in the list, the new test fails.
  • Through run_webserver in a dry run, the shipped example_single_tool_call and droid_agent servers each start with a misspelled setting in their block. With a config class that subtracts its fields and the list, each starts its shipped block and refuses the misspelled key by name. With extra="forbid" alone, example_single_tool_call refuses its shipped block for verified and description.
  • Ruff 0.9.9 check and format --check pass on the changed Python files. pre-commit and make docs-check were not run.

Rollouts

N/A. The PR adds a constant, a unit test and documentation, and it changes two tests. No server, agent or verifier behavior changes.

Compatibility and benchmark impact

None. nemo_gym.config gains one public name, which only tests read.

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

🤖 Generated with Claude Code

…OCK_RESERVED_KEYS

A server's block in a Gym config holds the server's own settings and
keys that Gym reads without the server's config class declaring them,
such as datasets, description, verified, allowed_agents and, in an
agent's block, resources_server and model_server. The config class of a
resources server, an agent server or a model server ignores a key that
it does not declare, unless it forbids extra keys, so a misspelled
setting keeps its default. A config class or a test that refuses such a
key has to accept the keys that Gym reads, and two tests each held a
list of their own.

SERVER_BLOCK_RESERVED_KEYS of nemo_gym.config is that list, for all
server types together. It holds the fields of BaseRunServerTypeConfig,
which Gym validates in every block, the fields of ServerMetadata, the
keys that Gym carries onto a composed agent (resources_server,
model_server, datasets), allowed_agents, allowed_model_types and
grading_mode. A unit test gives readers of these keys blocks that state
only reserved keys, so a reader that the test calls fails it when the
reader takes its value from a key that is not reserved.

The test of the BrowseComp presets of opencode_search and the test of
the GDPVal harness configs use the list in place of their own lists.
The helpers of the BrowseComp test return the composed config alone,
because no test reads the parser. The configuration reference describes
the reserved keys by server type, and the harness guide points to it.

Signed-off-by: alexandery <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
@alexandery-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 5996d89

@copy-pr-bot

copy-pr-bot Bot commented Dec 4, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the risk:high Autobot PR risk: high label Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci added feature New capabilities, enhancements, or enablement work area:config Hydra configuration, schemas, composition, and compatibility labels Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:config Hydra configuration, schemas, composition, and compatibility feature New capabilities, enhancements, or enablement work risk:high Autobot PR risk: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants