Skip to content

fix(config): coerce quoted-boolean config gates consistently - #18220

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-9dc430e8
May 1, 2026
Merged

teknium1 merged 2 commits into
mainfrom
hermes/hermes-9dc430e8

Conversation

@teknium1

@teknium1 teknium1 commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Salvages #16528 onto current main and widens the fix to two sibling sites with the same bug class.

Summary

Quoted YAML booleans (display.tool_progress_command: "false") were slipping through as truthy because if val: and bool(val) treat any non-empty string as true. Every call site that reads a user-writable bool config now routes through utils.is_truthy_value.

Root cause

bool("false") == True. YAML writes from manual edits, env-expanded values, or CLI hermes config set can all produce string values where a bool is expected.

Changes

  • @johnncenae's commit (aacba84) — the original PR fix(gateway): coerce tool_progress_command as a real boolean #16528, reshaped onto current main's cfg_get(...) helper:
    • hermes_cli/commands.py _resolve_config_gates
    • gateway/run.py _handle_verbose_command
    • gateway/run.py onboarding progress_callback gate
    • Regression tests in tests/gateway/test_verbose_command.py and tests/hermes_cli/test_commands.py
  • Sibling-site widening (75de6c5):
    • gateway/run.py _load_show_reasoning — same bug for display.show_reasoning
    • tools/skill_manager_tool.py _guard_agent_created_enabled — same bug for skills.guard_agent_created
    • Regression tests for both

Validation

  • scripts/run_tests.sh tests/tools/test_skill_manager_tool.py tests/gateway/test_reasoning_command.py tests/gateway/test_verbose_command.py tests/hermes_cli/test_commands.py → 232 passed
  • E2E: wrote real config files with "false"/"true"/bare-bool values, called _guard_agent_created_enabled() and the show_reasoning path end-to-end — all coerced correctly.

Closes #16528.
Credit to @johnncenae for the original diagnosis and fix.

johnncenae and others added 2 commits April 30, 2026 20:37
Widens #16528 to two sibling sites that had the same quoted-boolean
bug: a YAML string "false" (or "0", "no", "off") silently evaluated
truthy under bool() / if-check.

- gateway/run.py _load_show_reasoning: is_truthy_value wrap
- tools/skill_manager_tool.py _guard_agent_created_enabled: is_truthy_value wrap
- regression tests for both
@teknium1
teknium1 merged commit 27ec74c into main May 1, 2026
10 of 11 checks passed
@teknium1
teknium1 deleted the hermes/hermes-9dc430e8 branch May 1, 2026 03:40
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard tool/skills Skills system (list, view, manage) area/config Config system, migrations, profiles labels May 1, 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/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants