Conversation
Closes NousResearch#49883 Several config paths used bool() to parse YAML config values, which treats any non-empty string as True — including 'false', '0', 'off', and 'no'. Users setting these string values in config.yaml expected them to disable features, but bool() silently enabled them instead. Replaced bool() with is_truthy_value() in 7 files (9 config paths): - agent/agent_init.py: write_json_snapshots, task_completion_guidance, parallel_tool_call_guidance, environment_probe - agent/curator.py: paused, enabled, prune_builtins, consolidate - agent/curator_backup.py: enabled - agent/lsp/manager.py: enabled - hermes_cli/webhook.py: enabled - hermes_cli/cli_commands_mixin.py: enabled - hermes_cli/kanban_decompose.py: auto_promote_children
teknium1
left a comment
There was a problem hiding this comment.
Thanks for identifying a real coercion bug: current main still uses bool() for the targeted agent-init settings (agent/agent_init.py:1287,1491-1503), and utils.is_truthy_value() has the intended semantics (utils.py:22-30).
Problems
- The same
curator.prune_builtinssetting is still parsed withbool()intools/skill_usage.py:257; changing onlyagent/curator.pyleaves that active path wrong for quoted"false". - The
/footerchange does not fix runtime footer delivery:gateway/runtime_footer.py:73and:84still treat quoted"false"as enabled. tests/hermes_cli/test_config_truthy_parsing.pytests only the shared helper, already covered bytests/test_utils_truthy_values.py:6-21; it does not invoke a changed accessor.
Suggested changes
- Extend the selected sweep to the same-key/runtime readers above.
- Add production-path regression tests that pass quoted false through the affected config accessors.
Automated hermes-sweeper review.
| @@ -2345,7 +2346,7 @@ def _handle_footer_command(self, cmd_original: str) -> None: | |||
|
|
|||
| cfg = load_config() or {} | |||
| footer_cfg = ((cfg.get("display") or {}).get("runtime_footer") or {}) | |||
There was a problem hiding this comment.
This corrects the /footer command's displayed state, but the delivered gateway footer still parses both global and platform overrides with bool() in gateway/runtime_footer.py:73 and :84. Please update those runtime readers in the same sweep so enabled: "false" actually disables the footer.
| when used in config paths, instead of bool() which treats any | ||
| non-empty string as True. | ||
| """ | ||
| import pytest |
There was a problem hiding this comment.
This file exercises only the utility, whose falsey-string behavior is already covered by tests/test_utils_truthy_values.py. Add regression tests through the changed config accessors so a missed import or an unconverted call site fails coverage.
Problem
Several config boolean reads used
bool(cfg.get(key, default)), which treats the string"false"as truthy. Users settingenabled: falseorpaused: "false"inconfig.yamlgot the opposite behavior.Fix
Replace all
bool(cfg.get(...))calls withis_truthy_value()fromutils.py, which correctly handles string booleans ("false","0","no","off"→False).Files changed
agent/agent_init.py— 3 sitesagent/curator.py— 4 sites (is_paused,is_enabled,get_prune_builtins,get_consolidate)agent/curator_backup.py— 1 siteagent/lsp/manager.py— 1 sitehermes_cli/cli_commands_mixin.py— 1 sitehermes_cli/kanban_decompose.py— 1 sitehermes_cli/webhook.py— 2 sitesTests
Added
tests/hermes_cli/test_config_truthy_parsing.pycovering string"false","0","no","off", numeric0, and actualFalsefor each affected function.Verification
Rebased against
main(9be292f, 2026-07-01). All changes apply cleanly.is_truthy_value()already exists inutils.pyand is used inagent_init.py— this PR extends its usage to the remaining call sites that still usebool().