Repository navigation
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
Draft
alexandery-nvidia wants to merge 1 commit into
alexandery-nvidia wants to merge 1 commit into
Conversation
…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]>
Contributor
Author
|
/ok to test 5996d89 |
Contributor
This branch has not been deployed
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?
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_agentsand, in an agent's block,resources_serverandmodel_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.pyofopencode_search,test_harness_configs.pyofgdpval, and the config class ofcritpt_custom_grader, which declares the keys as fields. This PR adds the list tonemo_gym.configasSERVER_BLOCK_RESERVED_KEYS.What changes:
SERVER_BLOCK_RESERVED_KEYSis one list for all server types. It holds the fields ofBaseRunServerTypeConfig, which Gym validates in every block, the fields ofServerMetadata, the keys that Gym carries onto a composed agent, which addresources_serverandmodel_server, andallowed_agents,allowed_model_typesandgrading_mode.verified_url, and a key in a block from which Gym does not read it, such asallowed_agentsin the agent block of a GDPVal harness config.test_browsecomp_presets.pyreturn the composed config alone, because no test reads the parser.What does not change: only tests read the list, and no config class changes.
critpt_custom_grader,arenaandnooa_agentforbid 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
pytestontests/unit_tests/config,test_public_api_facades.py,test_public_api.py,test_import_linter_coverage.py,test_moved_paths.pyandtest_fern_docs_links.py: 1713 passed. Onresources_servers/opencode_search/tests: 267 passed. Onresources_servers/gdpval/tests/test_harness_configs.py: 4 passed. The other tests ofresources_servers/gdpvalwere not run.nemo_gym/configofmain, the new test and the two changed tests fail at their import, andtest_every_name_code_outside_the_library_imports_from_a_public_api_resolvesfails. Withoutresources_serverandmodel_serverin the list, the new test fails.run_webserverin a dry run, the shippedexample_single_tool_callanddroid_agentservers 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. Withextra="forbid"alone,example_single_tool_callrefuses its shipped block forverifiedanddescription.checkandformat --checkpass on the changed Python files.pre-commitandmake docs-checkwere 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.configgains one public name, which only tests read.Checklist
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).🤖 Generated with Claude Code