Clarify/narrow class hierarchy structure for code suggestion Task classes
Problem
With introduction of self-hosted models, we also added separate Task classes for completion/generation (CodeSuggestions::Tasks::SelfHostedCodeCompletion, CodeSuggestions::Tasks::SelfHostedCodeGeneration), IOW it adds self-hosted alternate class for each task so number of Task classes is doubled.
This is not ideal because:
- the original purpose of Task categorization is categorize requests by completion vs generation. Categorize them by self-hosted status is orthogonal to this original categorization and it is bit confusing in this class hierarchy
- it adds more complexity when it needs to be extended (as discussed in !157996 (comment 1978513324))
Proposal
Self-hosted classes are almost same as "default" task classes - these differ mainly in passing additional params. Perhaps we can just extract self-hosted logic in a mixin which is then included in completion/generation Task classes. Very rough snippet in !157996 (comment 1978976111)