File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
lua/codecompanion/strategies/chat/tools Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 155155function Tools :_start_edit_tracking (tools )
156156 for _ , tool in ipairs (tools ) do
157157 local tool_name = tool [" function" ].name
158- local tool_args , _ = self :_parse_tool_arguments (tool )
158+ local tool_args = tool [" function" ].arguments
159+
160+ -- Handle argument parsing more robustly, like the original code
161+ if type (tool_args ) == " string" then
162+ local success , decoded = pcall (vim .json .decode , tool_args )
163+ if success then
164+ tool_args = decoded
165+ else
166+ tool_args = nil
167+ end
168+ end
169+
159170 EditTracker .start_tool_monitoring (tool_name , self .chat , tool_args )
160171 end
161172end
@@ -445,6 +456,7 @@ function Tools.resolve(tool)
445456 local err
446457 module , err = loadfile (callback )
447458 if err then
459+ log :error (" [Tools] Failed to load tool from %s: %s" , callback , err )
448460 return nil
449461 end
450462
You can’t perform that action at this time.
0 commit comments