Skip to content

fix(config): use is_truthy_value() for config boolean parsing across 8 paths - #50127

Closed
ryptotalent wants to merge 1 commit into
NousResearch:mainfrom
ryptotalent:fix/config-bool-truthy
Closed

fix(config): use is_truthy_value() for config boolean parsing across 8 paths#50127
ryptotalent wants to merge 1 commit into
NousResearch:mainfrom
ryptotalent:fix/config-bool-truthy

Conversation

@ryptotalent

Copy link
Copy Markdown
Contributor

Summary

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 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 shared is_truthy_value() parser.

Root Cause

Python's bool() treats any non-empty string as True:

bool("false")  # → True  (wrong!)
bool("0")      # → True  (wrong!)
bool("off")    # → True  (wrong!)

The project already has is_truthy_value() in utils.py that correctly handles the TRUTHY_STRINGS frozenset (1, true, yes, on) and treats all other strings as False. Several call sites were not using it.

Affected Config Paths

File Config Path Impact
agent/curator.py curator.enabled Curator runs even when disabled
agent/curator.py curator.prune_builtins Built-in skills pruned even when disabled
agent/curator.py curator.consolidate Skill consolidation runs even when disabled
agent/curator_backup.py curator.backup.enabled Backups skip even when enabled
agent/lsp/manager.py lsp.enabled LSP runs even when disabled
hermes_cli/webhook.py webhook.enabled Webhooks active even when disabled
hermes_cli/kanban_decompose.py kanban.auto_promote_children Auto-promotion runs even when disabled
hermes_cli/cli_commands_mixin.py display.runtime_footer.enabled Footer shows even when disabled
agent/agent_init.py sessions.write_json_snapshots JSON snapshots written even when disabled

Fix

Replace all bool(cfg.get("key", default)) with is_truthy_value(cfg.get("key"), default=default). This is the same pattern already used in agent/agent_init.py (line 1348), hermes_cli/tools_config.py, hermes_cli/auth.py, and other files that correctly parse config booleans.

Test Plan

  • Added 10 regression tests in test_config_truthy_parsing.py covering quoted "false", "0", "off", "true", and missing-key defaults
  • All 10 new tests pass
  • Existing curator tests pass (9/9)
  • Existing auxiliary_client tests pass (72/72)

Closes #49883

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
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/config Config system, migrations, profiles labels Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: voice.beep_enabled treats quoted false-like config strings as enabled

3 participants