Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -750,12 +750,9 @@ private boolean isFinished(Msg msg) {
List<ToolUseBlock> toolCalls = msg.getContentBlocks(ToolUseBlock.class);

// No tool calls - finished
if (toolCalls.isEmpty()) {
return true;
}

// Has tool calls but none are in toolkit - finished
return toolCalls.stream().noneMatch(tc -> toolkit.getTool(tc.getName()) != null);
// If there are tool calls (even non-existent ones), continue to acting phase
// where ToolExecutor will return "Tool not found" error for the model to see
return toolCalls.isEmpty();
}

/**
Expand Down
Loading