[feature request] Trainer.with_updates discards previous mixins

Hi all, I’m working on an application where some trainer, e.g. PPOTrainer, is run inside the env of another trainer. To get this to work with tune’s resource management I figure the resources_per_trial settings needs to include the resources used by both trainers. Now I noticed that for RLlib trainers this is managed automatically through Trainer.default_resource_request. For trainers like impala and apex this method is overwritten through a mixin that gets passed to agents.trainer_template.build_trainer. My problem with the current setup is that I might want to add an OverrideDefaultResourceRequest mixin to a trainer which has its own mixins already. The old mixins would then be discarded when with_updates is called.

I know one solution is to not use with_updates and to instead manually define a class that subclasses both the trainer and the additional mixins. However this solution doesn’t feel right to me since the with_updates method handles pretty much all trainer modifications, so it makes more sense for it to support additional mixins as well. The second and bigger issue with this is that whenever a mixin is added manually, calling with_updates on the resulting trainer class will not create a trainer with the manually added mixin. This could make for a confusing situation, so I want to ask whether this functionality could be added to with_updates?