fix: merge plugin tools into builtin toolsets

This commit is contained in:
Wysie 2026-04-22 02:24:24 +08:00 committed by Teknium
parent d9f0875591
commit 0120d8f31e
2 changed files with 23 additions and 3 deletions

View file

@ -521,13 +521,18 @@ def get_toolset(name: str) -> Optional[Dict[str, Any]]:
None: If toolset not found
"""
toolset = TOOLSETS.get(name)
if toolset:
return toolset
try:
from tools.registry import registry
except Exception:
return None
return toolset if toolset else None
if toolset:
merged_tools = sorted(
set(toolset.get("tools", []))
| set(registry.get_tool_names_for_toolset(name))
)
return {**toolset, "tools": merged_tools}
registry_toolset = name
description = f"Plugin toolset: {name}"