Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions hermes_cli/tools_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()}
Expand Down
60 changes: 60 additions & 0 deletions tests/hermes_cli/test_tools_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 3 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading