Repository navigation
Closed
Closed
Copy link
Description
Extracted from: #1434
Use cases, pain points, and background
A new user to Gym should be able to discover available environments, benchmarks, agents, datasets, and models directly from the CLI.
Today, users often need to browse GitHub, inspect configs, or understand Gym's internal project structure to answer basic questions such as:
- What environments are available?
- What can I evaluate against?
- Which agents are available?
- What does a particular environment do?
- Which environments are compatible with my agent?
This creates unnecessary friction for both human users and agents using Gym as a tool.
Description
Add a discoverability layer to the CLI that allows users to list, inspect, and search registered Gym components.
Example workflows:
gym list environments
gym list benchmarks
gym list agents
gym list dataset
gym list environments aviary
gym search swe
gym list environments --agent openhands
gym search --environments sweAll list, search, and inspect commands should support machine-readable output via --json.
Design
- Build a registry of discoverable components:
- environments
- benchmarks
- datasets
- agents
- models
- Registry should include both built-in and user-provided components.
- Add:
gym list <type> <name>
gym search <type> <query>- Component inspection should expose:
- description
- config source
- compatibility metadata
- example invocation
- Unknown component names should provide "Did you mean?" suggestions.
Out of scope
- Changes to benchmark architecture.
- Changes to environment architecture.
- Agent-centric evaluation workflows.
- Refactoring underlying config loading mechanisms.
- Changes to how components are authored or registered internally.
Acceptance Criteria
- Users can list registered environments, benchmarks, agents, datasets, models from the CLI.
- Users can inspect a specific component by name.
- Users can search across registered components.
- List, search, and inspect commands support
--json. - Unknown component names provide "Did you mean?" suggestions.
- Built-in and user-provided components appear in the registry.
- CLI help text documents discovery workflows.
References
- Blocking: Fix inaccurate listings and automate discovery surfaces for Environements #1950
- Dependent on: Epic: Gym CLI usability -- first class CLI experience #1434
- Dependent on: epic: reduce configuration friction for environment authors and users #1205
- Related: epic: Agent swappability — first-class --agent-type selector in the CLI #1583
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
sephmard commentedon Jul 7, 2026
Sub-issue: #1950 — Environment publishing workflow: fix inaccurate listings and automate discovery surfaces
sephmard commentedon Jul 13, 2026
Bumping to
Urgentsince discovery will be more critical as we are expanding Environment onboarding13 remaining items
docs: document extensions to `gym list` and `gym search` (#2064)
marta-sd commentedon Jul 23, 2026
gym list datasetsandgym search datasetswere removed from the scope as datasets are not stand-alone entities in Gym. The concept of Task will be defined in #2036phtran8 commentedon Jul 29, 2026
6499901 is closed as NAB
qiaochuz-nv commentedon Jul 29, 2026
Hi @marta-sd ,
all bugs are reported under https://nvbugspro.nvidia.com/bug/6534439
below are test summary.
NeMo Gym CLI — Test Summary
Feature: unified
gymCLI (single entry point with grouped subcommands, replacing 40+ng_*/nemo_gym_*scripts)fern/versions/latest/pages/reference/cli-commands.mdx(872 lines, 27 documented commands)/home/qiaochuz/nemo/Gym@2e8efc8,NeMo Gym v0.5.0rc0, editable installnmfw_tests@/home/qiaochuz/nemo/nmfw_tests_gym_1630, branchqiaochuz/gym_1630_cli_refactor20260729T192658Z-8be5f668— local, CPU-only (num_gpus: 0)1. Result Summary
The suite is deliberately split into two instruments with opposite purposes.
failed— accurate, the feature has open defectsc1_cli_routerc1_legacy_aliasesc1_discoveryc1_reference_surfacec1_catalog_enumerationc1_known_defectsOther metrics: ~1,000 CLI invocations · 329/329 components covered · 204 configs validated · 8 defects found.
Static gates:
make test:lint→ok: no nemo_gym imports in suite code·ok: 20 testcases registered across 3 sections, all scripts present.py_compileclean.Why the split exists
An earlier revision of this suite reported 30/30 green while all 8 defects were already open. That was not luck — it was structural. A regression guard must encode current behaviour to detect future change, so every defect found during authoring was accommodated rather than reported: quarantine sets, excluded component types, identity-key lookup tables, slicing past a polluted header. Green meant "nothing got worse", but it read as "everything is fine".
c1_known_defectsis the opposite instrument. Every assertion states what the product is supposed to do per its own epic and reference docs, so each open defect is exactly one red assertion. The failure list is the backlog:Do not make this case pass by relaxing an assertion. That silently re-hides the defect the file exists to expose.
2. Test Scope
2.1 In scope — commands actually executed
Every command below was run as a real subprocess against the installed console script.
gym --helpgym --versiongym --version --jsongym <group> --helpgym <group> <cmd> --helpgym list <type>gym list <type> <NAME>gym list <type> <typo>gym search <type> <NAME>gym search <query>gym search <type> <query>gym env validate --resources-servergym env validate --environmentgym env validate --model-typegym env resolve --configgym env status --jsongym env packages --jsonng <...>gymng_*/nemo_gym_*aliases2.2 In scope — component trees, swept exhaustively
resources_serversresponses_api_agentsenvironmentsresponses_api_modelsNot sampled. Every entry the CLI advertises was driven individually.
2.3 Out of scope — not executed, explicitly unverified
gym dataset upload / download / rm / migrategym dataset collate / rendergym env start/gym env testgym env initgym eval prepare / run / aggregate / profile / reverifygym dev test--tier e2eTheir flag surface was still verified via
--help(exit 0, non-empty stdout) — the only side-effect-free invocation available.3. Results by Test Case
3.1
c1_cli_router— 7/7 PASSRouter and top-level surface (
nemo_gym/cli/main.py,cli/general.py).-hwith exit 0 and clean stderrngis a drop-in alias (byte-identical--help)--version --jsonemits JSON and nothing else on stdout3.2
c1_legacy_aliases— 4/4 PASSBackward compatibility (
nemo_gym/cli/legacy.py,[project.scripts]).LEGACYrouting table agree exactly{reinstall}ng_versionroutes correctly, notice on stderr onlyng_list_benchmarksstdout byte-identical to modern command3.3
c1_discovery— 7/7 PASSDiscovery surface from epic #1582.
namesearchtakes component type as a positional; hits ⊆ cataloggym search swe≡gym search benchmarks swe3.4
c1_reference_surface— 7/7 PASSThe documented reference (
cli-commands.mdx) driven against the binary.--helpexit 0env resolvemerges configs;env status --jsonis an array3.5
c1_catalog_enumeration— 5/5 PASSEvery command driven over every component rather than a representative sample.
Two design choices, both derived from real output:
name[:-1]— the one mutation that stays inside difflib's cutoff for names of any length while guaranteeing an absent key.aime2legitimately resolves toaime26whenaime24/25/26all exist; demanding the original back would assert difflib's tie-breaking, not the product's contract.3.6
c1_known_defects— 0/8 PASS · RED BY DESIGNEach assertion states what the product should do. Each failure is one open defect.
-vand--verboseare accepted before the subcommandnameenv validatenever prints a raw tracebackenv resolveexample runs as printedenv packages --jsonemits nothing but JSON on stdoutRegistered
status: fail,expected_to_fail: true,nvbugs_status: to_be_filedso the runner records a known-red signal rather than a broken test.Counter-check — these assertions are bound to real behaviour, not dead code. The "fixed" shape of each is reachable today:
benchmarksalready carries anamekey (D),gsm8kalready returns ausage_example(F),gym list agents --jsonalready emits a bare array (H). So a fix flips the assertion green with no test edit.4. Acceptance Criteria
gymentry point with subcommands-h/--helpat every level, no hidden commands--jsonon list / inspect / status commandsenv packagesfails (H)ng_*/nemo_gym_*keep working with a deprecation notice-v/--verbosesupported globally--flag valuefor primary inputs, Hydra as escape hatchgym --help+ migration documentation published6 PASS · 3 PARTIAL · 1 FAIL
5. Requested Commands — Verified Individually
Four commands were requested for verification; they originate from epic #1582's own examples. Two do not work as written.
gym list environments aviaryaviaryis a resources-server, not one of the 20 environments. Correct:gym list resources-servers aviary(exit 0)gym search swegym list environments --agent openhandsgym search --environments swegym search environments sweCommands 1, 2 and 4 (corrected forms) are now permanently covered by
c1_discoveryandc1_catalog_enumeration. Command 3 cannot be covered — the capability does not exist.6. Defects
-v/--verboseis not globalng_viewerdocumented but not shipped (exit 127)list/searchidentity key inconsistent formodelsenv validateleaks raw tracebacks on 12 configsusage_examplenull for all agents and modelsenv resolveexample fails as printedenv packages --jsonprints a human header before the JSONAll 8 are covered by a failing assertion in
c1_known_defects— none rely on prose alone.A —
-v/--verboseis not globalnemo_gym/cli/main.py. The epic requires "-v/--verbosesupported globally and honored by subcommands."Works only in trailing position, per-subparser. Path-dependent:
gym -v eval run --helpexits 0 whilegym -v list benchmarksexits 2.Fix: register
-v/--verboseon a top-level parent parser inherited by all subparsers.B — self-contradictory "Did you mean?"
_GymArgumentParser.error()innemo_gym/cli/main.py.The suggester runs against a candidate list containing the rejected token, because it was rejected for position, not for being unknown.
Fix: exclude the rejected token from its own suggestion set; when valid-but-misplaced, say so.
A and B share one code path — plausibly a single fix.
C —
ng_viewerdocumented but not shippedresponses_api_agents/swe_agents/README.md:503Not installed, not in
[project.scripts], not in theLEGACYtable — no deprecation shim, a hard 127. #1630 migrated the prose line immediately above and stopped one line short.D — identity key inconsistent for
modelsgym list {benchmarks,environments,agents,resources-servers} --jsonnamegym list models --jsonmodel+model_group, nonamegym list <type> <NAME> --json(inspect)name— uniform across all 5Any consumer writing
[x["name"] for x in json]breaks onmodelsalone. Divergence is confined to the list/search projection.E —
env validateleaks raw tracebackscli-commands.mdx:417promises validate "exits0when valid, or1with a clean message (no traceback)". 12 configs instead dump a rawomegaconf.errors.InterpolationKeyError.The CLI already handles the sibling error class cleanly — an unset
???yieldsError: 1 required config value(s) are unset …. Root cause:ConfigErrorinnemo_gym/config_types.pyhas a member for missing mandatory values but none for unresolved${...}interpolations, so omegaconf's exception escapes uncaught.Affected — 10 resources servers:
browsecomp_advanced_harness,cvdp,example_mcp_weather,genrm_compare,over_refusal_detection,over_refusal_detection/over_refusal_detection_nemotron,reasoning_gym/reasoning_gym_claude_code_agent,reasoning_gym/reasoning_gym_codex_agent,tavily_search/tavily_search_judge_openai_model,tavily_search/tavily_search_judge_vllm_model; 2 environments:finance_sec_search,reasoning_gym_claude_code.F —
usage_examplenull for agents and modelsEpic #1582 requires component inspection to expose an example invocation.
G — the reference's own
env resolveexample failscli-commands.mdx:400-416presents a copy-paste block. Executed verbatim from a directory with noenv.yaml— what a new user has:Zero model configs resolve standalone. A working invocation needs three keys the example omits (
++policy_base_url,++policy_api_key,++policy_model_name) — verified exit 0, 88 lines of valid YAML. Unlikevalidate,resolvesubstitutes no dummy model.H —
env packages --jsonis not machine-readablenemo_gym/cli/env.py:1080-1082.--jsonis advertised ingym env packages -h, but three unconditionalprint()calls emit a human header to stdout before the JSON payload:stderr is empty (0 bytes), so the header genuinely pollutes the data stream. Every other
--jsoncommand emits a bare array.Fix: suppress the header when
--jsonis set, or write it to stderr.7. Audit — every non-zero exit reviewed
Raw logs contain 360 non-zero exits. All were re-classified; none is an unreported failure.
gym list <typo>name[:-1]), exit 1 expectedgym env validate— clean failError:message, exit 1gym env validate— tracebackThe 18 clean failures were classified individually (previously unexamined):
missing model refsimpleqarequiresgenrm_model; not suppliedunset ??? mandatoryazure_openai_model,local_vllm_model_proxyBoth are legitimate user errors that
env validatereports correctly — evidence the command works, not defects.Also investigated and dismissed: a
BrokenPipeErrortraceback appeared while piping--jsonoutput. Re-checked with| headon three commands — does not reproduce. The traceback came from my ownpython3 -cconsumer exiting early, not from gym. Not filed.8. Coverage Gap — Epic #1582 Not Fully Delivered
Issue #1582 is closed as COMPLETED, but one of its own worked examples is unimplemented:
gym list environments --agent openhands # "Which environments are compatible with my agent?"Verified absent:
--agentis not a flag onlist environments(exit 2), and none of #2061–#2064 add it (grep -c '"--agent"'= 0 across all four diffs). The issue's stated use case and its "compatibility metadata" design bullet have no shipped implementation.No test authored — a capability that does not exist cannot be tested, and suite rule R4 forbids negative tests.
Recommendation: reopen #1582 or file a follow-up for agent-compatibility filtering.
9. Deliverables
make test:lintnemo_gymimports; 20 testcases registered, all scripts presentimport nemo_gym)git status --porcelainemptybaselines/,qa_credentials.yaml,logs/untrackedAll six cases registered
function,num_gpus: 0,slurm.isolate_group: true. The five regression cases carrystatus: pass;c1_known_defectscarriesstatus: fail+expected_to_fail: true+nvbugs_status: to_be_filed. Nothing committed.10. Recommended Actions
ConfigErrorneeds an unresolved-interpolation member; 12 configs affected, highest user impactif config.json:guard atenv.py:1080env resolveexample does not run as printedng_viewer--agentcompatibility filteringAs each defect is fixed, its assertion in
c1_known_defectsturns green on its own. When all 8 are green the case can be deleted — the regression guards already cover the fixed behaviour.feat: extend `gym list` and `gym search` commands (NVIDIA-NeMo#2062)
feat: add `gym list <type> <name>` for inspecting (NVIDIA-NeMo#2063)
docs: document extensions to `gym list` and `gym search` (NVIDIA-NeMo…