fix(kanban): preserve worker tools with restricted toolsets

This commit is contained in:
haran2001
2026-05-18 20:24:31 -07:00
committed by Teknium
parent f12382fcc4
commit c30608cfbe
2 changed files with 37 additions and 1 deletions

View File

@@ -61,6 +61,32 @@ def test_kanban_tools_visible_with_env_var(monkeypatch, tmp_path):
assert kanban == expected, f"expected {expected}, got {kanban}"
def test_kanban_worker_env_overrides_profile_toolset_filter(monkeypatch, tmp_path):
"""Dispatcher-spawned workers must get lifecycle tools even when the
assignee profile restricts enabled toolsets and does not list kanban.
"""
monkeypatch.setenv("HERMES_KANBAN_TASK", "t_fake")
home = tmp_path / ".hermes"
home.mkdir()
monkeypatch.setenv("HERMES_HOME", str(home))
import tools.kanban_tools # ensure registered
from model_tools import _clear_tool_defs_cache, get_tool_definitions
from tools.registry import invalidate_check_fn_cache
invalidate_check_fn_cache()
_clear_tool_defs_cache()
schema = get_tool_definitions(
enabled_toolsets=["terminal"],
quiet_mode=True,
)
names = {s["function"].get("name") for s in schema if "function" in s}
assert "kanban_show" in names
assert "kanban_complete" in names
assert "kanban_block" in names
assert "kanban_list" not in names
def test_worker_with_kanban_toolset_still_hides_board_routing(monkeypatch, tmp_path):
"""Task scope wins over profile config for board-routing tools.