fix(delegate): retain composite child toolsets
This commit is contained in:
@@ -5,7 +5,7 @@ from __future__ import annotations
|
||||
import logging
|
||||
from typing import List, Optional
|
||||
|
||||
from toolsets import TOOLSETS
|
||||
from toolsets import TOOLSETS, resolve_toolset
|
||||
from tools.delegate_tool_config import _get_inherit_mcp_toolsets
|
||||
|
||||
logger = logging.getLogger("tools.delegate_tool") # log-record parity with the origin module
|
||||
@@ -51,7 +51,10 @@ def _strip_blocked_tools(toolsets: List[str]) -> List[str]:
|
||||
"""Remove toolsets whose tools are ALL blocked (derived from DELEGATE_BLOCKED_TOOLS so the two can't drift) plus
|
||||
composite toolsets children must never get (``delegation``, ``kanban``)."""
|
||||
blocked_toolset_names = {"delegation", "kanban"} | {
|
||||
name for name, defn in TOOLSETS.items() if all(t in DELEGATE_BLOCKED_TOOLS for t in defn.get("tools", []))
|
||||
name
|
||||
for name in TOOLSETS
|
||||
if (resolved_tools := resolve_toolset(name, include_registry=False))
|
||||
and all(tool in DELEGATE_BLOCKED_TOOLS for tool in resolved_tools)
|
||||
}
|
||||
return [t for t in toolsets if t not in blocked_toolset_names]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user