Ironically, Aristotle originally reserved the term "mollusk" (malakia) only for cephalopods and slugs without shells. So some of them were grouped with some other mollusks (as we use the term) from the beginning. And so it remained for two millenia. Linneaus, for example, scattered mollusks among orders intestina, mollusca (Aristotle's malakia) and testacea as late as 1758, see Vinarski, The birth of malacology. When and how?.
In 1795 Cuvier finally proposed a new taxonomical principle based on internal anatomy rather than looks as the deciding factor. He had precursors, like da Costa in 1776, who considered anatomical taxonomy to be more "scientific", but they still saw shell-based taxonomy to be the only useful one in practice, because specimen were hard to obtain, and anatomical studies were "too abstruse and unentertaining" (sic!). Even Lamarck advocated shell-based taxonomy for such reasons as late as 1792. Cuvier's was quite a paradigm shift towards modern biology, which Foucault in The Order of Things described as follows:
"One day, towards the end of the eighteenth century, Cuvier was to topple the glass jars of the Museum, smash them open and dissect all the forms of animal visibility that the Classical age had preserved in them".
Cuvier's taxonomy changed the meaning of "mollusk" to the modern one, and united cephalopods with the rest under it. Here is from Vinarski:
"In his famous “Historia animalium”, Aristotle gave a collection of his own thorough observations on external morphology, anatomy, reproduction, ecology and behavior of many soft-bodied animals that
are classified today within the phylum Mollusca... The group of bloodless creatures included
at least four gene megista (great families): insects, crustaceans, testaceans, and mollusks (“Historia animalium”, I, 6). The first two families correspond approximately to the contemporary taxa, whereas testaceans (Ostracoderma) and mollusks (Malakia) are merely two divisions of that large group known today as the phylum Mollusca. Aristotle’s Malakia included mostly cephalopods, while Ostracoderma embraced shelled gastropods and bivalves, as well as some other shelled organisms. Hence, the modern
concept of mollusks did not exist in Aristotle’s time, and no serious emendations were made until the end of the 18th century."
"In 1795, Georges Cuvier proposed a new classification of invertebrate animals based on anatomical data. He created a new concept of mollusks as representatives of a unique type of morphological organization of animals. Before Cuvier, the name “mollusks” was used only for cephalopods without external shells and slugs, whereas all shelled mollusks were placed in another taxon, Testacea. The Cuvier’s works (1795a, b, 1798) are considered here as the starting point of transformation of classical conchology (= study of shells) into modern malacology (= study of molluscous animals as whole organisms). This process ended in 1825 when the very term “malacology” was finally established by Ducrotay de Blainville."