Skip to content

chore: improve CLI error on missing env + clarify debug-dump fallback#27

Merged
NorbertRop merged 1 commit into
mainfrom
chore/ergonomics-cleanup
May 26, 2026
Merged

chore: improve CLI error on missing env + clarify debug-dump fallback#27
NorbertRop merged 1 commit into
mainfrom
chore/ergonomics-cleanup

Conversation

@NorbertRop
Copy link
Copy Markdown
Contributor

Summary

Two tiny ergonomics fixes bundled (both touch one line each).

1. `config/train_selfplay.yaml`: `env: default` → `env: ???`

`config/train_selfplay.yaml` listed `- env: default` in its defaults block, but `config/env/default.yaml` does not exist. Bare invocation (or `--help`) crashed with:

```
hydra.errors.MissingConfigException: In 'train_selfplay.yaml': Could not find 'env/default'
```

Switching to `- env: ???` triggers Hydra's built-in required-key error instead:

```
You must specify 'env', e.g, env=
Available options:
...
```

`--help` also works now. No change for users who already pass `env=/` or `experiment=` — those override the placeholder.

2. `utils.py:dump_debug_file`: TODO → explanatory comment

The TODO at `utils.py:97` ("handle this somehow better, maybe wrap obs object with pprint") looked like deferred work, but the code around it already did the reasonable thing — try `.pprint(i)` when the obs type exposes it, fall back to summary stats (`shape`/`dtype`/`min`/`max`/`mean`) for bare arrays. Replace the misleading TODO with a comment that explains why the fallback exists, so future readers don't think it's incomplete.

Test plan

  • `uv run pytest tests/` — 233 passed, 2 skipped (no test changes; the dump_debug_file path isn't exercised by tests).
  • `uv run python train_selfplay.py --help` — exits cleanly, lists available env overrides.
  • `uv run python train_selfplay.py` — exits with "You must specify 'env'" error.

🤖 Generated with Claude Code

Two small ergonomics fixes:

1. config/train_selfplay.yaml previously listed ``- env: default`` in
   defaults, but config/env/default.yaml doesn't exist. Bare invocation
   crashed with an unhelpful "Could not find 'env/default'" error.
   Switch to ``- env: ???`` so Hydra emits its own actionable
   "You must specify 'env', e.g, env=<OPTION>" message instead, and
   --help works.

2. dump_debug_file in utils/utils.py had a TODO that read like deferred
   work but the surrounding code already did the right thing — try
   .pprint() when the obs type supports it, fall back to summary stats
   for bare arrays. Replace the TODO with an explanatory comment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NorbertRop NorbertRop merged commit 7a66088 into main May 26, 2026
1 check passed
@NorbertRop NorbertRop deleted the chore/ergonomics-cleanup branch May 26, 2026 13:52
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