refactor(sidebar&claude): Simplify Claude provider and unify sidebar UI behavior (#2017)

This commit is contained in:
aniaan
2025-05-08 21:48:17 +08:00
committed by GitHub
parent f65e72900f
commit 1e80305af2
2 changed files with 1 additions and 14 deletions

View File

@@ -317,19 +317,8 @@ function M:parse_response(ctx, data_stream, event_state, opts)
if jsn.delta.stop_reason == "end_turn" then if jsn.delta.stop_reason == "end_turn" then
opts.on_stop({ reason = "complete", usage = jsn.usage }) opts.on_stop({ reason = "complete", usage = jsn.usage })
elseif jsn.delta.stop_reason == "tool_use" then elseif jsn.delta.stop_reason == "tool_use" then
local tool_use_list = {}
for _, content_block in ipairs(ctx.content_blocks) do
if content_block.type == "tool_use" then
table.insert(tool_use_list, {
id = content_block.id,
name = content_block.name,
input_json = content_block.input_json,
})
end
end
opts.on_stop({ opts.on_stop({
reason = "tool_use", reason = "tool_use",
-- tool_use_list = tool_use_list,
usage = jsn.usage, usage = jsn.usage,
}) })
end end

View File

@@ -2016,9 +2016,7 @@ function Sidebar:create_selected_code_container()
winid = self.input_container.winid, winid = self.input_container.winid,
}, },
buf_options = buf_options, buf_options = buf_options,
win_options = { win_options = vim.tbl_deep_extend("force", base_win_options, {}),
winhighlight = base_win_options.winhighlight,
},
size = { size = {
height = selected_code_size + 3, height = selected_code_size + 3,
}, },