Skip to content

feat(cli): run an environment by name — 'gym env run --env <name>' (#1205 friction #8 / FEP-1022) - #1636

Closed
wprazuch wants to merge 4 commits into
wprazuch/environment-registryfrom
wprazuch/env-run-by-name
Closed

feat(cli): run an environment by name — 'gym env run --env <name>' (#1205 friction #8 / FEP-1022)#1636
wprazuch wants to merge 4 commits into
wprazuch/environment-registryfrom
wprazuch/env-run-by-name

Conversation

@wprazuch

@wprazuch wprazuch commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What

The run-by-name half of M2 (the discovery half is the base PR #1635): run an environment by its short name instead of an internal config path.

gym env run --env workplace_assistant --config responses_api_models/openai_model/configs/openai_model.yaml
# or:  gym env run --env workplace_assistant --model-url ... --model-name ... --model-api-key ...

--env <name> resolves to the environment's config via the registry (resolve_environment_config_paths) and is merged with any --config into a single +config_paths. Because an environment references its model server by name, you pair --env with --config / --model-* to supply the model.

  • Unknown name → exits cleanly with the registry's "did you mean?" message (no traceback).
  • Model flags (--model-name/url/api-key) pass through unchanged.
  • env run becomes a callable router target (_env_run); config-only behavior is unchanged.

Why

Epic #1205 friction 8. Completes the registry payoff: discover (gym list environments, #1635) + run by name.

Tests

TestEnvRunByName (5): name→config resolution; --env+--config merge into one +config_paths; model-flag passthrough; config-only unchanged; unknown env exits cleanly. 91/91 router+cli+registry tests pass; ruff + pre-commit clean.

@copy-pr-bot

copy-pr-bot Bot commented Jun 17, 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.

@wprazuch
wprazuch force-pushed the wprazuch/environment-registry branch from df7a13d to 6784a52 Compare June 22, 2026 13:48
@wprazuch
wprazuch requested a review from a team as a code owner June 22, 2026 13:48
@wprazuch
wprazuch force-pushed the wprazuch/env-run-by-name branch from 627401f to 41193f1 Compare June 22, 2026 13:49
@wprazuch
wprazuch force-pushed the wprazuch/environment-registry branch from eb06d7b to c237f13 Compare June 24, 2026 07:04
@wprazuch
wprazuch force-pushed the wprazuch/env-run-by-name branch from c13c345 to c764c57 Compare June 24, 2026 07:06
@wprazuch
wprazuch force-pushed the wprazuch/environment-registry branch 2 times, most recently from e7c8af4 to 42d6da2 Compare June 24, 2026 07:18
@wprazuch
wprazuch force-pushed the wprazuch/env-run-by-name branch from 33fa0b6 to fbdb9e2 Compare June 24, 2026 07:20
@wprazuch
wprazuch force-pushed the wprazuch/environment-registry branch from 42d6da2 to fe103a2 Compare June 24, 2026 07:21
wprazuch added 3 commits June 24, 2026 09:22
Builds on the environment registry: --env resolves a name to its config via
resolve_environment_config_paths and merges it with any --config into a single
+config_paths, so an environment can be run by name instead of an internal path
(epic #1205 friction #8 / FEP-1022). Model flags pass through; an unknown name
exits cleanly with the registry's 'did you mean?' message. Pair --env with
--config / --model-* for the model the environment references.

env run becomes a callable router target (_env_run); config-only behavior is
unchanged.

Signed-off-by: Wojciech Prazuch <wprazuch@nvidia.com>
_env_run stripped every +config_paths token to merge --env/--config into one,
which also discarded the token the router emits for an asset-selector name
(e.g. 'gym env run mcqa'), yielding empty config_paths. Merge --env's resolved
paths with the paths already in the emitted token instead, so asset selectors,
--config, and --env coalesce. Fixes TestAssetSelectors regression.

Signed-off-by: Wojciech Prazuch <wprazuch@nvidia.com>
Signed-off-by: Wojciech Prazuch <wprazuch@nvidia.com>
@wprazuch
wprazuch force-pushed the wprazuch/env-run-by-name branch from fbdb9e2 to a64adfb Compare June 24, 2026 07:22
Signed-off-by: Wojciech Prazuch <wprazuch@nvidia.com>
@wprazuch

Copy link
Copy Markdown
Contributor Author

This duplicates part of #1630 functionality

@wprazuch wprazuch closed this Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant