From 97d6f25008d6091c490057a74f24aafa14c086a4 Mon Sep 17 00:00:00 2001 From: briandevans <252620095+briandevans@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:16:06 -0700 Subject: [PATCH] test(toolsets): include kanban in expected post-#17805 toolset assertions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The kanban PR (#17805, c86842546) added the `kanban` toolset and `tools/kanban_tools.py`, but didn't update three pre-existing test assertions that bake the full toolset/tool inventory: * `tests/tools/test_registry.py::test_matches_previous_manual_builtin_tool_set` hard-codes the manual list of builtin tool modules. `tools.kanban_tools` was missing. * `tests/test_tui_gateway_server.py::test_load_enabled_toolsets_rejects_disabled_mcp_env` and `test_load_enabled_toolsets_falls_back_when_tui_env_invalid` both expect `["memory"]` from `_load_enabled_toolsets()`. With kanban now auto-recovered by `_get_platform_tools` (its tools live in hermes-cli's universe but are not in CONFIGURABLE_TOOLSETS), the resolver returns `["kanban", "memory"]`. * `tests/hermes_cli/test_tools_config.py::test_get_platform_tools_preserves_explicit_empty_selection` asserts `set()` for an explicit empty list. The recovery loop now also surfaces `kanban`. Reframed to assert the contract the test name describes — no CONFIGURABLE toolset gets re-enabled when the user explicitly saved an empty list — which stays correct as more non-configurable platform toolsets are added. Verified the failures reproduce on clean origin/main (180a7036b) with `.[all,dev]`-equivalent extras (fastapi, starlette, httpx, pytest-asyncio) and that all four pass with this commit applied. CI on main itself is currently red on these tests; this restores green for everyone's PRs. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/hermes_cli/test_tools_config.py | 11 ++++++++++- tests/test_tui_gateway_server.py | 7 +++++-- tests/tools/test_registry.py | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/hermes_cli/test_tools_config.py b/tests/hermes_cli/test_tools_config.py index deab21fc2..d5b8aec3b 100644 --- a/tests/hermes_cli/test_tools_config.py +++ b/tests/hermes_cli/test_tools_config.py @@ -120,7 +120,16 @@ def test_get_platform_tools_preserves_explicit_empty_selection(): enabled = _get_platform_tools(config, "cli") - assert enabled == set() + # An explicit empty list disables every CONFIGURABLE toolset (web, + # terminal, memory, …). Non-configurable platform toolsets that ride + # along on the platform's default composite (e.g. `kanban`, whose tools + # live in _HERMES_CORE_TOOLS but aren't user-toggleable) are still + # auto-recovered by _get_platform_tools so saving via `hermes tools` + # doesn't silently drop them. The contract this test guards is the + # configurable side: nothing the user could have checked in the TUI + # checklist should reappear here. + configurable = {ts_key for ts_key, _, _ in CONFIGURABLE_TOOLSETS} + assert enabled.isdisjoint(configurable) def test_apply_toolset_change_from_default_does_not_enable_default_off_toolsets(): diff --git a/tests/test_tui_gateway_server.py b/tests/test_tui_gateway_server.py index d57a6cd88..a652cb860 100644 --- a/tests/test_tui_gateway_server.py +++ b/tests/test_tui_gateway_server.py @@ -115,7 +115,10 @@ def test_load_enabled_toolsets_rejects_disabled_mcp_env(monkeypatch, capsys): ) monkeypatch.setattr(config_mod, "load_config", lambda: {"platform_toolsets": {"cli": ["memory"]}}) - assert server._load_enabled_toolsets() == ["memory"] + # Sorted: ["kanban", "memory"]. `kanban` is auto-recovered by + # _get_platform_tools because it's a non-configurable platform toolset + # whose tools live in hermes-cli's universe (see toolsets.py). + assert server._load_enabled_toolsets() == ["kanban", "memory"] err = capsys.readouterr().err assert "ignoring disabled MCP servers" in err assert "mcp-off" in err @@ -134,7 +137,7 @@ def test_load_enabled_toolsets_falls_back_when_tui_env_invalid(monkeypatch, caps monkeypatch.setattr(config_mod, "load_config", lambda: {"platform_toolsets": {"cli": ["memory"]}}) - assert server._load_enabled_toolsets() == ["memory"] + assert server._load_enabled_toolsets() == ["kanban", "memory"] assert "using configured CLI toolsets" in capsys.readouterr().err diff --git a/tests/tools/test_registry.py b/tests/tools/test_registry.py index 3c753f64f..b6e40da35 100644 --- a/tests/tools/test_registry.py +++ b/tests/tools/test_registry.py @@ -304,6 +304,7 @@ class TestBuiltinDiscovery: "tools.file_tools", "tools.homeassistant_tool", "tools.image_generation_tool", + "tools.kanban_tools", "tools.memory_tool", "tools.mixture_of_agents_tool", "tools.process_registry",