Conversation
…h#76138) hermes config set always writes a scalar, which corrupts list-typed settings (writes a quoted YAML string instead of a YAML sequence). Add a pre-write guard that checks _default_value_for_key() and the existing user config value. When either is a list, refuse the write with a clear error message pointing to hermes config edit. The guard covers both bare keys (e.g. 'toolsets') and dotted keys (e.g. 'plugins.enabled'). --force bypasses it for scripted use. Closes NousResearch#76138
Contributor
teknium1
reviewed
Aug 1, 2026
teknium1
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for targeting a real config-corruption path. Current main passes a string through set_config_value to _set_nested (hermes_cli/config.py:4869-4880, :4948), so list-shaped CLI input can indeed persist as a scalar.
Problems
- The proposed refusal also rejects the documented
hermes config set toolsets '["hermes-cli", "browser"]'workflow atwebsite/docs/user-guide/features/browser.md:422. The PR needs a maintainer decision between updating that contract or parsing supported list input; the related-PR discussion already identifies this distinction. - The diff changes only
hermes_cli/config.py; it adds no regression tests. Existing tests cover list-index navigation (tests/hermes_cli/test_set_config_value.py:198) and mapping replacement (:574), not this list-leaf guard. --forcegains a list-overwrite bypass, while its parser help still says it only skips the unknown-key notice (hermes_cli/subcommands/config.py:43-47).
Suggested changes
- Resolve the documented list-input behavior, add rejection/force regression tests, and update
--forcehelp if the bypass remains.
Automated hermes-sweeper review.
| # YAML string instead of a YAML sequence). Check both the existing | ||
| # user-config value and the declared default — either being a list is | ||
| # enough to refuse (unless --force). | ||
| if not force and "." not in key: |
Collaborator
There was a problem hiding this comment.
This guard rejects the documented hermes config set toolsets '["hermes-cli", "browser"]' workflow (website/docs/user-guide/features/browser.md:422). Please either parse that supported list syntax here or update the documentation after confirming refusal is the intended UX.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
hermes config setalways writes a scalar value. When the target key is list-typed (e.g.toolsets,plugins.enabled,terminal.env_passthrough), the command silently writes a quoted YAML string instead of a YAML sequence, corrupting the config.The corrupted config silently breaks downstream consumers that iterate the value as a list.
Fix
Add a pre-write guard in
set_config_valuethat checks:DEFAULT_CONFIGvia_default_value_for_key()When either is a
list, refuse the write with a clear error message:The guard covers both bare keys and dotted keys.
--forcebypasses it for scripted use.Testing
config_settests passhermes config set plugins.enabled foowhen the key is list-typed--forceallows the write throughCloses #76138