Files
python-sdk/pkg/hanzo-mcp/tests/test_cloud_tools_surface.py
zeekay 5acb444f42 rescue: snapshot of orphaned worktree /home/z/work/hanzo/python-sdk-limits
Parent checkout /home/z/work/hanzo/python-sdk was deleted; this is the surviving working tree
(worktree .git admin dir lost). Base: 5c0cc67e39 (2026-10-04).
Omitted (secret/size screen): 0 file(s).

Claude-Session: https://claude.ai/code/session_015XYKLn69gF4x75RWePpDBV
2026-11-20 23:15:53 -08:00

33 lines
1.2 KiB
Python

"""The cloud-backed tools ride the default surface of every mode.
A mode disables every registered tool it does not list, so a tool missing from
ESSENTIAL_TOOLS is installed and invisible. llm (completions, the catalog, the
plan's limits), kai_decide and repo (repositories on Hanzo git) are HTTP calls to
api.hanzo.ai, so every mode carries them.
"""
from hanzo_mcp.tools.common.entrypoint_loader import PACKAGE_TOOL_PREFIXES
from hanzo_mcp.tools.common.mode import ModeRegistry
from hanzo_mcp.tools.common.mode_loader import ModeLoader
from hanzo_mcp.tools.common.personality import ESSENTIAL_TOOLS
CLOUD_TOOLS = ("llm", "kai_decide", "repo")
def test_the_cloud_tools_are_essential():
assert set(CLOUD_TOOLS) <= set(ESSENTIAL_TOOLS)
assert PACKAGE_TOOL_PREFIXES["llm"] == ["llm", "kai_decide"]
assert PACKAGE_TOOL_PREFIXES["vcs"] == ["git", "repo"]
def test_every_mode_enables_them():
ModeLoader.initialize_modes()
modes = ModeRegistry.list()
assert modes
for mode in modes:
enabled = ModeLoader.get_enabled_tools_from_mode(force_mode=mode.name)
assert all(enabled.get(t) for t in CLOUD_TOOLS), (
mode.name,
{t: enabled.get(t) for t in CLOUD_TOOLS},
)