refactor(llm_tools): use History.Helpers.get_tool_result_data()
Avoid poking into internals of avante.HistoryMessage, and use appropriate helper instead.
This commit is contained in:
@@ -148,7 +148,9 @@ function M.on_render(input, opts)
|
|||||||
local icon = Utils.icon("🔄 ")
|
local icon = Utils.icon("🔄 ")
|
||||||
local hl = Highlights.AVANTE_TASK_RUNNING
|
local hl = Highlights.AVANTE_TASK_RUNNING
|
||||||
if result_message then
|
if result_message then
|
||||||
if result_message.message.content[1].is_error then
|
local result = History.Helpers.get_tool_result_data(result_message)
|
||||||
|
if result then
|
||||||
|
if result.is_error then
|
||||||
state = "failed"
|
state = "failed"
|
||||||
icon = Utils.icon("❌ ")
|
icon = Utils.icon("❌ ")
|
||||||
hl = Highlights.AVANTE_TASK_FAILED
|
hl = Highlights.AVANTE_TASK_FAILED
|
||||||
@@ -158,6 +160,7 @@ function M.on_render(input, opts)
|
|||||||
hl = Highlights.AVANTE_TASK_COMPLETED
|
hl = Highlights.AVANTE_TASK_COMPLETED
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
local lines = {}
|
local lines = {}
|
||||||
table.insert(lines, Line:new({ { icon .. "Subtask " .. state, hl } }))
|
table.insert(lines, Line:new({ { icon .. "Subtask " .. state, hl } }))
|
||||||
table.insert(lines, Line:new({ { "" } }))
|
table.insert(lines, Line:new({ { "" } }))
|
||||||
|
|||||||
Reference in New Issue
Block a user