Cherry-pick for fix Rlinf config path#6138
Conversation
Greptile SummaryThis PR fixes a bug where the RLinf config YAML file could not be located when installed as part of the
Confidence Score: 5/5Safe to merge — both changed files now delegate to a shared, well-structured resolver with a correct fallback chain. The two-line change in each file is minimal and targeted: it replaces a hardcoded directory fallback with a call to the already-reviewed resolve_config_dir helper that handles explicit paths, package-tree search, and script-directory fallback in that order. The assignment order fix in play_rlinf.py (moving config_name before config_dir) is also correct and required. No new dependencies or side effects are introduced. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User runs play_rlinf.py / train_rlinf.py] --> B{--config_path provided?}
B -- Yes --> C[Use explicit config_path]
B -- No --> D{isaaclab_tasks installed?}
D -- Yes --> E[rglob for config_name.yaml in package tree]
E --> F{Match found?}
F -- Yes --> G[Use matched directory]
F -- No --> H[Fall back to script directory]
D -- No --> H
C --> I[Set RLINF_CONFIG_FILE env var]
G --> I
H --> I
I --> J[Hydra loads config YAML]
Reviews (1): Last reviewed commit: "fix config path" | Re-trigger Greptile |
There was a problem hiding this comment.
Review Summary
Clean, focused bug fix that correctly resolves the config path issue for RLinf scripts.
What Changed
Both play_rlinf.py and train_rlinf.py previously used a naive fallback for config directory resolution:
config_dir = args_cli.config_path or str(SCRIPT_DIR)This failed when YAML configs live inside the isaaclab_tasks package tree rather than the script directory. The fix delegates to cli_args.resolve_config_dir() which implements a proper 3-step resolution:
- Explicit
--config_path(user override) - Search
isaaclab_taskspackage tree viarglob - Fall back to script directory
Assessment
✅ Correctness — The fix properly addresses the root cause. Reordering config_name before config_dir is necessary since resolve_config_dir requires the config name for package-tree search.
✅ Consistency — Both scripts now use the same centralized resolution logic, reducing divergence risk.
resolve_config_dir uses rglob and picks matches[0] if multiple YAMLs match. For uniquely-named configs this is fine, but if a config name could appear in multiple subdirectories, the first match (filesystem order) would win silently. This is pre-existing behavior in cli_args.py and not introduced by this PR, but worth noting for future hardening.
Verdict
LGTM — minimal, well-scoped fix that centralizes config resolution correctly.
Description
Fixes path of RLinf config yaml file caused by missing path resolver.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there