Commit 30b629b

mo khan <mo@mokhan.ca>
2026-01-22 02:03:51
fix: handle missing args in claude provider
1 parent 913c513
Changed files (2)
lib
lib/elelem/net/claude.rb
@@ -82,7 +82,8 @@ module Elelem
 
       def finalize_tool_calls(tool_calls)
         tool_calls.each do |tool_call|
-          tool_call[:arguments] = JSON.parse(tool_call.delete(:args))
+          args = tool_call.delete(:args)
+          tool_call[:arguments] = args.empty? ? {} : JSON.parse(args)
         end
       end
 
lib/elelem/agent.rb
@@ -93,7 +93,7 @@ module Elelem
       [content, tool_calls]
     rescue => e
       terminal.say "\n  ✗ #{e.message}"
-      [nil, []]
+      ["Error: #{e.message} #{e.backtrace.join("\n")}", []]
     end
 
     def combined_history