fix: coerce show_reasoning and guard_agent_created config bools

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
This commit is contained in:
Teknium
2026-04-30 20:39:29 -07:00
parent bb706c3f38
commit 27ec74c68a
4 changed files with 70 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ from pathlib import Path
from hermes_constants import get_hermes_home, display_hermes_home
from typing import Dict, Any, Optional, Tuple
from utils import atomic_replace
from utils import atomic_replace, is_truthy_value
from hermes_cli.config import cfg_get
logger = logging.getLogger(__name__)
@@ -67,7 +67,10 @@ def _guard_agent_created_enabled() -> bool:
try:
from hermes_cli.config import load_config
cfg = load_config()
return bool(cfg_get(cfg, "skills", "guard_agent_created", default=False))
return is_truthy_value(
cfg_get(cfg, "skills", "guard_agent_created"),
default=False,
)
except Exception:
return False