fix: better tool name (#2671)

This commit is contained in:
yetone
2025-09-02 16:02:13 +08:00
committed by GitHub
parent a4a4c91711
commit 968a9a065d
2 changed files with 40 additions and 15 deletions

View File

@@ -291,7 +291,11 @@ function M.get_tool_display_name(message)
local item = message.message.content[1]
local tool_name = item.name
local native_tool_name = item.name
if native_tool_name == "other" and message.acp_tool_call then
native_tool_name = message.acp_tool_call.title or "Other"
end
local tool_name = native_tool_name
if message.displayed_tool_name then
tool_name = message.displayed_tool_name
else
@@ -325,7 +329,7 @@ function M.get_tool_display_name(message)
end
end
end
if param then tool_name = item.name .. "(" .. param .. ")" end
if param then tool_name = native_tool_name .. "(" .. param .. ")" end
end
---@cast tool_name string