Skip to content

Commit 76cc416

Browse files
authored
fix(completion): require tool uri for input completion (#1328)
Previously, input completion was triggered for tools without a defined `uri`, which could lead to errors or unexpected behavior. This change ensures that input completion only occurs when both the tool and its schema are present and the tool has a valid `uri` property.
1 parent f60803f commit 76cc416

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/CopilotChat/completion.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function M.complete(without_input)
146146
if not without_input and vim.startswith(prefix, '#') and vim.endswith(prefix, ':') then
147147
local found_tool = config.functions[prefix:sub(2, -2)]
148148
local found_schema = found_tool and functions.parse_schema(found_tool)
149-
if found_tool and found_schema then
149+
if found_tool and found_schema and found_tool.uri then
150150
async.run(function()
151151
local value = functions.enter_input(found_schema, source)
152152
if not value then

0 commit comments

Comments
 (0)