fix(config): use is_truthy_value() for config boolean parsing across 8 paths - #50127
Closed
ryptotalent wants to merge 1 commit into
Closed
fix(config): use is_truthy_value() for config boolean parsing across 8 paths#50127ryptotalent wants to merge 1 commit into
ryptotalent wants to merge 1 commit into
Conversation
Several config boolean reads used raw bool() coercion on values from
config.yaml. In Python, every non-empty string is truthy, so quoted
false-like values ("false", "0", "off") were treated as enabled.
Replaced with the shared is_truthy_value() parser which correctly
handles the TRUTHY_STRINGS frozenset (1/true/yes/on) and treats all
other strings as False.
Affected config paths:
- curator.enabled, curator.prune_builtins, curator.consolidate
- curator.backup.enabled
- lsp.enabled
- webhook.enabled
- kanban.auto_promote_children
- display.runtime_footer.enabled
- sessions.write_json_snapshots
Closes NousResearch#49883
6 tasks
1 task
This was referenced Aug 3, 2026
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.
Summary
Several config boolean reads used raw
bool()coercion on values fromconfig.yaml. In Python, every non-empty string is truthy, so quoted false-like values ("false","0","off") were silently treated as enabled.This is the same bug class as #49883 (voice.beep_enabled), but affecting 8 config paths across the codebase. This PR fixes all of them by replacing
bool(cfg.get(...))with the sharedis_truthy_value()parser.Root Cause
Python's
bool()treats any non-empty string asTrue:The project already has
is_truthy_value()inutils.pythat correctly handles theTRUTHY_STRINGSfrozenset (1,true,yes,on) and treats all other strings asFalse. Several call sites were not using it.Affected Config Paths
agent/curator.pycurator.enabledagent/curator.pycurator.prune_builtinsagent/curator.pycurator.consolidateagent/curator_backup.pycurator.backup.enabledagent/lsp/manager.pylsp.enabledhermes_cli/webhook.pywebhook.enabledhermes_cli/kanban_decompose.pykanban.auto_promote_childrenhermes_cli/cli_commands_mixin.pydisplay.runtime_footer.enabledagent/agent_init.pysessions.write_json_snapshotsFix
Replace all
bool(cfg.get("key", default))withis_truthy_value(cfg.get("key"), default=default). This is the same pattern already used inagent/agent_init.py(line 1348),hermes_cli/tools_config.py,hermes_cli/auth.py, and other files that correctly parse config booleans.Test Plan
test_config_truthy_parsing.pycovering quoted"false","0","off","true", and missing-key defaultsCloses #49883