mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-29 01:31:41 +00:00
fix(cli): coerce use_gateway config flags in tool routing
This commit is contained in:
parent
36b13709f5
commit
f66ebe64e8
4 changed files with 84 additions and 9 deletions
|
|
@ -22,6 +22,7 @@ from tools.tool_backend_helpers import (
|
|||
managed_nous_tools_enabled,
|
||||
normalize_browser_cloud_provider,
|
||||
normalize_modal_mode,
|
||||
prefers_gateway,
|
||||
resolve_modal_backend_state,
|
||||
resolve_openai_audio_api_key,
|
||||
)
|
||||
|
|
@ -189,6 +190,27 @@ class TestHasDirectModalCredentials:
|
|||
assert has_direct_modal_credentials() is True
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# prefers_gateway
|
||||
# ---------------------------------------------------------------------------
|
||||
class TestPrefersGateway:
|
||||
"""Honor bool-ish config values for tool gateway routing."""
|
||||
|
||||
def test_returns_false_for_quoted_false(self, monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
"hermes_cli.config.load_config",
|
||||
lambda: {"web": {"use_gateway": "false"}},
|
||||
)
|
||||
assert prefers_gateway("web") is False
|
||||
|
||||
def test_returns_true_for_quoted_true(self, monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
"hermes_cli.config.load_config",
|
||||
lambda: {"web": {"use_gateway": "true"}},
|
||||
)
|
||||
assert prefers_gateway("web") is True
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# resolve_modal_backend_state
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue