fix(copilot): the tool_call index starts from 1 in copilot + claude-sonnet-4.5 (#2794)

This commit is contained in:
yetone
2025-10-22 17:45:37 +08:00
committed by GitHub
parent c155ce9ff4
commit 164a86db6e
2 changed files with 2 additions and 2 deletions

View File

@@ -320,7 +320,7 @@ M._defaults = {
---@type AvanteSupportedProvider
claude = {
endpoint = "https://api.anthropic.com",
model = "claude-sonnet-4-20250514",
model = "claude-sonnet-4-5-20250929",
timeout = 30000, -- Timeout in milliseconds
context_window = 200000,
extra_request_body = {

View File

@@ -218,7 +218,7 @@ end
function M:finish_pending_messages(ctx, opts)
if ctx.content ~= nil and ctx.content ~= "" then self:add_text_message(ctx, "", "generated", opts) end
if ctx.tool_use_list then
for _, tool_use in ipairs(ctx.tool_use_list) do
for _, tool_use in pairs(ctx.tool_use_list) do
if tool_use.state == "generating" then self:add_tool_use_message(ctx, tool_use, "generated", opts) end
end
end