test(setup): blank-slate disabled list must not overlap kept tools

Overlap-invariant regression test from PR #58686 — no toolset in the
blank-slate disabled_toolsets may share a tool with a kept toolset,
since the subtraction happens at tool granularity (#57315, #58281).
This commit is contained in:
HexLab98 2026-07-05 14:12:23 -07:00 committed by Teknium
parent e5636da5d8
commit a05b64d677

View file

@ -45,6 +45,25 @@ class TestBlankSlateMinimalToolsets:
disabled = set(cfg["agent"]["disabled_toolsets"])
assert "coding" not in disabled
def test_no_disabled_bundle_overlaps_kept_tools(self):
"""Invariant: ``disabled_toolsets`` is applied at *tool* granularity and
a single tool can belong to several toolsets, so no disabled entry may
share a tool with a kept toolset it would silently strip that tool
from the blank-slate agent (#57315, #58281).
"""
from toolsets import resolve_toolset
cfg = {}
_blank_slate_minimal_toolsets(cfg)
kept_tools = set()
for ts in cfg["platform_toolsets"]["cli"]:
kept_tools.update(resolve_toolset(ts))
for ts in cfg["agent"]["disabled_toolsets"]:
overlap = set(resolve_toolset(ts)) & kept_tools
assert not overlap, (
f"disabled toolset '{ts}' overlaps kept tools {sorted(overlap)}; "
"it would silently strip them from the blank-slate agent"
)
def test_resolver_yields_exactly_file_and_terminal(self):
from hermes_cli.tools_config import _get_platform_tools
cfg = {}