diff --git a/hermes_cli/tools_config.py b/hermes_cli/tools_config.py index 1a0b306708cf..61edb846fb63 100644 --- a/hermes_cli/tools_config.py +++ b/hermes_cli/tools_config.py @@ -547,6 +547,18 @@ def _get_platform_tools( enabled_toolsets.add(pts) # else: known but not in config = user disabled it + # Honcho toolset: auto-enable when configured, similar to plugins. + # Honcho is not in CONFIGURABLE_TOOLSETS (it's enabled via `hermes honcho setup`), + # so it would be filtered out when platform_toolsets is explicitly configured. + if "honcho" not in enabled_toolsets: + try: + from honcho_integration.client import HonchoClientConfig + hcfg = HonchoClientConfig.from_global_config() + if hcfg.enabled and (hcfg.api_key or hcfg.base_url): + enabled_toolsets.add("honcho") + except Exception: + pass + # Preserve any explicit non-configurable toolset entries (for example, # custom toolsets or MCP server names saved in platform_toolsets). platform_default_keys = {p["default_toolset"] for p in PLATFORMS.values()} diff --git a/tests/hermes_cli/test_tools_config.py b/tests/hermes_cli/test_tools_config.py index 946ba77fd839..614bdb22d129 100644 --- a/tests/hermes_cli/test_tools_config.py +++ b/tests/hermes_cli/test_tools_config.py @@ -381,3 +381,63 @@ def test_skills_config_covers_tools_config_platforms(self): f"Platform {platform!r} in tools_config but missing from " f"skills_config PLATFORMS" ) + + +def test_get_platform_tools_auto_enables_honcho_when_configured(): + """Honcho toolset is auto-enabled when configured, even with explicit platform_toolsets. + + This ensures honcho tools are available when: + 1. User has run `hermes tools` to customize toolset config (platform_toolsets exists) + 2. User has run `hermes honcho setup` (valid HonchoClientConfig exists) + + Regression test for https://github.com/NousResearch/hermes-agent/issues/4523 + """ + from types import SimpleNamespace + from unittest.mock import patch + + config = {"platform_toolsets": {"cli": ["web", "memory"]}} + + # Mock HonchoClientConfig to simulate a configured Honcho instance + mock_config = SimpleNamespace(enabled=True, api_key="test-key", base_url="https://honcho.example.com") + + with patch( + "honcho_integration.client.HonchoClientConfig.from_global_config", + return_value=mock_config, + ): + enabled = _get_platform_tools(config, "cli") + + assert "honcho" in enabled, "honcho toolset should be auto-enabled when configured" + assert "web" in enabled, "explicitly selected toolsets should still be present" + assert "memory" in enabled, "explicitly selected toolsets should still be present" + + +def test_get_platform_tools_does_not_enable_honcho_when_not_configured(): + """Honcho toolset is NOT auto-enabled when not configured.""" + from unittest.mock import patch + + config = {"platform_toolsets": {"cli": ["web", "memory"]}} + + # Simulate honcho_integration not being configured (import error) + with patch.dict("sys.modules", {"honcho_integration": None, "honcho_integration.client": None}): + enabled = _get_platform_tools(config, "cli") + + assert "honcho" not in enabled, "honcho should not be enabled when not configured" + + +def test_get_platform_tools_does_not_enable_honcho_when_disabled(): + """Honcho toolset is NOT auto-enabled when explicitly disabled.""" + from types import SimpleNamespace + from unittest.mock import patch + + config = {"platform_toolsets": {"cli": ["web", "memory"]}} + + # Mock HonchoClientConfig with enabled=False + mock_config = SimpleNamespace(enabled=False, api_key="test-key", base_url="https://honcho.example.com") + + with patch( + "honcho_integration.client.HonchoClientConfig.from_global_config", + return_value=mock_config, + ): + enabled = _get_platform_tools(config, "cli") + + assert "honcho" not in enabled, "honcho should not be enabled when disabled in config" diff --git a/uv.lock b/uv.lock index 925c0d5e69cd..0c19c2d2c4b5 100644 --- a/uv.lock +++ b/uv.lock @@ -1643,7 +1643,7 @@ wheels = [ [[package]] name = "hermes-agent" -version = "0.7.0" +version = "0.6.0" source = { editable = "." } dependencies = [ { name = "anthropic" }, @@ -1682,6 +1682,7 @@ all = [ { name = "faster-whisper" }, { name = "honcho-ai" }, { name = "lark-oapi" }, + { name = "matrix-nio", extra = ["e2e"] }, { name = "mcp" }, { name = "modal" }, { name = "numpy" }, @@ -1800,6 +1801,7 @@ requires-dist = [ { name = "hermes-agent", extras = ["feishu"], marker = "extra == 'all'" }, { name = "hermes-agent", extras = ["homeassistant"], marker = "extra == 'all'" }, { name = "hermes-agent", extras = ["honcho"], marker = "extra == 'all'" }, + { name = "hermes-agent", extras = ["matrix"], marker = "extra == 'all'" }, { name = "hermes-agent", extras = ["mcp"], marker = "extra == 'all'" }, { name = "hermes-agent", extras = ["messaging"], marker = "extra == 'all'" }, { name = "hermes-agent", extras = ["modal"], marker = "extra == 'all'" },