Include list of tracked feature flags in code suggestion requests
Proposal
Include a list of feature flags which we want to track in both direct (completion) and indirect (generation) requests sent to AI gateway.
For direct requests we already send a set of headers which are then included in each completion request, so we can just pass this information in a header too (then no additional change on language server side is needed).
- define a list of feature flags which we want to track in Rails (could be just a constant, the point is we don't want to include all feature flags)
- add a header to code suggestion requests (direct and indirect) which contains status of defined feature flags (will be parse on AI GW side gitlab-org/modelops/applied-ml/code-suggestions/ai-assist#556 (closed))
The header could look for example like this:
X-Gitlab-Experiments: code_suggestions_context=1,code_suggestions_direct_completions=0
Why
The AI GW currently doesn't have any view into what feature flags are available or not, nor does it have access to user/project/namespace/etc. information. In order to sync what feature flags are enabled to inform the AI GW, we must pass them as a header so the information is included whenever the code suggestions endpoint is called.