Plugin rake task running multiple times - what are we missing?

It certainly seems plausible that if there is already a mechanism for loading the tasks, this might cause them to be loaded a second time.

I wonder if using either of the following would deal with this (I think I would lean towards the latter since I don’t know what side effects there could be to autoloading once):

config.autoload_once_paths << File.join(config.root, "lib")
config.autoload_lib(ignore: %w( tasks ))