From 8b44b0f2cf6f90523de5e5bc37b8d21a74725730 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Fri, 1 Aug 2025 10:35:29 +0200 Subject: [PATCH] fix(functions): properly filter tool schema from functions Signed-off-by: Tomas Slusny --- lua/CopilotChat/functions.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/CopilotChat/functions.lua b/lua/CopilotChat/functions.lua index 782510ea..6e936a3d 100644 --- a/lua/CopilotChat/functions.lua +++ b/lua/CopilotChat/functions.lua @@ -44,12 +44,12 @@ local function sorted_propnames(schema) return prop_names end -local function filter_schema(tbl) +local function filter_schema(tbl, root) if type(tbl) ~= 'table' then return tbl end - if utils.empty(tbl.properties) then + if root and utils.empty(tbl.properties) then return nil end @@ -139,7 +139,7 @@ function M.parse_schema(tool) end if schema then - schema = filter_schema(schema) + schema = filter_schema(schema, true) end return schema