Skip to content

Bug: Malformed +config_paths surfaces raw Pydantic ValidationError stack #1490

Open

Description

@cwing-nvidia

Summary

Found by our virtual developer review agent.

When a user passes a malformed +config_paths value (e.g. a scalar string instead of a list), NeMo Gym raises a raw Pydantic ValidationError with a full traceback instead of a clear, actionable error message.

Location

nemo_gym/global_config.py — config parsing (~line 412)

ta = TypeAdapter(List[str])
config_paths = merged_config_for_config_paths.get(CONFIG_PATHS_KEY_NAME) or []
config_paths = ta.validate_python(config_paths)

Current behavior

Passing a scalar instead of a list produces a library-internal error with a full traceback:

pydantic_core.ValidationError: 1 validation error for list[str]
  Input should be a valid list

The message is technically correct but reads as an internal Pydantic failure (including a pydantic.dev URL in the traceback) and gives no guidance on the expected Hydra list syntax.

Expected behavior

A malformed +config_paths value should fail fast with a concise, user-facing message explaining the expected format — no traceback.

Suggested fix

Wrap validate_python in a try/except ValidationError block and re-raise a clean SystemExit with guidance on the expected Hydra list syntax:

try:
    config_paths = ta.validate_python(config_paths)
except ValidationError:
    raise SystemExit(
        "+config_paths must be a list, e.g. "
        '+config_paths=[a.yaml,b.yaml]'
    )

Catch this in the CLI entrypoint so a traceback is not printed.

Repro

# Scalar instead of list — exact Hydra syntax may vary, but any non-list value triggers this:
ng_run "+config_paths=resources_servers/example_single_tool_call/configs/example_single_tool_call.yaml"

Activity

  1. added theissue type on Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions