fix(cli): hermes config set now parses YAML lists/dicts (#64323) - #64399
fix(cli): hermes config set now parses YAML lists/dicts (#64323)#64399webtecnica wants to merge 1 commit into
Conversation
Duplicate of #40546 — both add list/dict-literal parsing at the same |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for targeting a real config set failure. Current main leaves bracketed values as strings in hermes_cli/config.py:8264-8279; terminal.docker_volumes is list-typed (hermes_cli/config.py:1241) and Docker discards non-list values (tools/environments/docker.py:615-618).
Problems
- The new coercion block deletes the string-default guard from
e4ea0a0ed7fc24761b2b425146893561a73216e1. The current regression suite requiresapprovals.modevalues such asoffto remain strings (tests/hermes_cli/test_set_config_value.py:256-289); this branch would coerceofftofalse. - The PR patch also includes unrelated
DEFAULT_CONFIGchanges outside the stated parsing fix.
Suggested changes
- Preserve the string-typed guard and its tests; apply structured list/dict parsing only where it cannot reinterpret a declared string setting.
- Remove the unrelated default-config hunks and keep the salvage focused on structured config values.
Automated hermes-sweeper review.
|
|
||
| # Convert value to appropriate type (only for non-list/dict values) | ||
| if not isinstance(value, (list, dict)): | ||
| if value.lower() in {'true', 'yes', 'on'}: |
There was a problem hiding this comment.
Current main intentionally preserves string-typed settings: e4ea0a0ed7fc24761b2b425146893561a73216e1 and tests/hermes_cli/test_set_config_value.py:256-289 require approvals.mode off to remain a string. This unconditional scalar coercion would write boolean false; retain the declared-string guard and parse structures only where that invariant is preserved.
Fixes #64323. Added YAML safe_load when value starts with [ or {, so docker_volumes and other list configs are stored correctly instead of as literal strings.