Severity: 🟠 high | Category: Error Handling | Finding ID: ERR-f5cffc34
Location: nemo_gym/cli/main.py:949
Problem
New. _handle_pydantic_validation_error only formats a ValidationError whose exc.title names a BaseNeMoGymCLIConfig subclass; anything else hits a bare raise at line 949, which chains a second traceback onto the first. Overriding ++head_server.port=11577 replaces the whole head_server block and drops the defaulted host; gym env resolve accepts this and exits 0, then gym env start spins up a Ray cluster, tears it down, and dies with ~40 lines ending in ValidationError: 1 validation error for BaseServerConfig / host / Field required. Nothing says the override dropped a sibling key or that ++head_server.host must be given too.
Suggested fix
Format every ValidationError through the same helper (fall back to the missing/invalid summary for non-CLI models) rather than re-raising, and validate BaseServerConfig before Ray/server spin-up. For partial overrides of a defaulted block, merge the defaults rather than replacing the block, or name the dropped keys in the error.
Evidence
pydantic_core._pydantic_core.ValidationError: 1 validation error for BaseServerConfig / host / Field required [type=missing, input_value={'port': 11577}, input_type=DictConfig]
Found by the error-quality-auditor critic in DX review Gym-1-20260821203248 — incremental from v0.5.0 to fa0d25158. Parent tracker #2214.
Severity: 🟠 high | Category: Error Handling | Finding ID:
ERR-f5cffc34Location:
nemo_gym/cli/main.py:949Problem
New.
_handle_pydantic_validation_erroronly formats a ValidationError whoseexc.titlenames a BaseNeMoGymCLIConfig subclass; anything else hits a bareraiseat line 949, which chains a second traceback onto the first. Overriding++head_server.port=11577replaces the whole head_server block and drops the defaultedhost;gym env resolveaccepts this and exits 0, thengym env startspins up a Ray cluster, tears it down, and dies with ~40 lines ending inValidationError: 1 validation error for BaseServerConfig / host / Field required. Nothing says the override dropped a sibling key or that++head_server.hostmust be given too.Suggested fix
Format every ValidationError through the same helper (fall back to the missing/invalid summary for non-CLI models) rather than re-raising, and validate BaseServerConfig before Ray/server spin-up. For partial overrides of a defaulted block, merge the defaults rather than replacing the block, or name the dropped keys in the error.
Evidence
Found by the
error-quality-auditorcritic in DX reviewGym-1-20260821203248— incremental from v0.5.0 tofa0d25158. Parent tracker #2214.