将发送消息工具设为必选工具

This commit is contained in:
jxxghp
2026-05-27 08:48:56 +08:00
parent 990a28b51b
commit 5b6b4c9744
3 changed files with 8 additions and 40 deletions

View File

@@ -798,12 +798,6 @@ class MoviePilotAgent:
always_include_tools = (
MoviePilotToolFactory.get_tool_selector_always_include_names(tools)
)
if self.is_heartbeat_session:
available_tool_names = {
tool.name for tool in tools if getattr(tool, "name", None)
}
if "send_message" in available_tool_names:
always_include_tools.append("send_message")
# 中间件
middlewares = [

View File

@@ -91,7 +91,7 @@ class MoviePilotToolFactory:
"""
# 这些通用工具需要始终保留,避免大工具集裁剪后让 Agent 丢失基础的
# 文件系统、命令执行或交互确认能力。AskUserChoiceTool 仅在支持按钮
# 文件系统、命令执行、主动消息发送或交互确认能力。AskUserChoiceTool 仅在支持按钮
# 的渠道中才会实际注入,因此后续会再按已加载工具做一次求交集。
TOOL_SELECTOR_ALWAYS_INCLUDE_NAMES = (
"list_directory",
@@ -99,6 +99,7 @@ class MoviePilotToolFactory:
"read_file",
"edit_file",
"execute_command",
"send_message",
"ask_user_choice",
)