fix(cli): coerce use_gateway config flags in tool routing

This commit is contained in:
Yoimex 2026-04-26 11:28:42 +03:00 committed by Teknium
parent 36b13709f5
commit f66ebe64e8
4 changed files with 84 additions and 9 deletions

View file

@ -6,6 +6,8 @@ import os
from pathlib import Path
from typing import Any, Dict
from utils import is_truthy_value
_DEFAULT_BROWSER_PROVIDER = "local"
_DEFAULT_MODAL_MODE = "auto"
@ -115,7 +117,7 @@ def prefers_gateway(config_section: str) -> bool:
from hermes_cli.config import load_config
section = (load_config() or {}).get(config_section)
if isinstance(section, dict):
return bool(section.get("use_gateway"))
return is_truthy_value(section.get("use_gateway"), default=False)
except Exception:
pass
return False