fix: preserve subagent handoff tools during plugin filtering (#6155)

This commit is contained in:
Frank
2026-03-14 05:55:15 -07:00
committed by GitHub
parent dd6bc1dcdb
commit 06fd2d2428
2 changed files with 27 additions and 0 deletions
+5
View File
@@ -778,9 +778,14 @@ def _plugin_tool_fix(event: AstrMessageEvent, req: ProviderRequest) -> None:
continue
mp = tool.handler_module_path
if not mp:
# 没有 plugin 归属信息的工具(如 subagent transfer_to_*
# 不应受到会话插件过滤影响。
new_tool_set.add_tool(tool)
continue
plugin = star_map.get(mp)
if not plugin:
# 无法解析插件归属时,保守保留工具,避免误过滤。
new_tool_set.add_tool(tool)
continue
if plugin.name in event.plugins_name or plugin.reserved:
new_tool_set.add_tool(tool)