Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 07bae2e

Browse files
committed
some bug fixes
1 parent 0f242bf commit 07bae2e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/ai_bot/bot.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def reply(context, &update_blk)
129129
tool = nil if tools_ran >= MAX_TOOLS
130130

131131
if tool.present?
132+
existing_tools << tool
132133
tool_call = partial
133134
if tool_call.partial?
134135
if tool.class.allow_partial_tool_calls?
@@ -138,7 +139,6 @@ def reply(context, &update_blk)
138139
next
139140
end
140141

141-
existing_tools << tool
142142
tool_found = true
143143
# a bit hacky, but extra newlines do no harm
144144
if needs_newlines

lib/completions/anthropic_message_processor.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def partial_tool_call
3535

3636
def to_tool_call
3737
parameters = JSON.parse(raw_json, symbolize_names: true)
38+
# we dupe to avoid poisoning the original tool call
39+
@tool_call = @tool_call.dup
3840
@tool_call.partial = false
3941
@tool_call.parameters = parameters
4042
@tool_call

0 commit comments

Comments
 (0)